|
Getting command line arguements in JUnit/ Eclipse -
04-16-2009, 01:39 AM
Can some one please tell how to get a variable from command line arguements in Junit when using eclipse.
In a normal program the main method you have String args[]
Under run configuration you can give the arguements[] ${String_prompt} or ${file_prompt}
Even though in test cases can give the ${String_prompt} or ${file_prompt} at the runtime there is no args[] variables to access that value programattically.
bascially i want to have something like this
In the test file have to initialize a object SourceFile. Source files constructor is like this.
SourceFile(String s).
This String should be taken from command line. But there is no way to get that String from command line.
I mean can't create a Source file like this.
SourceFile sf = new SourceFile(args[0])
How to solve this problem. I thanks in advance
Reply With Quote
|