Package aQute.bnd.junit
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
FieldsModifier and TypeFieldDescriptionfinal JarDeprecated.final org.osgi.framework.BundleContextDeprecated.(package private) final ExecutorServiceDeprecated.final org.osgi.framework.launch.FrameworkDeprecated.(package private) static AtomicIntegerDeprecated.Deprecated.final FileDeprecated.(package private) final org.osgi.util.promise.PromiseFactoryDeprecated.final List<org.osgi.util.tracker.ServiceTracker<?,?>> Deprecated.Deprecated. -
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.private StringgetExtra()Deprecated.private org.osgi.framework.launch.FrameworkFactoryDeprecated.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
-
executor
Deprecated. -
promiseFactory
final org.osgi.util.promise.PromiseFactory promiseFactoryDeprecated. -
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. -
n
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
-
getExtra
Deprecated.- Throws:
Exception
-
close
Deprecated.Close this framework- Specified by:
closein interfaceAutoCloseable- Throws:
Exception
-
getBundleContext
public org.osgi.framework.BundleContext getBundleContext()Deprecated. -
getServices
Deprecated.- Throws:
org.osgi.framework.InvalidSyntaxException
-
getService
Deprecated.- Throws:
Exception
-
waitForService
public <T> org.osgi.util.promise.Promise<T> waitForService(Class<T> class1, long timeoutInMs) throws Exception Deprecated.- Throws:
Exception
-
bundle
Deprecated.- Throws:
IOException
-
addBundles
Deprecated.- Throws:
Exception
-
addBundles
Deprecated.- Throws:
Exception
-
getWorkspace
Deprecated.- Throws:
Exception
-
getProject
Deprecated.- Throws:
Exception
-
startAll
public void startAll(List<org.osgi.framework.Bundle> bundles) throws org.osgi.framework.BundleException Deprecated.- Throws:
org.osgi.framework.BundleException
-
addBundle
Deprecated.- Throws:
Exception
-
getFactory
Deprecated.- Throws:
Exception
-