Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » SWTBot » getting NoClassDefFound on resetWorkbench()
getting NoClassDefFound on resetWorkbench() [message #909063] Thu, 06 September 2012 09:19 Go to next message
Luiz E. is currently offline Luiz E.
Messages: 97
Registered: September 2010
Member
After I run my tests, I'm getting this:

java.lang.NoClassDefFoundError: org/hamcrest/Matchers
	at org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot.editors(SWTWorkbenchBot.java:222)
	at org.eclipse.swtbot.eclipse.finder.DefaultWorkbench.saveAllEditors(DefaultWorkbench.java:74)
	at org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot.saveAllEditors(SWTWorkbenchBot.java:368)
	at org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot.resetWorkbench(SWTWorkbenchBot.java:342)
	at br.com.germantech.tests.abstracts.GermantechTest.after(GermantechTest.java:24)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42)
	at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:36)
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
	at org.eclipse.swtbot.swt.finder.junit.SWTBotJunit4ClassRunner.run(SWTBotJunit4ClassRunner.java:54)
	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
	at org.eclipse.swtbot.eclipse.core.RemotePluginTestRunner.main(RemotePluginTestRunner.java:64)
	at org.eclipse.swtbot.eclipse.core.UITestApplication.runTests(UITestApplication.java:117)
	at org.eclipse.ui.internal.testing.WorkbenchTestable$1.run(WorkbenchTestable.java:71)
	at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ClassNotFoundException: org.hamcrest.Matchers
	at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:455)
	at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:421)
	at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:412)
	at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	... 32 more


this is my manifest file

Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Tests
Bundle-SymbolicName: br.com.germantech.tests
Bundle-Version: 1.3.7.RC
Bundle-Activator: br.com.germantech.Activator
Require-Bundle: org.eclipse.core.runtime,
 br.com.germantech.fiscal;bundle-version="1.3.6",
 org.hamcrest;bundle-version="1.1.0",
 org.hamcrest.core;bundle-version="1.1.0",
 org.hamcrest.integration;bundle-version="1.1.0",
 org.hamcrest.library;bundle-version="1.1.0",
 org.hamcrest.text;bundle-version="1.1.0",
 org.eclipse.swtbot.go;bundle-version="2.0.5"
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: JavaSE-1.6



and I'm seeing this exception in this method

	@After
	public void after() {
		System.err.println("Resetando Workbench");
		bot.resetWorkbench(); //This line
		System.err.println("Resetado");
	}


Am I missing something?
Re: getting NoClassDefFound on resetWorkbench() [message #911209 is a reply to message #909063] Tue, 11 September 2012 03:31 Go to previous messageGo to next message
Mickael Istria is currently offline Mickael Istria
Messages: 740
Registered: July 2009
Location: Grenoble, France
Senior Member
Not sure, but I think this could be because you bundle doesn't specify a
dependency on org.junit;bundle-version="4.8.0".
Although, I'm not a big fan of the org.eclipse.swtbot.go bundle since it
re-exports a lot of things "silently", so I'd remove it.

On 09/06/2012 03:19 PM, Luiz E. wrote:
> After I run my tests, I'm getting this:
>
>
> java.lang.NoClassDefFoundError: org/hamcrest/Matchers
> at
>
org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot.editors(SWTWorkbenchBot.java:222)
>
> at
>
org.eclipse.swtbot.eclipse.finder.DefaultWorkbench.saveAllEditors(DefaultWorkbench.java:74)
>
> at
>
org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot.saveAllEditors(SWTWorkbenchBot.java:368)
>
> at
>
org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot.resetWorkbench(SWTWorkbenchBot.java:342)
>
> at
>
br.com.germantech.tests.abstracts.GermantechTest.after(GermantechTest.java:24)
>
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
> at java.lang.reflect.Method.invoke(Unknown Source)
> at
>
org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45)
>
> at
>
org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
>
> at
>
org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42)
>
> at
>
org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:36)
> at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263)
> at
>
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68)
>
> at
>
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47)
>
> at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
> at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
> at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
> at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
> at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
> at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
> at
>
org.eclipse.swtbot.swt.finder.junit.SWTBotJunit4ClassRunner.run(SWTBotJunit4ClassRunner.java:54)
>
> at
>
org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
>
> at
>
org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
>
> at
>
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
>
> at
>
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
>
> at
>
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
>
> at
>
org.eclipse.swtbot.eclipse.core.RemotePluginTestRunner.main(RemotePluginTestRunner.java:64)
>
> at
>
org.eclipse.swtbot.eclipse.core.UITestApplication.runTests(UITestApplication.java:117)
>
> at
>
org.eclipse.ui.internal.testing.WorkbenchTestable$1.run(WorkbenchTestable.java:71)
>
> at java.lang.Thread.run(Unknown Source)
> Caused by: java.lang.ClassNotFoundException: org.hamcrest.Matchers
> at
>
org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:455)
>
> at
>
org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:421)
>
> at
>
org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:412)
>
> at
>
org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
>
> at java.lang.ClassLoader.loadClass(Unknown Source)
> ... 32 more
>
>
> this is my manifest file
>
>
> Manifest-Version: 1.0
> Bundle-ManifestVersion: 2
> Bundle-Name: Tests
> Bundle-SymbolicName: br.com.germantech.tests
> Bundle-Version: 1.3.7.RC
> Bundle-Activator: br.com.germantech.Activator
> Require-Bundle: org.eclipse.core.runtime,
> br.com.germantech.fiscal;bundle-version="1.3.6",
> org.hamcrest;bundle-version="1.1.0",
> org.hamcrest.core;bundle-version="1.1.0",
> org.hamcrest.integration;bundle-version="1.1.0",
> org.hamcrest.library;bundle-version="1.1.0",
> org.hamcrest.text;bundle-version="1.1.0",
> org.eclipse.swtbot.go;bundle-version="2.0.5"
> Bundle-ActivationPolicy: lazy
> Bundle-RequiredExecutionEnvironment: JavaSE-1.6
>
>
>
> and I'm seeing this exception in this method
>
>
> @After
> public void after() {
> System.err.println("Resetando Workbench");
> bot.resetWorkbench(); //This line
> System.err.println("Resetado");
> }
>
>
> Am I missing something?
>


--
Mickael Istria
JBoss, by Red Hat
My blog: http://mickaelistria.wordpress.com
My Tweets: http://twitter.com/mickaelistria
Re: getting NoClassDefFound on resetWorkbench() [message #911854 is a reply to message #911209] Wed, 12 September 2012 09:04 Go to previous message
Luiz E. is currently offline Luiz E.
Messages: 97
Registered: September 2010
Member
I removed swtbot.go but got the same exception
my bundle now
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Tests
Bundle-SymbolicName: br.com.germantech.tests
Bundle-Version: 1.3.11.RC
Bundle-Activator: br.com.germantech.Activator
Require-Bundle: org.eclipse.core.runtime,
 br.com.germantech.fiscal;bundle-version="1.3.6",
 org.hamcrest;bundle-version="1.1.0",
 org.hamcrest.core;bundle-version="1.1.0",
 org.hamcrest.integration;bundle-version="1.1.0",
 org.hamcrest.library;bundle-version="1.1.0",
 org.hamcrest.text;bundle-version="1.1.0",
 org.junit;bundle-version="4.10.0",
 org.eclipse.ui;bundle-version="3.8.0",
 org.eclipse.swtbot.eclipse.core;bundle-version="2.0.5",
 org.eclipse.swtbot.eclipse.finder;bundle-version="2.0.5",
 org.eclipse.swtbot.swt.finder;bundle-version="2.0.5",
 org.eclipse.swtbot.junit4_x;bundle-version="2.0.5"
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: JavaSE-1.6

[Updated on: Wed, 12 September 2012 09:04]

Report message to a moderator

Previous Topic:can't access menu item with icon
Next Topic:SWTBot testing controls which extend org.eclipse.ui.forms.MasterDetailsBlock
Goto Forum:
  


Current Time: Wed Aug 20 10:48:47 EDT 2014

Powered by FUDForum. Page generated in 0.01786 seconds