Probs with eclipse 3.1 and testng 2.5.5.1 (eclipse throws exception..)

4 views
Skip to first unread message

Danny

unread,
Sep 20, 2005, 2:51:43 PM9/20/05
to testng...@googlegroups.com
Hi,

i try to "run as" a testcase with testng - nothing happens, but
i got the following entries in the eclipse-logfile. Could
somebody help me to track down the prob ?

regards

Danny


!ENTRY org.eclipse.ui 4 4 2005-09-20 18:28:58.879
!MESSAGE Unhandled event loop exception

!ENTRY org.eclipse.ui 4 0 2005-09-20 18:28:58.879
!MESSAGE java.util.NoSuchElementException
!STACK 0
java.util.NoSuchElementException
at java.util.HashMap$HashIterator.nextEntry(HashMap.java:790)
at java.util.HashMap$KeyIterator.next(HashMap.java:823)
at org.testng.eclipse.launch.components.BaseVisitor.getAnnotationType(BaseVisitor.java:44)
at org.testng.eclipse.launch.TestNGLaunchShortcut.run(TestNGLaunchShortcut.java:78)
at org.testng.eclipse.launch.TestNGLaunchShortcut.launch(TestNGLaunchShortcut.java:32)
at org.eclipse.debug.internal.ui.launchConfigurations.LaunchShortcutExtension.launch(LaunchShortcutExtension.java:372)
at org.eclipse.debug.internal.ui.actions.LaunchShortcutAction.run(LaunchShortcutAction.java:62)
at org.eclipse.jface.action.Action.runWithEvent(Action.java:996)
at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:538)
at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:488)
at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:400)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:843)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3080)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2713)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1699)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1663)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:367)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:143)
at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:103)
at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:226)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:376)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:163)
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:585)
at org.eclipse.core.launcher.Main.invokeFramework(Main.java:334)
at org.eclipse.core.launcher.Main.basicRun(Main.java:278)
at org.eclipse.core.launcher.Main.run(Main.java:973)
at org.eclipse.core.launcher.Main.main(Main.java:948)

---------------------------------------------------------------------
Posted via Jive Forums
http://forums.opensymphony.com/thread.jspa?threadID=6930&messageID=15389#15389

Cedric Beust

unread,
Sep 20, 2005, 3:33:35 PM9/20/05
to testng...@googlegroups.com
Definitely a bug.  Can you email us the file you were trying to run when this happened?  (my guess is that this file doesn't contain any tests)

--
Cedric


On 9/20/05, Danny <testng...@opensymphony.com> wrote:

Hi,

i try to "run as" a testcase with testng - nothing happens, but
i got the following entries in the eclipse-logfile. Could
somebody help me to track down the prob ?

regards

Danny


!ENTRY org.eclipse.ui 4 4 2005-09-20 18:28:58.879
!MESSAGE Unhandled event loop exception

!ENTRY org.eclipse.ui 4 0 2005-09-20 18:28:58.879
!MESSAGE java.util.NoSuchElementException
!STACK 0
java.util.NoSuchElementException
        at java.util.HashMap$HashIterator.nextEntry(HashMap.java:790)
        at java.util.HashMap$KeyIterator.next(HashMap.java:823)
        at org.testng.eclipse.launch.components.BaseVisitor.getAnnotationType (BaseVisitor.java:44)

        at org.testng.eclipse.launch.TestNGLaunchShortcut.run(TestNGLaunchShortcut.java:78)
        at org.testng.eclipse.launch.TestNGLaunchShortcut.launch(TestNGLaunchShortcut.java:32)
        at org.eclipse.debug.internal.ui.launchConfigurations.LaunchShortcutExtension.launch(LaunchShortcutExtension.java:372)
        at org.eclipse.debug.internal.ui.actions.LaunchShortcutAction.run(LaunchShortcutAction.java:62)
        at org.eclipse.jface.action.Action.runWithEvent(Action.java:996)
        at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:538)
        at org.eclipse.jface.action.ActionContributionItem.access$2 (ActionContributionItem.java:488)

        at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:400)
        at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
        at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:843)
        at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3080)
        at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :2713)
        at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1699)
        at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1663)
        at org.eclipse.ui.internal.Workbench.createAndRunWorkbench (Workbench.java:367)

        at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:143)
        at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:103)
        at org.eclipse.core.internal.runtime.PlatformActivator$1.run (PlatformActivator.java:226)

        at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:376)
        at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:163)
        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:585)
        at org.eclipse.core.launcher.Main.invokeFramework(Main.java:334)
        at org.eclipse.core.launcher.Main.basicRun(Main.java:278)
        at org.eclipse.core.launcher.Main.run(Main.java:973)
        at org.eclipse.core.launcher.Main.main(Main.java:948)

---------------------------------------------------------------------
Posted via Jive Forums
http://forums.opensymphony.com/thread.jspa?threadID=6930&messageID=15389#15389




--
Cedric

Alexandru Popescu

unread,
Sep 20, 2005, 4:48:37 PM9/20/05
to testng...@googlegroups.com
#: Danny changed the world a bit at a time by saying on 9/20/2005 8:51 PM :#
> Hi,
>
> i try to "run as" a testcase with testng - nothing happens, but
> i got the following entries in the eclipse-logfile. Could
> somebody help me to track down the prob ?
>
> regards
>
> Danny
>
>

Hi Danny!

Can you post please the source that is leading to this exception? It would help me track down the
problem. Thanks a lot.

./alex
--
.the_mindstorm.

Alexandru Popescu

unread,
Sep 20, 2005, 4:54:25 PM9/20/05
to testng...@googlegroups.com
#: Alexandru Popescu changed the world a bit at a time by saying on 9/20/2005 10:48 PM :#
> #: Danny changed the world a bit at a time by saying on 9/20/2005 8:51 PM :#
>> Hi,
>>
>> i try to "run as" a testcase with testng - nothing happens, but
>> i got the following entries in the eclipse-logfile. Could
>> somebody help me to track down the prob ?
>>
>> regards
>>
>> Danny
>>
>>
>
> Hi Danny!
>
> Can you post please the source that is leading to this exception? It would help me track down the
> problem. Thanks a lot.
>
> ./alex
> --
> .the_mindstorm.
>

Seems like I was getting too late the message and Cedric was first on it.

Danny

unread,
Sep 20, 2005, 5:11:10 PM9/20/05
to testng...@googlegroups.com
Hi Cedric,

your are right - it's only junit-code without adaption to testng (i would like to
do this - but than the exception happens ;-)
Now, i converted my projekt to JDK1.5, include your Libary in the path, add
a "@Test()" before the test and ... it works (-:

Thanks for your hint.

regards

Danny

P.S.: The "old" code

package de.dtnet.swd.guestos;

import com.ibm.staf.STAFException;
import com.ibm.staf.STAFHandle;
import com.ibm.staf.STAFResult;
//import com.ibm.staf.*;

import junit.framework.TestCase;

public class StafTest1 extends TestCase {
private STAFHandle handle = null;

public void testPing() {
try {
// Ping
String result1 = handle.submit("LOCAL", "PING", "PING");
System.out.println("PING Result: " + result1);

} catch (STAFException e) {
System.out.println("Error submitting request to STAF, RC: " + e.rc);
System.out.println(e.getMessage());

} finally {
try {
handle.unRegister();
} catch (STAFException e) {
e.printStackTrace();
}
}

}
}

---------------------------------------------------------------------
Posted via Jive Forums
http://forums.opensymphony.com/thread.jspa?threadID=6930&messageID=15396#15396

Alexandru Popescu

unread,
Sep 20, 2005, 6:15:35 PM9/20/05
to testng...@googlegroups.com
#: Danny changed the world a bit at a time by saying on 9/20/2005 11:11 PM :#
> Hi Cedric,
>
> your are right - it's only junit-code without adaption to testng (i would like to
> do this - but than the exception happens ;-)
> Now, i converted my projekt to JDK1.5, include your Libary in the path, add
> a "@Test()" before the test and ... it works (-:
>
> Thanks for your hint.
>
> regards
>
> Danny
>

What do you consider would be the benefit of using Run test as TestNG on a pure JUnit test?

./alex
--
.the_mindstorm.

PS: however I don't think the option should appear. But I would like to suggest you the following
quick test (in order to have a confirmation about it):

1/ have a normal class
2/ right click -> Run as => see if Run as TestNG test is displayed
3/ navigate away from that source
4/ return to the source and try again right click -> Run as => this time Run as TestNG test is not
display.
Reply all
Reply to author
Forward
0 new messages