public class JUnitFramework extends Object implements AutoCloseable
Builder is provided to create a bundle and
install it. This makes it possible to add classes from the src or test
directories or resources. See bundle().
addBundle(String) et.
al.
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.| Modifier and Type | Class and Description |
|---|---|
class |
JUnitFramework.BundleBuilder |
| Modifier and Type | Field and Description |
|---|---|
Jar |
bin_test |
org.osgi.framework.BundleContext |
context |
org.osgi.framework.launch.Framework |
framework |
Project |
project |
File |
projectDir |
List<org.osgi.util.tracker.ServiceTracker<?,?>> |
trackers |
Workspace |
workspace |
| Constructor and Description |
|---|
JUnitFramework()
Start a framework assuming the current working directory is the project
directory.
|
JUnitFramework(File projectDir)
Start a framework while providing a project directory.
|
| Modifier and Type | Method and Description |
|---|---|
List<org.osgi.framework.Bundle> |
addBundle(String spec) |
void |
addBundles(File bndrun) |
void |
addBundles(String bndrun) |
JUnitFramework.BundleBuilder |
bundle() |
void |
close()
Close this framework
|
org.osgi.framework.BundleContext |
getBundleContext() |
Project |
getProject() |
<T> T |
getService(Class<T> class1) |
<T> List<T> |
getServices(Class<T> class1) |
Workspace |
getWorkspace() |
void |
startAll(List<org.osgi.framework.Bundle> bundles) |
<T> org.osgi.util.promise.Promise<T> |
waitForService(Class<T> class1,
long timeoutInMs) |
public final List<org.osgi.util.tracker.ServiceTracker<?,?>> trackers
public final Jar bin_test
public final org.osgi.framework.launch.Framework framework
public final org.osgi.framework.BundleContext context
public final File projectDir
public Workspace workspace
public Project project
public JUnitFramework()
public JUnitFramework(File projectDir)
projectDir - public void close()
throws Exception
close in interface AutoCloseableExceptionpublic org.osgi.framework.BundleContext getBundleContext()
public <T> List<T> getServices(Class<T> class1) throws org.osgi.framework.InvalidSyntaxException
org.osgi.framework.InvalidSyntaxExceptionpublic <T> org.osgi.util.promise.Promise<T> waitForService(Class<T> class1, long timeoutInMs) throws Exception
Exceptionpublic JUnitFramework.BundleBuilder bundle() throws IOException
IOExceptionpublic void startAll(List<org.osgi.framework.Bundle> bundles) throws org.osgi.framework.BundleException
org.osgi.framework.BundleExceptionCopyright © 2019 aQute SARL. All rights reserved.