Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Test and Performance Tools Platform (TPTP) » Working directory for TPTP JUnit tests
Working directory for TPTP JUnit tests [message #92201] Tue, 06 February 2007 09:17 Go to next message
Eclipse UserFriend
Originally posted by: jekutsch.inf.fu-berlin.de

Hi,

seems like a newby question; hope I didn't overlook anything: My application
under test requires to be executed with a specific working directory (to
load properties and other initialisation files from disk). I built a TPTP
Junit system test which boots the application under local_deployment (which,
as far as I understand, used the integrated agent controller). The working
directory is being set to c:\temp\jekutsch: 'c:\temp' being the
LOCAL_AGENT_TEMP_DIR, and 'jekutsch' being the USR_NAME (see
http://help.eclipse.org/help32/index.jsp?topic=/org.eclipse. hyades.test.doc.user/ref/rdeploymentGroundRules.htm
and the Agent Controller->Integrated Agent Controller preferences).

This doesn't suite my needs, and I can't find a way to set the working
directory using TPTP's "Test" Launch Configuration, which provides
surprisingly few options compared to the standard Eclipse Launch
Configuration, e.g. JUnit lauches. What am I supposed to do?

I guess I should define a deployment, but
1) the concept of deployments is quite complicated for a local test runs,
especially: Only files on the CLASSPATH seemed to be deployed, i.e. copied.
Should the classpath be set to each of the directories required by the
application?
2) the rational of setting the working directory to ROOTDIR + USR_NAME isn't
clear to me.

Any comments and tipps are welcome!
Sebastian
Re: Working directory for TPTP JUnit tests [message #92382 is a reply to message #92201] Fri, 09 February 2007 15:31 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: cindyjin.ca.ibm.com

Hi Sebastian:

To answer your questions based on my experience:
1. Yes, I set the classpath to directories of all required jars.
2. The files in classpath will be deployed to ROOTDIR + USR_NAME, i.e if
I set ROOTDIR ="/", USR_NAME="tmp", the files will be deployed to "/tmp".

Hope this can help you

Cindy

Sebastian Jekutsch wrote:
> Hi,
>
> seems like a newby question; hope I didn't overlook anything: My application
> under test requires to be executed with a specific working directory (to
> load properties and other initialisation files from disk). I built a TPTP
> Junit system test which boots the application under local_deployment (which,
> as far as I understand, used the integrated agent controller). The working
> directory is being set to c:\temp\jekutsch: 'c:\temp' being the
> LOCAL_AGENT_TEMP_DIR, and 'jekutsch' being the USR_NAME (see
> http://help.eclipse.org/help32/index.jsp?topic=/org.eclipse. hyades.test.doc.user/ref/rdeploymentGroundRules.htm
> and the Agent Controller->Integrated Agent Controller preferences).
>
> This doesn't suite my needs, and I can't find a way to set the working
> directory using TPTP's "Test" Launch Configuration, which provides
> surprisingly few options compared to the standard Eclipse Launch
> Configuration, e.g. JUnit lauches. What am I supposed to do?
>
> I guess I should define a deployment, but
> 1) the concept of deployments is quite complicated for a local test runs,
> especially: Only files on the CLASSPATH seemed to be deployed, i.e. copied.
> Should the classpath be set to each of the directories required by the
> application?
> 2) the rational of setting the working directory to ROOTDIR + USR_NAME isn't
> clear to me.
>
> Any comments and tipps are welcome!
> Sebastian
>
>
Re: Working directory for TPTP JUnit tests [message #92409 is a reply to message #92382] Sun, 11 February 2007 11:03 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: jekutsch.inf.fu-berlin.de

Hi Cindy,

thanks for your answer. You write:

> 1. Yes, I set the classpath to directories of all required jars.

which refers to my question whether all required files/folders/jars should
be included in the CLASSPATH (defined in the deployment's artifact).

I did it and it worked, but only after to previously copied some the needed
files to the ROOTDIR+USR_NAME manually. The reasons are as follows. TPTPs
deployment mechanism seems to use some kind of file name substitution. Since
all file names in TPTP configuration files are absolute file names of the
TPTP client host (e.g. D:\Dev\TPTP is my workspace path), on deployment the
prefix (seems to be the workspace path) must be substituted by the
ROOTDIR+USR_NAME on the deployment host. This usually includes the project
folder names from which most of the required resources are taken from, at
least in my case. As a result, the deployment folder has subfolders named
after the project folder names. That's not what my application under test
expects at the working directory. (I'm not sure if anybody of you
understands what I'm trying to explain...)

> 2. The files in classpath will be deployed to ROOTDIR + USR_NAME, i.e if I
> set ROOTDIR ="/", USR_NAME="tmp", the files will be deployed to "/tmp".

Ok, the trick to redefine the USR_NAME occured to me as well, but it has
kind of bad smell because of possibly unanticipated side effects. Btw,
provided the deployment is done for a dedicated testing host (not localhost)
used for different testing tasks, it indeed may be a useful idea to append
the USR_NAME to the deployment ROOTDIR.

Sebastian
Re: Working directory for TPTP JUnit tests [message #92439 is a reply to message #92409] Tue, 13 February 2007 14:52 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: cindyjin.ca.ibm.com

Hi Sebastian :

I am not very clear about your question below:
"As a result, the deployment folder has subfolders named
after the project folder names. That's not what my application under
test expects at the working directory."

Do you mean you want to deploy your application which is under the
subfolder to the working directory?

Another way to have the files deployed is to create your junit test
project as a plugin project, add other required plugin project as
dependencies to your test project. Then all the jars or bin folder of
dependencies plugin project will be deployed.

Another question, are you using the local deployment?

Thanks
Cindy


Sebastian Jekutsch wrote:
> Hi Cindy,
>
> thanks for your answer. You write:
>
>> 1. Yes, I set the classpath to directories of all required jars.
>
> which refers to my question whether all required files/folders/jars should
> be included in the CLASSPATH (defined in the deployment's artifact).
>
> I did it and it worked, but only after to previously copied some the needed
> files to the ROOTDIR+USR_NAME manually. The reasons are as follows. TPTPs
> deployment mechanism seems to use some kind of file name substitution. Since
> all file names in TPTP configuration files are absolute file names of the
> TPTP client host (e.g. D:\Dev\TPTP is my workspace path), on deployment the
> prefix (seems to be the workspace path) must be substituted by the
> ROOTDIR+USR_NAME on the deployment host. This usually includes the project
> folder names from which most of the required resources are taken from, at
> least in my case. As a result, the deployment folder has subfolders named
> after the project folder names. That's not what my application under test
> expects at the working directory. (I'm not sure if anybody of you
> understands what I'm trying to explain...)
>
>> 2. The files in classpath will be deployed to ROOTDIR + USR_NAME, i.e if I
>> set ROOTDIR ="/", USR_NAME="tmp", the files will be deployed to "/tmp".
>
> Ok, the trick to redefine the USR_NAME occured to me as well, but it has
> kind of bad smell because of possibly unanticipated side effects. Btw,
> provided the deployment is done for a dedicated testing host (not localhost)
> used for different testing tasks, it indeed may be a useful idea to append
> the USR_NAME to the deployment ROOTDIR.
>
> Sebastian
>
>
Re: Working directory for TPTP JUnit tests [message #92482 is a reply to message #92439] Wed, 14 February 2007 10:09 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: jekutsch.inf.fu-berlin.de

Hi Cindy,

> I am not very clear about your question below:
> "As a result, the deployment folder has subfolders named
> after the project folder names. That's not what my application under test
> expects at the working directory."
>
> Do you mean you want to deploy your application which is under the
> subfolder to the working directory?

Here's part of my folder structure:
<workspace>/ECG_Lab
<workspace>/ECG_Test

ECG_Lab contains src, bin, etc as usual, and the required properties files,
in my case a folder named /msdt. Using this folder as working dir would be
ok. My testsuites are in ECG_Test. The CLASSPATH for the tests is set to
some .class files and .jars below ECG_Lab. Deploying this results in the
following copies:
<ROOTDIR>/<USR_NAME>/ECG_Lab
<ROOTDIR>/<USR_NAME>/ECG_Test
as well as other folder, for example parts of eclipse plugin jars, because
I'm using datapools. The working directory is set to <ROOTDIR>/<USR_NAME>,
where obviously /msdt isn't present. (It's copied to /ECG_Lab.). Currently,
I simply copied the /msdt folder to <ROOTDIR>/<USR_NAME> manually, which is
o.k. since it seldom is altered.

> Another question, are you using the local deployment?

Yes, but shouldn't make any difference, should it?

Thanks
Sebastian
Re: Working directory for TPTP JUnit tests [message #92512 is a reply to message #92482] Wed, 14 February 2007 16:03 Go to previous message
Eclipse UserFriend
Originally posted by: cindyjin.ca.ibm.com

HiSebastian:

Where is /msdt originally located? Is it at<workspace>/ECG_Lab/msdt? If
yes, it is copied to the <ROOTDIR>/<USR_NAME>/ECG_Lab/msdt. If not, you
can add that folder to the classpath in the artifact file.

Thanks
Cindy
Sebastian Jekutsch wrote:
> Hi Cindy,
>
>> I am not very clear about your question below:
>> "As a result, the deployment folder has subfolders named
>> after the project folder names. That's not what my application under test
>> expects at the working directory."
>>
>> Do you mean you want to deploy your application which is under the
>> subfolder to the working directory?
>
> Here's part of my folder structure:
> <workspace>/ECG_Lab
> <workspace>/ECG_Test
>
> ECG_Lab contains src, bin, etc as usual, and the required properties files,
> in my case a folder named /msdt. Using this folder as working dir would be
> ok. My testsuites are in ECG_Test. The CLASSPATH for the tests is set to
> some .class files and .jars below ECG_Lab. Deploying this results in the
> following copies:
> <ROOTDIR>/<USR_NAME>/ECG_Lab
> <ROOTDIR>/<USR_NAME>/ECG_Test
> as well as other folder, for example parts of eclipse plugin jars, because
> I'm using datapools. The working directory is set to <ROOTDIR>/<USR_NAME>,
> where obviously /msdt isn't present. (It's copied to /ECG_Lab.). Currently,
> I simply copied the /msdt folder to <ROOTDIR>/<USR_NAME> manually, which is
> o.k. since it seldom is altered.
>
>> Another question, are you using the local deployment?
>
> Yes, but shouldn't make any difference, should it?
>
> Thanks
> Sebastian
>
>
Previous Topic:need help on how to use the tptp for GUI testing
Next Topic:java applets and performance testing
Goto Forum:
  


Current Time: Tue Mar 19 02:03:43 GMT 2024

Powered by FUDForum. Page generated in 0.02496 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top