Have given the two classes as well as the XML file below. Can someone plz help. error also given below.
ERROR:
org.testng.TestNGException:
proofOfConcept.ClassTwo.testcase2result() is depending on method public void proofOfConcept.ClassOne.test1(), which is not annotated with @Test or not included.
at org.testng.internal.MethodHelper.findDependedUponMethods(MethodHelper.java:111)
at org.testng.internal.MethodHelper.topologicalSort(MethodHelper.java:241)
at org.testng.internal.MethodHelper.sortMethods(MethodHelper.java:317)
at org.testng.internal.MethodHelper.collectAndOrderMethods(MethodHelper.java:64)
at org.testng.TestRunner.initMethods(TestRunner.java:438)
at org.testng.TestRunner.init(TestRunner.java:271)
at org.testng.TestRunner.init(TestRunner.java:241)
at org.testng.TestRunner.(TestRunner.java:192)
at org.testng.remote.support.RemoteTestNG6_12$1.newTestRunner(RemoteTestNG6_12.java:33)
at org.testng.remote.support.RemoteTestNG6_12$DelegatingTestRunnerFactory.newTestRunner(RemoteTestNG6_12.java:66)
at org.testng.SuiteRunner$ProxyTestRunnerFactory.newTestRunner(SuiteRunner.java:713)
at org.testng.SuiteRunner.init(SuiteRunner.java:260)
at org.testng.SuiteRunner.(SuiteRunner.java:198)
at org.testng.TestNG.createSuiteRunner(TestNG.java:1295)
at org.testng.TestNG.createSuiteRunners(TestNG.java:1273)
at org.testng.TestNG.runSuitesLocally(TestNG.java:1128)
at org.testng.TestNG.runSuites(TestNG.java:1049)
at org.testng.TestNG.run(TestNG.java:1017)
at org.testng.remote.AbstractRemoteTestNG.run(AbstractRemoteTestNG.java:114)
at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:251)
at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:77)
Class 1:
package proofOfConcept;
import org.testng.annotations.Test;
public class ClassOne {
@Test
public void test1(){
System.out.println(“test1”);
}
}
Class 2:
package proofOfConcept;
import org.testng.annotations.*;
import org.testng.annotations.Test;
@BeforeTest(dependsOnMethods={“proofOfConcept.ClassOne.test1”})
public class ClassTwo {
@Test
public void testcase1result() throws InterruptedException{
System.out.println("test");
}
@Test
public void testcase2result() throws InterruptedException{
System.out.println("test2");
}
}
XML file:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
<suite name="Suite" >
<test name="Test">
<classes>
<class name="proofOfConcept.ClassOne"/>
<class name="proofOfConcept.ClassTwo"/>
</classes>
</test> <!-- Test -->
</suite> <!-- Suite -->