Class JUnitFramework
java.lang.Object
aQute.bnd.junit.JUnitFramework
- All Implemented Interfaces:
AutoCloseable
Deprecated.
This class provides an OSGi framework that is configured with the current bnd
workspace. A project directory is used to find the workspace. This makes all
repositories in the workspace available to the framework. To be able to test
JUnit code against/in this framework it is necessary that all packages on the
buildpath and testpath are actually exported in the framework. This class
will ensure that. Once the framework is up and running it will be possible to
add bundles to it. There are a number of ways that this can be achieved:
- Build a bundle – A bnd
Builderis provided to create a bundle and install it. This makes it possible to add classes from the src or test directories or resources. Seebundle(). - Add a bundle using a bnd spec – Using the bnd specs (e.g.
'org.apache.felix.configadmin;version=3'). See
addBundle(String)et. al. - Add a bndrun file – A file bndrun file can be added. All properties in
this file that can be applied after a framework is started will be applied.
See
addBundles(File)et. al.
getService(Class)
et. al. Notice that this framework starts in the same process as that the
JUnit code runs. This is normally a separately started VM.-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionDeprecated.Start a framework assuming the current working directory is the project directory.JUnitFramework(File projectDir) Deprecated.Start a framework while providing a project directory. -
Method Summary
Modifier and TypeMethodDescriptionList<org.osgi.framework.Bundle> Deprecated.voidaddBundles(File bndrun) Deprecated.voidaddBundles(String bndrun) Deprecated.bundle()Deprecated.voidclose()Deprecated.Close this frameworkorg.osgi.framework.BundleContextDeprecated.Deprecated.<T> TgetService(Class<T> class1) Deprecated.<T> List<T> getServices(Class<T> class1) Deprecated.Deprecated.voidDeprecated.<T> org.osgi.util.promise.Promise<T> waitForService(Class<T> class1, long timeoutInMs) Deprecated.
-
Field Details
-
trackers
Deprecated. -
bin_test
Deprecated. -
framework
public final org.osgi.framework.launch.Framework frameworkDeprecated. -
context
public final org.osgi.framework.BundleContext contextDeprecated. -
projectDir
Deprecated. -
workspace
Deprecated. -
project
Deprecated.
-
-
Constructor Details
-
JUnitFramework
public JUnitFramework()Deprecated.Start a framework assuming the current working directory is the project directory. -
JUnitFramework
Deprecated.Start a framework while providing a project directory.- Parameters:
projectDir-
-
-
Method Details
-
close
-
getBundleContext
public org.osgi.framework.BundleContext getBundleContext()Deprecated. -
getServices
-
getService
-
waitForService
-
bundle
-
addBundles
-
addBundles
-
getWorkspace
-
getProject
-
startAll
public void startAll(List<org.osgi.framework.Bundle> bundles) throws org.osgi.framework.BundleException Deprecated.- Throws:
org.osgi.framework.BundleException
-
addBundle
-