Hi,
I am trying to get a basic unit test to run via the Junit launcher within Eclipse. I've created a fragment using PDE that attached to a host plugin under test. Basic test class:
I've added the following plugins to the list of "Automated Managemenf of Dependencies" inside the manifest:Code:public class LearningSwitchTest extends AbstractConfigurableBundleCreatorTests { public void testOsgiPlatformStarts() throws Exception { System.out.println(bundleContext .getProperty(Constants.FRAMEWORK_VENDOR)); System.out.println(bundleContext .getProperty(Constants.FRAMEWORK_VERSION)); System.out.println(bundleContext .getProperty(Constants.FRAMEWORK_EXECUTIONENVIRONMENT)); } }
org.springframework.osgi.test
org.springframework.test
libraries.org.junit
org.eclipse.osgi
org.springframework.beans
org.springframework.context
org.springframework.core
org.springframework.osgi.core
com.springsource.org.objectweb.asm
com.springsource.org.apache.commons.logging
When I launch the test I see the following on the console:
and in the junit UI I see the following exception:Code:Apr 15, 2010 11:54:50 PM org.springframework.osgi.test.AbstractOsgiTests logPlatformInfo INFO: Equinox OSGi Platform [3.5.2.R35x_v20100126] started Apr 15, 2010 11:54:50 PM org.springframework.osgi.test.provisioning.internal.LocalFileSystemMavenRepository init INFO: Local Maven2 repository used: [/home/test/.m2/repository] Apr 15, 2010 11:54:50 PM org.springframework.osgi.test.AbstractOsgiTests shutdownTest INFO: Shutting down OSGi platform
I don't understand why its searching for a jar inside my maven repository. The target I am building for in Eclipse references external P2 update sites and one local directory. Does this test framework have any capability of working with Eclipse .target files? What is the best way to proceed to get the test up and running?Code:java.io.FileNotFoundException: /home/test/.m2/repository/org/aopalliance/com.springsource.org.aopalliance/1.0.0/com.springsource.org.aopalliance-1.0.0.jar (No such file or directory) at java.io.FileInputStream.open(Native Method) at java.io.FileInputStream.<init>(FileInputStream.java:106) at org.springframework.core.io.FileSystemResource.getInputStream(FileSystemResource.java:108) at org.springframework.osgi.test.AbstractOsgiTests.installBundle(AbstractOsgiTests.java:323) at org.springframework.osgi.test.AbstractOsgiTests.startup(AbstractOsgiTests.java:253) at org.springframework.osgi.test.AbstractOsgiTests.prepareTestExecution(AbstractOsgiTests.java:374) at org.springframework.osgi.test.AbstractOsgiTests.runBare(AbstractOsgiTests.java:203) at org.springframework.osgi.test.AbstractOsgiTests$1.protect(AbstractOsgiTests.java:184) at junit.framework.TestResult.runProtected(TestResult.java:128) at org.springframework.osgi.test.AbstractOsgiTests.run(AbstractOsgiTests.java:181) at junit.framework.TestSuite.runTest(TestSuite.java:232) at junit.framework.TestSuite.run(TestSuite.java:227) at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130) 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)
Thanks,
David



