This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Steps to reproduce: 1. call typeText() function in JTextFieldOperator class. Result: NPE occur java.lang.NullPointerException at org.netbeans.jemmy.ClassReference.<init> (ClassReference.java:43) at org.netbeans.jemmy.EventDispatcher.<init> (EventDispatcher.java:83) at org.netbeans.jemmy.operators.ComponentOperator.<init> (ComponentOperator.java:177) at org.netbeans.jemmy.operators.ContainerOperator.<init> (ContainerOperator.java:65) at org.netbeans.jemmy.operators.WindowOperator.<init> (WindowOperator.java:68) at org.netbeans.jemmy.util.DefaultVisualizer.makeVisible (DefaultVisualizer.java:195) at org.netbeans.jemmy.operators.ComponentOperator.makeComponent Visible(ComponentOperator.java:793) at org.netbeans.jemmy.operators.JTextComponentOperator.typeText (JTextComponentOperator.java:512) at org.netbeans.jemmy.operators.JTextComponentOperator.typeText (JTextComponentOperator.java:534) at org.netbeans.web.test.util.Utils.fillAddBreakpointException (Unknown Source) at org.netbeans.test.gui.web.JSPServletDebug.JavaDebugging.test StopsOnExceptionCaughtBreakpoint(JavaDebugging.java:168) 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:324) at junit.framework.TestCase.runTest (TestCase.java:154) at junit.framework.TestCase.runBare (TestCase.java:127) at org.netbeans.jellytools.JellyTestCase.runBare (JellyTestCase.java:108) at junit.framework.TestResult$1.protect (TestResult.java:106) at junit.framework.TestResult.runProtected (TestResult.java:124) at junit.framework.TestResult.run (TestResult.java:109) at junit.framework.TestCase.run(TestCase.java:118) at org.netbeans.junit.NbTestCase.run (NbTestCase.java:85) at junit.framework.TestSuite.runTest (TestSuite.java:208) at junit.framework.TestSuite.run(TestSuite.java:203) at org.netbeans.xtest.testrunner.JUnitTestRunner.runTests (JUnitTestRunner.java:159) at org.netbeans.xtest.testrunner.JUnitTestRunnerExecutor.execut eInIDE(JUnitTestRunnerExecutor.java:100) at org.netbeans.xtest.testrunner.JUnitTestRunnerExecutor.execut eTestRun(JUnitTestRunnerExecutor.java:168) at org.netbeans.xtest.testrunner.JUnitTestRunnerExecutor.main (JUnitTestRunnerExecutor.java:219) 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:324) at org.openide.execution.ThreadExecutor.executeClass (ThreadExecutor.java:116) at org.openide.execution.ThreadExecutor$TERunnable.run (ThreadExecutor.java:183) at org.netbeans.core.execution.RunClassThread.run (RunClassThread.java:120) I've run tests from /cvs/web/test/JSPServletDebug directory Example of code you can find in /cvs/web/test/Common/src/org/netbeans/web/test/util/Utils .java (fillAddBreakpointMethod function) Reproduced with nightly build on Solaris 9.
Following code works for me: String workDir = "sampledir"; EditorOperator editor = Utils.openFile(workDir, "jsp3"); JSPNode jspNode = new JSPNode(workDir+"|jsp3"); jspNode.viewServlet(); EditorWindowOperator editorWindow = new EditorWindowOperator("Servlet for jsp3"); editor = editorWindow.selectPage("Servlet for jsp3"); editor.setCaretPositionToLine(56); (new AddBreakpointAction()).performMenu(); Utils.fillAddBreakpointException(null, "IndexOutOfBoundsException", 0); So far, I tested it on WinXP and Solaris8 (Gnome) in build 200307040100, JDK1.4.1_01. Could you send description of your environment and screen shot if available?
My configuration is: Solaris Sparc 9, jdk 1.4.1_02. , CDE I've create new test (in attachment), run it, and have NPE (1st my comment). Exception appear in method fillAddBreakpointException on line "exceptionField.typeText(exceptionName);" I've try another window manager but the result is the same.
Created attachment 10890 [details] TestFile
OK, I am able to reproduce and know why it happens. So what your test does is the following: - open New Breakpoint dialog - find Breakpoint Type combo box and call setSelectedItem("Exception") - find second JTextField in the dialog But JTextFiled found by jemmy is the one for Line Breakpoint Type because dialog was not refreshed in time. Then typing a text in non existing text field throws NPE. So, I strongly recommend to use selectItem() method instead of setSelectedItem(). It waits until item is really selected and it should satisfy that the dialog is already refreshed. I tested it and it worked for me well.
Closed.