public abstract class OSGiFrameworkTest extends OSGiTest implements ServiceListener, SynchronousBundleListener, FrameworkListener
| Constructor and Description |
|---|
OSGiFrameworkTest() |
| Modifier and Type | Method and Description |
|---|---|
static void |
afterClass() |
protected void |
assertAllReferences(BundleContext bundleContext,
String clazz,
ServiceReference... expected) |
protected void |
assertAllReferences(BundleContext bundleContext,
String clazz,
String filter,
ServiceReference... expected) |
protected void |
assertBundleEvent(int type,
Bundle bundle) |
protected void |
assertFrameworkEvent(int type,
Bundle bundle,
Class<? extends Throwable> expectedThrowable) |
protected void |
assertGetReference(BundleContext bundleContext,
String clazz,
ServiceReference expected) |
protected <T> T |
assertInstanceOf(Object o,
Class<T> expectedType) |
protected <T> T |
assertInstanceOf(Object o,
Class<T> expectedType,
boolean allowNull) |
protected void |
assertNoAllReferences(BundleContext bundleContext,
String clazz) |
protected void |
assertNoAllReferences(BundleContext bundleContext,
String clazz,
String filter) |
protected void |
assertNoBundleEvent() |
protected void |
assertNoFrameworkEvent() |
protected void |
assertNoGetReference(BundleContext bundleContext,
String clazz) |
protected void |
assertNoReferences(BundleContext bundleContext,
String clazz) |
protected void |
assertNoReferences(BundleContext bundleContext,
String clazz,
String filter) |
protected void |
assertNoServiceEvent() |
protected void |
assertReferences(BundleContext bundleContext,
String clazz,
ServiceReference... expected) |
protected void |
assertReferences(BundleContext bundleContext,
String clazz,
String filter,
ServiceReference... expected) |
protected void |
assertServiceEvent(int type,
ServiceReference reference) |
protected void |
assertUsingBundles(ServiceReference reference,
Bundle... bundles) |
void |
bundleChanged(BundleEvent event) |
static Framework |
createFramework() |
void |
frameworkEvent(FrameworkEvent event) |
static Framework |
getFramework() |
protected ServiceReference |
getServiceReference(String clazz,
long timeout)
Get a ServiceReference within the given timeout.
|
static BundleContext |
getSystemContext() |
protected Bundle |
installBundle(org.jboss.shrinkwrap.api.Archive<?> archive) |
protected Bundle |
installBundle(String location) |
protected Bundle |
installBundle(String location,
InputStream inputStream) |
protected Bundle |
installBundle(VirtualFile virtualFile) |
protected void |
refreshBundles(Collection<Bundle> bundles) |
protected void |
refreshBundles(Collection<Bundle> bundles,
long timeout,
TimeUnit unit) |
protected boolean |
resolveBundles(Collection<Bundle> bundles) |
void |
serviceChanged(ServiceEvent event) |
void |
setUp()
Writes a a debug start messge
|
static void |
shutdownFramework() |
void |
tearDown()
Writes a a debug stop messge
|
assembleArchive, assembleArchive, assertBundleState, assertLoadClass, assertLoadClass, assertLoadClassFail, getFrameworkName, getLongName, getResourceFile, getResourceURL, getServerHost, getShortName, getTargetContainer, getTestArchiveFile, getTestArchivePath, getTestArchiveURL, toInputStream, toVirtualFilepublic void setUp()
throws Exception
OSGiTestpublic void tearDown()
throws Exception
OSGiTestpublic static Framework createFramework() throws BundleException
BundleExceptionpublic static Framework getFramework() throws BundleException
BundleExceptionpublic static void shutdownFramework()
throws BundleException,
InterruptedException
BundleExceptionInterruptedExceptionpublic static BundleContext getSystemContext() throws BundleException
BundleExceptionprotected Bundle installBundle(org.jboss.shrinkwrap.api.Archive<?> archive) throws BundleException, IOException
BundleExceptionIOExceptionprotected Bundle installBundle(VirtualFile virtualFile) throws BundleException, IOException
BundleExceptionIOExceptionprotected Bundle installBundle(String location) throws BundleException, IOException
BundleExceptionIOExceptionprotected Bundle installBundle(String location, InputStream inputStream) throws BundleException
BundleExceptionpublic void frameworkEvent(FrameworkEvent event)
frameworkEvent in interface FrameworkListenerprotected void assertFrameworkEvent(int type,
Bundle bundle,
Class<? extends Throwable> expectedThrowable)
throws Exception
Exceptionpublic void bundleChanged(BundleEvent event)
bundleChanged in interface BundleListenerprotected void assertBundleEvent(int type,
Bundle bundle)
throws Exception
Exceptionpublic void serviceChanged(ServiceEvent event)
serviceChanged in interface ServiceListenerprotected void assertServiceEvent(int type,
ServiceReference reference)
throws Exception
Exceptionprotected void assertNoAllReferences(BundleContext bundleContext, String clazz) throws Exception
Exceptionprotected void assertNoAllReferences(BundleContext bundleContext, String clazz, String filter) throws Exception
Exceptionprotected void assertAllReferences(BundleContext bundleContext, String clazz, ServiceReference... expected) throws Exception
Exceptionprotected void assertAllReferences(BundleContext bundleContext, String clazz, String filter, ServiceReference... expected) throws Exception
Exceptionprotected void assertNoReferences(BundleContext bundleContext, String clazz) throws Exception
Exceptionprotected void assertNoReferences(BundleContext bundleContext, String clazz, String filter) throws Exception
Exceptionprotected void assertReferences(BundleContext bundleContext, String clazz, ServiceReference... expected) throws Exception
Exceptionprotected void assertReferences(BundleContext bundleContext, String clazz, String filter, ServiceReference... expected) throws Exception
Exceptionprotected void assertNoGetReference(BundleContext bundleContext, String clazz) throws Exception
Exceptionprotected void assertGetReference(BundleContext bundleContext, String clazz, ServiceReference expected) throws Exception
Exceptionprotected void assertUsingBundles(ServiceReference reference, Bundle... bundles)
protected <T> T assertInstanceOf(Object o, Class<T> expectedType, boolean allowNull)
protected ServiceReference getServiceReference(String clazz, long timeout) throws BundleException
BundleExceptionprotected boolean resolveBundles(Collection<Bundle> bundles) throws Exception
Exceptionprotected void refreshBundles(Collection<Bundle> bundles) throws Exception
Exceptionprotected void refreshBundles(Collection<Bundle> bundles, long timeout, TimeUnit unit) throws Exception
ExceptionCopyright © 2014 JBoss by Red Hat. All Rights Reserved.