From: Timothy W. <tw...@us...> - 2006-10-21 21:33:56
|
Make sure the stuff done in fixtureSetUp gets done before you try anything (see also the runBare method). On Oct 21, 2006, at 11:17 AM, Steven Buroff wrote: > I know this isn't supported but someone suggested it might work so > I thought I'd report > my results - it didn't. > > I created a class ExtComponentTestFixture which simply extends > ComponentTestFixture > and makes the showFrame methods public. Then, in my test file, I > created a JLabel and > did a showFrame on the label. It bombs with a null pointer > exception. Here is the trace. > > java.lang.NullPointerException > at junit.extensions.abbot.ComponentTestFixture.waitForWindow > (ComponentTestFixture.java:161) > at junit.extensions.abbot.ComponentTestFixture.showWindow > (ComponentTestFixture.java:151) > at junit.extensions.abbot.ComponentTestFixture.showFrame > (ComponentTestFixture.java:110) > at sjb.testing.abbot.ExtComponentTestFixture.showFrame > (ExtComponentTestFixture.java:40) > at junit.extensions.abbot.ComponentTestFixture.showFrame > (ComponentTestFixture.java:94) > at sjb.testing.abbot.ExtComponentTestFixture.showFrame > (ExtComponentTestFixture.java:52) > at sjb.gui.domtree.FirstTests.testDisplayTestData1(FirstTests.java: > 49) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at sun.reflect.NativeMethodAccessorImpl.invoke > (NativeMethodAccessorImpl.java:39) > at sun.reflect.DelegatingMethodAccessorImpl.invoke > (DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:589) > at org.testng.internal.MethodHelper.invokeMethod(MethodHelper.java: > 624) > at org.testng.internal.Invoker.invokeMethod(Invoker.java:413) > at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:815) > at org.testng.internal.TestMethodWorker.invokeTestMethods > (TestMethodWorker.java:132) > at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java: > 120) > at org.testng.TestRunner.runWorkers(TestRunner.java:703) > at org.testng.TestRunner.privateRun(TestRunner.java:661) > at org.testng.TestRunner.run(TestRunner.java:542) > at org.testng.SuiteRunner.runTest(SuiteRunner.java:261) > at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:250) > at org.testng.SuiteRunner.privateRun(SuiteRunner.java:232) > at org.testng.SuiteRunner.run(SuiteRunner.java:158) > at org.testng.TestNG.createAndRunSuiteRunners(TestNG.java:980) > at org.testng.TestNG.runSuitesLocally(TestNG.java:940) > at org.testng.TestNG.run(TestNG.java:685) > at org.testng.eclipse.runner.RemoteTestNG.run(RemoteTestNG.java:85) > at org.testng.eclipse.runner.RemoteTestNG.main(RemoteTestNG.java:127) > Here is the code. > > public class FirstTests { > private final ExtComponentTestFixture testFixture = > new ExtComponentTestFixture("First Tests"); > @Test > public void testDisplayTestData1() throws > ParserConfigurationException, > FileNotFoundException, SAXException, IOException, > InterruptedException > { > JLabel lbl = new JLabel("I am here!"); > Frame frame = testFixture.showFrame(lbl); > Thread.sleep(2000); > frame.dispose(); > > } > } > I tried running it with both testng and JUnit. I got the same > results with both. > > Steve > > ---------------------------------------------------------------------- > --- > Using Tomcat but need to do more? Need to support web services, > security? > Get stuff done quickly with pre-integrated technology to make your > job easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache > Geronimo > http://sel.as-us.falkag.net/sel? > cmd=lnk&kid=120709&bid=263057&dat=121642______________________________ > _________________ > abbot-users mailing list > abb...@li... > https://lists.sourceforge.net/lists/listinfo/abbot-users Timothy Wall http://abbot.sf.net |