License related exception when playing back simple test

WindowTester allows you to easily create and run unit tests for every GUI they build. It can also be used to generate system level tests.

Moderators: gnebling, Eric Clayberg, Dan Rubel, keertip, Phil Quitslund

License related exception when playing back simple test

Postby brs » Mon Mar 19, 2007 8:20 am

Hello.

I have recorded a little test against a simple Eclipse plugin. When I try to play it back, I get an exception which is apparently license related (stack trace follows). I currently have an evaluation license, which is still valid, and which I have specified via the Window Tester license preference page.

java.lang.IllegalStateException: This installation of WindowTester is not properly licensed.
Please Make Sure Your Product is Activated (use the "Registration and Activation" button in the WindowTester Preferences).
at com.windowtester.runtime.swt.internal.UIContextSWT.handleConditions(UIContextSWT.java:572)
at com.windowtester.runtime.swt.internal.UIContextSWT.click(UIContextSWT.java:209)
at yat.TC2.testMain(TC2.java:21)
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 junit.framework.TestCase.runTest(TestCase.java:154)
at junit.framework.TestCase.runBare(TestCase.java:127)
at junit.extensions.UITestCaseCommon.access$1(UITestCaseCommon.java:1)
at junit.extensions.UITestCaseCommon$1.run(UITestCaseCommon.java:136)
at junit.extensions.core.SequenceRunner$1.run(SequenceRunner.java:69)

What is the problem?

Thanks,
B.
brs
 
Posts: 26
Joined: Sun Mar 11, 2007 6:05 am
Location: Chichester, UK

Postby gnebling » Mon Mar 19, 2007 8:24 am

Make sure you're running your test as JUnit Plug-in Test and not Junit Test.
gnebling
Moderator
 
Posts: 243
Joined: Tue Aug 22, 2006 7:49 am

Postby brs » Mon Mar 19, 2007 8:36 am

Hi Gina.

Thanks for your reply. Perhaps it was a typo, but your help page that describes how to play back states the exact opposite!...

Thanks and regards,
B.
brs
 
Posts: 26
Joined: Sun Mar 11, 2007 6:05 am
Location: Chichester, UK

Postby gnebling » Mon Mar 19, 2007 8:43 am

Can you point me where that is?

If you're following the SWT example and you have a SWT standalone application, then you should run as JUnit test. If you're testing an Eclipse plug-in, then you should run your test as Plug-in test.

Thanks!
gnebling
Moderator
 
Posts: 243
Joined: Tue Aug 22, 2006 7:49 am

Postby brs » Mon Mar 19, 2007 9:21 am

Thanks for the clarification, I was mistaken. I was following the SWT example, but testing an Eclipse plug-in. It would probably be useful to explain that in the manual though.

Thanks again,
B.
brs
 
Posts: 26
Joined: Sun Mar 11, 2007 6:05 am
Location: Chichester, UK

Postby gnebling » Mon Mar 19, 2007 9:42 am

There's already a note that says:
Note: For SWT applications, run tests as JUnit Test and not as JUnit Plug-in test.

We're always looking for ways to make our docs clear. Can you give us suggestions where else should it be made clearer?

Thanks
gnebling
Moderator
 
Posts: 243
Joined: Tue Aug 22, 2006 7:49 am

Postby brs » Mon Mar 19, 2007 9:48 am

Hi again.

The original exception has now disappeared, but I get a "Class not found" error from Window Tester, followed by a ClassNotFoundException for my test class (see stack trace below) and cannot figure out why. In the "Test" tab of the Junit Plugin Test configuration dialog I specify test project and location of the java test class (yat.TC2). If I click on the "Search" button besides the class field, TC2 is definitely found.

What do you think is wrong this time? Do you perhaps happen to have an example similar to your SWT application test in the manual, but for an Eclipse plugin?

Class not found yat.TC2
java.lang.ClassNotFoundException: yat.TC2
at org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader.java:402)
at org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader.java:347)
at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:83)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at org.eclipse.osgi.framework.internal.core.BundleLoader.loadClass(BundleLoader.java:278)
at org.eclipse.osgi.framework.internal.core.BundleHost.loadClass(BundleHost.java:227)
at org.eclipse.osgi.framework.internal.core.AbstractBundle.loadClass(AbstractBundle.java:1245)
at org.eclipse.pde.internal.junit.runtime.RemotePluginTestRunner$BundleClassLoader.findClass(RemotePluginTestRunner.java:36)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.loadClass(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.loadClasses(RemoteTestRunner.java:425)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:445)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
at org.eclipse.pde.internal.junit.runtime.RemotePluginTestRunner.main(RemotePluginTestRunner.java:58)
at org.eclipse.pde.internal.junit.runtime.UITestApplication$1.run(UITestApplication.java:105)
at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:123)
at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3325)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2971)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1914)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1878)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:419)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:95)
at org.eclipse.pde.internal.junit.runtime.UITestApplication.run(UITestApplication.java:45)
at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:78)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:92)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:68)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:400)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:177)
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:336)
at org.eclipse.core.launcher.Main.basicRun(Main.java:280)
at org.eclipse.core.launcher.Main.run(Main.java:977)
at org.eclipse.core.launcher.Main.main(Main.java:952)
brs
 
Posts: 26
Joined: Sun Mar 11, 2007 6:05 am
Location: Chichester, UK

Postby gnebling » Mon Mar 19, 2007 10:36 am

It is very similar with this tutorial:
Generating a Sample Test for RCP application

The difference is in your test launch configuration's Main tab. Specify the Eclipse workbench or ide as the Program to Run.[/url]

If you're still having problems, we'll need a test project so we can try and reproduce the problem.
gnebling
Moderator
 
Posts: 243
Joined: Tue Aug 22, 2006 7:49 am

Postby brs » Mon Mar 19, 2007 3:31 pm

Thanks for the pointer to the documentation, but it still is not working for me.

I have posted a message with an example to your support email address.

I am looking forward to hearing what the solution is.

Thanks,
B.
brs
 
Posts: 26
Joined: Sun Mar 11, 2007 6:05 am
Location: Chichester, UK


Return to Window Tester

Who is online

Users browsing this forum: No registered users and 1 guest