java.lang.NullPointerException
at java.util.Hashtable.put(Hashtable.java:394)
at java.util.Properties.setProperty(Properties.java:143)
at
org.testng.reporters.JUnitXMLReporter.createElement(JUnitXMLReporter.java:
157)
at
org.testng.reporters.JUnitXMLReporter.generateReport(JUnitXMLReporter.java:
146)
at
org.testng.reporters.JUnitXMLReporter.onFinish(JUnitXMLReporter.java:
100)
at org.testng.TestRunner.fireEvent(TestRunner.java:1217)
at org.testng.TestRunner.afterRun(TestRunner.java:994)
at org.testng.TestRunner.run(TestRunner.java:523)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:323)
at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:318)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:290)
at org.testng.SuiteRunner.run(SuiteRunner.java:195)
at org.testng.TestNG.createAndRunSuiteRunners(TestNG.java:907)
at org.testng.TestNG.runSuitesLocally(TestNG.java:874)
at org.testng.TestNG.run(TestNG.java:783)
at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:75)
at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:127)
--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To post to this group, send email to testng...@googlegroups.com.
To unsubscribe from this group, send email to testng-users...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/testng-users?hl=en.
I have a number of tests all share a set of common properties such as
"host" and "port" in the following example. Other than that they are
not related and there are a lot of them. So I would like to make
different tests classes. Ideally, I would like to load the common
parameters once @BeforeSuite. Then all the test classes can use it.
What is the best way to do this? I could not figure it out at the
time. Using test inheritance like in the following example worked for
me until now.
----------------- test classes -------------------------
public class TestTest extends TestBaseClass {
@Test
public void doTest() {
System.out.println("this does nothing!");
}
}
public class TestBaseClass implements ITest {
private String name;
public String getTestName() {
return name;
}
protected void setTestName(String name) {
this.name = name;
}
@BeforeClass
@Parameters( { "host", "port" })
public void openSocket(String host, int port) {
System.out.println("Host: " + host);
System.out.println("Port: " + port);
}
}
------------------ testng.xml ---------------------
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
<suite name="Test Test">
<parameter name="host" value="localhost" />
<parameter name="port" value="6666" />
<test name="Test Test">
<classes>
<class name="TestTest" />
</classes>
</test>
</suite>
--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To post to this group, send email to testng...@googlegroups.com.
To unsubscribe from this group, send email to testng-users...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/testng-users?hl=en.
--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To post to this group, send email to testng...@googlegroups.com.
To unsubscribe from this group, send email to testng-users...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/testng-users?hl=en.
--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To post to this group, send email to testng...@googlegroups.com.
To unsubscribe from this group, send email to testng-users...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/testng-users?hl=en.