las
unread,Dec 16, 2009, 1:15:34 PM12/16/09Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to testng-users
Hi,
I am a newbie with testng, please advise. I have a test data (few
thousand) in a file and one to run a few test cases on each line of
data. I used netbeans and its testng plugin create a test class
below.
I run the test at the command line:
java mypack.TestMulti
Is this proper way to test ?
Thanks.
las
--------------codes sample----------------------
package mypack;
class TestMulti {
static File file;
static Scanner scanner;
static StringBuffer stringBuff = new StringBuffer();
public static void main (String[] args) {
file = new File ("c:\MybigFile.dat");
scanner = new Scanner(file);
scanner.useDelimiter("\r\n");
while (scanner.hasNext()) {
stringBuff.setLength(0);
stringBuff.append (scanner.next());
TestNG testng = new TestNG();
testng.setTestClasses(new Class[]
{mypack.TestMulti.class} );
testng.run();
}
}
@Test
public void method1 () {
Assert.assertEquals (myExpectValue,stringBuff.toString());
}
@Test
public void method2 () {
Assert.assertEquals (myExpectValue2,stringBuff.toString());
}
}