Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Virgo » Tests using Virgo Test Framework
Tests using Virgo Test Framework [message #646309] Thu, 23 December 2010 09:45 Go to next message
Lorie Pisicchio is currently offline Lorie PisicchioFriend
Messages: 44
Registered: October 2010
Member
Dear Virgo team,
I am trying to implement integration tests over the Virgo test framework.
Is start a very basic unit test :
import org.eclipse.virgo.test.framework.dmkernel.DmKernelTestRunner;
import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;

@RunWith(DmKernelTestRunner.class)
public class IntegrationTest {

	@Test
	public void RunFirstTest() {
		Assert.assertTrue(true);
	}
}

As simple as it is, I am not able to run this test. When starting, I get the following error :
java.lang.NoClassDefFoundError: org/osgi/framework/launch/Framework
	at java.lang.Class.getDeclaredMethods0(Native Method)
	at java.lang.Class.privateGetDeclaredMethods(Class.java:2427)
	at java.lang.Class.privateGetPublicMethods(Class.java:2547)
	at java.lang.Class.getMethods(Class.java:1410)
	at sun.misc.ProxyGenerator.generateClassFile(ProxyGenerator.java:409)
	at sun.misc.ProxyGenerator.generateProxyClass(ProxyGenerator.java:306)
	at java.lang.reflect.Proxy.getProxyClass(Proxy.java:501)
	at java.lang.reflect.Proxy.newProxyInstance(Proxy.java:581)
	at org.eclipse.virgo.test.framework.plugin.PluginManager.<init>(PluginManager.java:28)
	at org.eclipse.virgo.test.framework.OsgiTestRunner.<init>(OsgiTestRunner.java:42)
	at org.eclipse.virgo.test.framework.dmkernel.DmKernelTestRunner.<init>(DmKernelTestRunner.java:41)
	at org.eclipse.virgo.test.framework.dmkernel.DmKernelTestRunner.<init>(DmKernelTestRunner.java:37)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
	at org.junit.internal.builders.AnnotatedBuilder.buildRunner(AnnotatedBuilder.java:31)
	at org.junit.internal.builders.AnnotatedBuilder.runnerForClass(AnnotatedBuilder.java:24)
	at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:57)
	at org.junit.internal.builders.AllDefaultPossibilitiesBuilder.runnerForClass(AllDefaultPossibilitiesBuilder.java:29)
	at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:57)
	at org.junit.internal.requests.ClassRequest.getRunner(ClassRequest.java:24)
	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.<init>(JUnit4TestReference.java:32)
	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestClassReference.<init>(JUnit4TestClassReference.java:25)
	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.createTest(JUnit4TestLoader.java:41)
	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.loadTests(JUnit4TestLoader.java:31)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:452)
	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.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
Caused by: java.lang.ClassNotFoundException: org.osgi.framework.launch.Framework
	at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
	... 30 more


I tried to look around for the bundle exporting the class org.osgi.framework.launch.Framework, but didn't found it. Maybe this is where the error come from...

Any help would be appreciated.

Regards.
Re: Tests using Virgo Test Framework [message #646314 is a reply to message #646309] Thu, 23 December 2010 10:03 Go to previous messageGo to next message
Lorie Pisicchio is currently offline Lorie PisicchioFriend
Messages: 44
Registered: October 2010
Member
I added org.eclipse.osgi to my POM dependencies.
The error now is a bit different :
java.lang.IllegalStateException: User region's bundle context was not available from the service registry within 60 seconds.
	at org.eclipse.virgo.test.framework.dmkernel.DmKernelTestRunner.getTargetBundleContext(DmKernelTestRunner.java:60)
	at org.eclipse.virgo.test.framework.OsgiTestRunner.run(OsgiTestRunner.java:69)
	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:49)
	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.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
Re: Tests using Virgo Test Framework [message #646318 is a reply to message #646314] Thu, 23 December 2010 10:28 Go to previous messageGo to next message
Lorie Pisicchio is currently offline Lorie PisicchioFriend
Messages: 44
Registered: October 2010
Member
Sorry for the spaming.. As usual, as soon as you post a question, you get a bit of answer by yourself.
I have solved my problem by fixing my test.config.properties file in resources/META-INF folder.... (the launcher.bundles property was set with non accessible paths)..
Re: Tests using Virgo Test Framework [message #651348 is a reply to message #646318] Sat, 29 January 2011 17:50 Go to previous messageGo to next message
Wesley is currently offline WesleyFriend
Messages: 13
Registered: July 2010
Junior Member
Lorie,

Could you please share the tests that you've developed with virgo test framework?
Re: Tests using Virgo Test Framework [message #651551 is a reply to message #651348] Mon, 31 January 2011 15:53 Go to previous messageGo to next message
Lorie Pisicchio is currently offline Lorie PisicchioFriend
Messages: 44
Registered: October 2010
Member
Sorry Wesley, but I don't have much to share. I didn't get very far with the test framework (no much farer than launching a test method...).
Re: Tests using Virgo Test Framework [message #651554 is a reply to message #646309] Mon, 31 January 2011 16:08 Go to previous messageGo to next message
Dmitry is currently offline DmitryFriend
Messages: 4
Registered: January 2011
Junior Member
I would appreciate if you share even this as I can't succeed with this.
Re: Tests using Virgo Test Framework [message #654872 is a reply to message #651554] Thu, 17 February 2011 13:38 Go to previous message
Lorie Pisicchio is currently offline Lorie PisicchioFriend
Messages: 44
Registered: October 2010
Member
Sorry for the (very) late answer. Did you get farer with the test framework?
Basically, all my code is already in the post.. What exactly is the problem running your tests?
Previous Topic:[FYI] log4j-1.2.16 has a duplicate import-package entries
Next Topic:Virgo as NT Service or Unix deamon using Java Service Wrapper
Goto Forum:
  


Current Time: Thu Dec 26 11:28:24 GMT 2024

Powered by FUDForum. Page generated in 0.03726 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top