Java Reference
In-Depth Information
[junit] Pax Exam 1.1.0 from OPS4J - http://www.ops4j.org
[junit] ------------------------------------------------
[junit]
[junit]
[junit]
[junit] Welcome to Felix
[junit]
[junit] ================
[junit]
[junit] org.osgi.framework.vendor = Apache Software Foundation
[junit] org.osgi.framework.version = 1.5
[junit] org.osgi.framework.language = en
[junit] org.osgi.framework.os.name = windowsvista
[junit] org.osgi.framework.os.version = 6.0
[junit] org.osgi.framework.processor = x86
[junit]
[junit] Test Bundle is pax-exam-probe
[junit]
[junit]
[junit] Tests run: 1, Failures: 0, Errors: 0, Time elapsed: 3.424 sec
You may have noticed that the symbolic name of the test bundle is pax-exam-probe . This
bundle is generated at execution time by Pax Exam and contains your test classes. The
default container is Apache Felix, but you can easily ask Pax Exam to run the same test
on other frameworks as well. All you need to do is add a few lines to the configuration
method in your test class fw/container/src/org/foo/test/ContainerTest.java:
@Configuration
public static Option[] configure() {
return options(
frameworks(
felix(), equinox(), knopflerfish()
),
mavenBundle("org.osgi", "org.osgi.compendium", "4.2.0")
);
}
Pax Exam does the hard work of downloading the necessary JAR files and setting up any
framework-specific configuration files. You just need to sit back and rerun your test:
$ ant test.container
This time you should see three distinct sets of output, as shown here.
Listing 7.4 Using Pax Exam to run tests on multiple frameworks
[junit] Running org.foo.test.ContainerTest
[junit] __________ ___________
[junit] \______ \_____ ___ ___ \_ _____/__ ________ _____
[junit] | ___/\__ \ \ \/ / | __)_\ \/ /\__ \ / \
[junit] | | / __ \_> < | \> < / __ \| Y Y \
[junit] |____| (____ /__/\_ \ /_______ /__/\_ \(____ /__|_| /
[junit] \/ \/ \/ \/ \/ \/
[junit]
[junit] Pax Exam 1.1.0 from OPS4J - http://www.ops4j.org
 
Search WWH ::




Custom Search