Skip to content

Commit

Permalink
Use native container. Status: all asserts produce obscure stack traces.
Browse files Browse the repository at this point in the history
  • Loading branch information
glyn committed Dec 7, 2011
1 parent 489136c commit d546aaa
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 10 deletions.
7 changes: 4 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ repositories {
dependencies {
testCompile "junit:junit:4.+",
"org.ops4j.pax.exam:pax-exam-junit4:2.2.+",
"org.ops4j.pax.exam:pax-exam-link-mvn:2.2.+",
"org.ops4j.pax.exam:pax-exam-container-paxrunner:2.2.+"
"org.eclipse.osgi:org.eclipse.osgi:3.6.0.v20100517"

testRuntime "org.ops4j.pax.runner:pax-runner-no-jcl:1.7.5+"
testRuntime "org.ops4j.pax.runner:pax-runner-no-jcl:1.7.5+",
"org.ops4j.pax.exam:pax-exam-container-native:2.2.+",
"org.ops4j.pax.exam:pax-exam-link-mvn:2.2.+"
}
Original file line number Diff line number Diff line change
@@ -1,28 +1,39 @@

package org.springframework.testspringbundleresolution;

import static org.ops4j.pax.exam.CoreOptions.equinox;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import static org.ops4j.pax.exam.CoreOptions.mavenBundle;
import static org.ops4j.pax.exam.OptionUtils.combine;
import static org.ops4j.pax.exam.CoreOptions.options;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.ops4j.pax.exam.Option;
import org.ops4j.pax.exam.junit.Configuration;
import org.ops4j.pax.exam.junit.JUnit4TestRunner;

//import static org.ops4j.pax.exam.container.def.PaxRunnerOptions.scanFeatures;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;

@RunWith(JUnit4TestRunner.class)
public class TestSpringBundleResolution {

@Configuration
public static Option[] configuration() throws Exception {
return combine(null, mavenBundle("org.springframework", "spring-core", "3.0.6.RELEASE"), equinox().version("3.7.0"));
return options(mavenBundle("org.springframework", "spring-core", "3.0.6.RELEASE"));
}

@Test
public void test() throws Exception {
System.out.println("Hello from a testcase!");
public void test(BundleContext bundleContext) throws Exception {
boolean found = false;
Bundle[] bundles = bundleContext.getBundles();
for (Bundle bundle : bundles) {
if ("org.springframework.core".equals(bundle.getSymbolicName())) {
found = true;
bundle.start();
assertTrue(true); // This fails the test with an obscure stack trace.
// assertEquals(Bundle.ACTIVE, bundle.getState());
}
}
// assertTrue(found);
}
}

0 comments on commit d546aaa

Please sign in to comment.