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.
See code below: EditorOperator e = new EditorOperator("Source Editor [" + ejbName + "Bean" + " *] "); Originally I had expected to be able to use just EditorOperator(ejbName + "Bean"), but from the trace I saw it was not looking for the right thing so I put the extra text in. I was not using EditorWindowOperator, but will use that as a workaround. Using jemmy 2.0.4, trace is: Trace: Start to wait action "Wait TopComponent with name=Source Editor [SteveBMPBean *] index=0 loaded" Error: "Wait TopComponent with name=Source Editor [SteveBMPBean *] index=0 loaded" action has not been produced in 10016 milliseconds null org.netbeans.jemmy.TimeoutExpiredException: Wait TopComponent with name=Source Editor [SteveBMPBean *] index=0 loaded at org.netbeans.jemmy.Waiter.waitAction(Unknown Source) at org.netbeans.jellytools.TopComponentOperator.waitTopComponent(Unknown Source) at org.netbeans.jellytools.TopComponentOperator.<init>(Unknown Source) at org.netbeans.jellytools.TopComponentOperator.<init>(Unknown Source) at org.netbeans.jellytools.EditorOperator.<init>(Unknown Source) at j2ee.EndToEnd.run(EndToEnd.java:60) at j2ee.EndToEnd.main(EndToEnd.java:171) 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:132) at org.openide.execution.ThreadExecutor$TERunnable.run(ThreadExecutor.java:209) at org.netbeans.core.execution.RunClassThread.run(RunClassThread.java:119) JDK 1.4
TopComponentOperator(String) constructor looks for a TopComponent which is visible, and has a name comparable with the parameter by default StringComparator. In your case, editor component (one you are looking for) lays on a tab which is not currently active, so it is _not_ visible. I.e. you have to switch tabs before this constructor using. Such EditorOperator(String) constructor could be used if editor component is docked in a different frame than Source Editor. All this mentioned clearly in Jelly2 javadoc.
Hi Shura, The pane WAS active and had the keyboard focus until the test infrastructure took it away...
To explain a little better. The immediately preceding step in the test case is to open the java source file that was not previously opened. The file opened has the keyboard focus and its tab is selected. In this case we are opening an ejb method so the cursor is positioned on the first source line of code for the method within the java file. Hope this helps.
More information. I'm testing by executing within the IDE. The source editor window is already open with a few "panes" before opening the java source file in the test case steps. Hope this helps you to reproduce it.
I don't know then. I tried the very same thing - it works perfect for me. I'm affraid we need more information on this one. Could you send the whole test class code? I mean, we do not exactly know how you build your test: what do you extends and so on. Same goes for 27525.
Steve, do your comments really fit into this issue? new EditorOperator("Source Editor [whatever]"); is definitely wrong usage. As javadoc says "Waits for fist visible TopComponent within whle IDE". It means you can use it only if editor pane is visible. And its name is only filename: new EditorOperator("whatever"); But I would recommend to use sequence: EditorWindowOperator ewo = new EditorWindowOperator ("whatever"); EditorOperator eo = ewo.getEditor("whatever"); Please, give us a test case which doesn't work for you and environment description. I think it works, so I would close this bug as invalid if you agree.
Hi Jiri, Thanks for your patience. Is: new EditorOperator(String) just for use with SDI? If yes, then I would suggest we change this to a docs bug and add a note all those constructors that are SDI only. If this is the case, my suggestion is to globally change: "Waits for first visible TopComponent with given name in whole IDE. " to "Waits for first visible TopComponent with given name in whole IDE when it is in SDI mode." I was a bit confused by the new programming model but hopefully I am getting closer now. For your humor, below the test case code I wrote based on my earlier understanding: start("Add code to the business method"); b.open(); EditorWindowOperator ewo = new EditorWindowOperator(); EditorOperator e = ewo.getEditor(ejbName + "Bean"); // wait for the window e = new EditorOperator(ejbName + "Bean"); // we waited but still doesn't work
Oops I mean of course MDI above (instead of SDI)
new EditorOperator(String) can be used both in SDI and MDI. Test case: // open file ejbName + "Bean" EditorWindowOperator ewo = new EditorWindowOperator(); EditorOperator e = ewo.getEditor(ejbName + "Bean"); should work. If not, please attach whole class with reproducible test case and description of environment.
Hi Shura, for this one use the test case for bug 27524. Try it on NT with a previous file already open in the editor. Hope this helps. I'm OOTO Friday, Monday. Back Tues, Steve As needed we can look at Tuesday in my office
I made some changes to TopComponentOperator and related operators to unify behaviour. Currently all TopComponent can be searched through all active workspace (even when in inactive tab) in both SDI and MDI mode. But correct usage is EditorOperator(ejbName+"Bean"); TopComponent does not contain texts like "Source Editor [...*]" and thus it could not match.