Skip to main content



      Home
Home » Language IDEs » Java Development Tools (JDT) » Setting up JUnit configuration from Eclipse
Setting up JUnit configuration from Eclipse [message #124067] Wed, 03 December 2003 08:39 Go to next message
Eclipse UserFriend
Originally posted by: jonnala.cse.sc.edu

Hello All
I am quite new to Eclipse and am using it at my work. I really like it
very much.

My issue is: I have some test cases written using JUnit framework. All
these tests need to know about a configuration file (.cfg), which is
stored at a unique location on my machine. So I am mentioning this in the
VM arguments of the pop-up dialog box (you get it when you do Run->
Run....) as following:

-DIT_CONFIG_DOMAINS_DIR= C:\...path to the dir...
-DIT_DOMAIN_NAME= ...\path to the .cfg file.....

I have to redo this for all the test cases in the same package. Is there
no way to tell eclipse to use the same VM arguments for the whole project
(or that package)?? I want to avoid copy, pasting these variables from one
test setup to another.

Thanks a lot for your answers.
Mahesh :)
Re: Setting up JUnit configuration from Eclipse [message #124185 is a reply to message #124067] Wed, 03 December 2003 10:13 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: eclipse-user.jibeinc.com

Mahesh wrote:

> Hello All
> I am quite new to Eclipse and am using it at my work. I really like it
> very much.
>
> My issue is: I have some test cases written using JUnit framework. All
> these tests need to know about a configuration file (.cfg), which is
> stored at a unique location on my machine. So I am mentioning this in the
> VM arguments of the pop-up dialog box (you get it when you do Run->
> Run....) as following:
>
> -DIT_CONFIG_DOMAINS_DIR= C:\...path to the dir...
> -DIT_DOMAIN_NAME= ...\path to the .cfg file.....
>
> I have to redo this for all the test cases in the same package. Is there
> no way to tell eclipse to use the same VM arguments for the whole project
> (or that package)?? I want to avoid copy, pasting these variables from one
> test setup to another.

Two options:
1) Create a TestSuite that includes all the tests you want to run that
need this property. Then you can run the Suite instead of individual
tests. It is easy to change what tests are included in a Suite.

2) Once you have the config set up for one test, you can right-click on
it in the Launch configurations dialog and choose Duplicate to create
new launch configs based on the original.

HTH,
Eric
--
Eric Rizzo
Software Architect
Jibe, Inc.
http://www.jibeinc.com
Re: Setting up JUnit configuration from Eclipse [message #124236 is a reply to message #124185] Wed, 03 December 2003 11:25 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: jonnala.cse.sc.edu

Hello Eric
Thanks a lot for your quick response. I have a new problem now.

I want to be able to run these test scripts even outside eclipse. So I
decided not to have any VM arguments, but to programatically build the
System.properties. The cfg file or the properties file can be placed
anywhere in the system.

So, is there one central place in eclipse (like a xml file or some config
file) where I can mention the location of my cfg or properties file?? As I
am writing code to parse these files and build my System.properties, I
would not have to include VM arguments in the Run dialog box.

Thanks once again for your help.
Mahesh :)

Eric Rizzo wrote:

> Mahesh wrote:

> > Hello All
> > I am quite new to Eclipse and am using it at my work. I really like it
> > very much.
> >
> > My issue is: I have some test cases written using JUnit framework. All
> > these tests need to know about a configuration file (.cfg), which is
> > stored at a unique location on my machine. So I am mentioning this in the
> > VM arguments of the pop-up dialog box (you get it when you do Run->
> > Run....) as following:
> >
> > -DIT_CONFIG_DOMAINS_DIR= C:...path to the dir...
> > -DIT_DOMAIN_NAME= ...path to the .cfg file.....
> >
> > I have to redo this for all the test cases in the same package. Is there
> > no way to tell eclipse to use the same VM arguments for the whole project
> > (or that package)?? I want to avoid copy, pasting these variables from one
> > test setup to another.

> Two options:
> 1) Create a TestSuite that includes all the tests you want to run that
> need this property. Then you can run the Suite instead of individual
> tests. It is easy to change what tests are included in a Suite.

> 2) Once you have the config set up for one test, you can right-click on
> it in the Launch configurations dialog and choose Duplicate to create
> new launch configs based on the original.

> HTH,
> Eric
Re: Setting up JUnit configuration from Eclipse [message #124511 is a reply to message #124236] Thu, 04 December 2003 11:50 Go to previous message
Eclipse UserFriend
Originally posted by: bob.news.gmx.net

"Mahesh" <jonnala@cse.sc.edu> schrieb im Newsbeitrag
news:bql2ot$glb$1@eclipse.org...
> Hello Eric
> Thanks a lot for your quick response. I have a new problem now.
>
> I want to be able to run these test scripts even outside eclipse. So I
> decided not to have any VM arguments, but to programatically build the
> System.properties. The cfg file or the properties file can be placed
> anywhere in the system.
>
> So, is there one central place in eclipse (like a xml file or some
config
> file) where I can mention the location of my cfg or properties file?? As
I
> am writing code to parse these files and build my System.properties, I
> would not have to include VM arguments in the Run dialog box.

You can set an environment variable before you start eclipse. That way
both code run from within eclipse as well as from command line can read
that var.

robert

>
> Thanks once again for your help.
> Mahesh :)
>
> Eric Rizzo wrote:
>
> > Mahesh wrote:
>
> > > Hello All
> > > I am quite new to Eclipse and am using it at my work. I really like
it
> > > very much.
> > >
> > > My issue is: I have some test cases written using JUnit framework.
All
> > > these tests need to know about a configuration file (.cfg), which is
> > > stored at a unique location on my machine. So I am mentioning this
in the
> > > VM arguments of the pop-up dialog box (you get it when you do Run->
> > > Run....) as following:
> > >
> > > -DIT_CONFIG_DOMAINS_DIR= C:...path to the dir...
> > > -DIT_DOMAIN_NAME= ...path to the .cfg file.....
> > >
> > > I have to redo this for all the test cases in the same package. Is
there
> > > no way to tell eclipse to use the same VM arguments for the whole
project
> > > (or that package)?? I want to avoid copy, pasting these variables
from one
> > > test setup to another.
>
> > Two options:
> > 1) Create a TestSuite that includes all the tests you want to run that
> > need this property. Then you can run the Suite instead of individual
> > tests. It is easy to change what tests are included in a Suite.
>
> > 2) Once you have the config set up for one test, you can right-click
on
> > it in the Launch configurations dialog and choose Duplicate to create
> > new launch configs based on the original.
>
> > HTH,
> > Eric
>
>
Previous Topic:What happened to the TypeInfo class?
Next Topic:Best DB plugin?
Goto Forum:
  


Current Time: Sun Jun 22 13:49:53 EDT 2025

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

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

Back to the top