public abstract class OSGiFrameworkTest extends OSGiTest implements org.osgi.framework.ServiceListener, org.osgi.framework.SynchronousBundleListener, org.osgi.framework.FrameworkListener
| Constructor and Description |
|---|
OSGiFrameworkTest() |
| Modifier and Type | Method and Description |
|---|---|
static void |
afterClass() |
protected void |
assertAllReferences(org.osgi.framework.BundleContext bundleContext,
String clazz,
org.osgi.framework.ServiceReference... expected) |
protected void |
assertAllReferences(org.osgi.framework.BundleContext bundleContext,
String clazz,
String filter,
org.osgi.framework.ServiceReference... expected) |
protected void |
assertBundleEvent(int type,
org.osgi.framework.Bundle bundle) |
protected void |
assertFrameworkEvent(int type,
org.osgi.framework.Bundle bundle,
Class<? extends Throwable> expectedThrowable) |
protected void |
assertGetReference(org.osgi.framework.BundleContext bundleContext,
String clazz,
org.osgi.framework.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(org.osgi.framework.BundleContext bundleContext,
String clazz) |
protected void |
assertNoAllReferences(org.osgi.framework.BundleContext bundleContext,
String clazz,
String filter) |
protected void |
assertNoBundleEvent() |
protected void |
assertNoFrameworkEvent() |
protected void |
assertNoGetReference(org.osgi.framework.BundleContext bundleContext,
String clazz) |
protected void |
assertNoReferences(org.osgi.framework.BundleContext bundleContext,
String clazz) |
protected void |
assertNoReferences(org.osgi.framework.BundleContext bundleContext,
String clazz,
String filter) |
protected void |
assertNoServiceEvent() |
protected void |
assertReferences(org.osgi.framework.BundleContext bundleContext,
String clazz,
org.osgi.framework.ServiceReference... expected) |
protected void |
assertReferences(org.osgi.framework.BundleContext bundleContext,
String clazz,
String filter,
org.osgi.framework.ServiceReference... expected) |
protected void |
assertServiceEvent(int type,
org.osgi.framework.ServiceReference reference) |
protected void |
assertUsingBundles(org.osgi.framework.ServiceReference reference,
org.osgi.framework.Bundle... bundles) |
void |
bundleChanged(org.osgi.framework.BundleEvent event) |
static org.osgi.framework.launch.Framework |
createFramework() |
void |
frameworkEvent(org.osgi.framework.FrameworkEvent event) |
static org.osgi.framework.launch.Framework |
getFramework() |
protected org.osgi.framework.ServiceReference |
getServiceReference(String clazz,
long timeout)
Get a ServiceReference within the given timeout.
|
static org.osgi.framework.BundleContext |
getSystemContext() |
protected org.osgi.framework.Bundle |
installBundle(org.jboss.shrinkwrap.api.Archive<?> archive) |
protected org.osgi.framework.Bundle |
installBundle(String location) |
protected org.osgi.framework.Bundle |
installBundle(String location,
InputStream inputStream) |
protected org.osgi.framework.Bundle |
installBundle(VirtualFile virtualFile) |
protected void |
refreshBundles(Collection<org.osgi.framework.Bundle> bundles) |
protected void |
refreshBundles(Collection<org.osgi.framework.Bundle> bundles,
long timeout,
TimeUnit unit) |
protected boolean |
resolveBundles(Collection<org.osgi.framework.Bundle> bundles) |
void |
serviceChanged(org.osgi.framework.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 org.osgi.framework.launch.Framework createFramework()
throws org.osgi.framework.BundleException
org.osgi.framework.BundleExceptionpublic static org.osgi.framework.launch.Framework getFramework()
throws org.osgi.framework.BundleException
org.osgi.framework.BundleExceptionpublic static void shutdownFramework()
throws org.osgi.framework.BundleException,
InterruptedException
org.osgi.framework.BundleExceptionInterruptedExceptionpublic static org.osgi.framework.BundleContext getSystemContext()
throws org.osgi.framework.BundleException
org.osgi.framework.BundleExceptionprotected org.osgi.framework.Bundle installBundle(org.jboss.shrinkwrap.api.Archive<?> archive)
throws org.osgi.framework.BundleException,
IOException
org.osgi.framework.BundleExceptionIOExceptionprotected org.osgi.framework.Bundle installBundle(VirtualFile virtualFile) throws org.osgi.framework.BundleException, IOException
org.osgi.framework.BundleExceptionIOExceptionprotected org.osgi.framework.Bundle installBundle(String location) throws org.osgi.framework.BundleException, IOException
org.osgi.framework.BundleExceptionIOExceptionprotected org.osgi.framework.Bundle installBundle(String location, InputStream inputStream) throws org.osgi.framework.BundleException
org.osgi.framework.BundleExceptionpublic void frameworkEvent(org.osgi.framework.FrameworkEvent event)
frameworkEvent in interface org.osgi.framework.FrameworkListenerprotected void assertFrameworkEvent(int type,
org.osgi.framework.Bundle bundle,
Class<? extends Throwable> expectedThrowable)
throws Exception
Exceptionpublic void bundleChanged(org.osgi.framework.BundleEvent event)
bundleChanged in interface org.osgi.framework.BundleListenerprotected void assertBundleEvent(int type,
org.osgi.framework.Bundle bundle)
throws Exception
Exceptionpublic void serviceChanged(org.osgi.framework.ServiceEvent event)
serviceChanged in interface org.osgi.framework.ServiceListenerprotected void assertServiceEvent(int type,
org.osgi.framework.ServiceReference reference)
throws Exception
Exceptionprotected void assertNoAllReferences(org.osgi.framework.BundleContext bundleContext,
String clazz)
throws Exception
Exceptionprotected void assertNoAllReferences(org.osgi.framework.BundleContext bundleContext,
String clazz,
String filter)
throws Exception
Exceptionprotected void assertAllReferences(org.osgi.framework.BundleContext bundleContext,
String clazz,
org.osgi.framework.ServiceReference... expected)
throws Exception
Exceptionprotected void assertAllReferences(org.osgi.framework.BundleContext bundleContext,
String clazz,
String filter,
org.osgi.framework.ServiceReference... expected)
throws Exception
Exceptionprotected void assertNoReferences(org.osgi.framework.BundleContext bundleContext,
String clazz)
throws Exception
Exceptionprotected void assertNoReferences(org.osgi.framework.BundleContext bundleContext,
String clazz,
String filter)
throws Exception
Exceptionprotected void assertReferences(org.osgi.framework.BundleContext bundleContext,
String clazz,
org.osgi.framework.ServiceReference... expected)
throws Exception
Exceptionprotected void assertReferences(org.osgi.framework.BundleContext bundleContext,
String clazz,
String filter,
org.osgi.framework.ServiceReference... expected)
throws Exception
Exceptionprotected void assertNoGetReference(org.osgi.framework.BundleContext bundleContext,
String clazz)
throws Exception
Exceptionprotected void assertGetReference(org.osgi.framework.BundleContext bundleContext,
String clazz,
org.osgi.framework.ServiceReference expected)
throws Exception
Exceptionprotected void assertUsingBundles(org.osgi.framework.ServiceReference reference,
org.osgi.framework.Bundle... bundles)
protected <T> T assertInstanceOf(Object o, Class<T> expectedType, boolean allowNull)
protected org.osgi.framework.ServiceReference getServiceReference(String clazz, long timeout) throws org.osgi.framework.BundleException
org.osgi.framework.BundleExceptionprotected boolean resolveBundles(Collection<org.osgi.framework.Bundle> bundles) throws Exception
Exceptionprotected void refreshBundles(Collection<org.osgi.framework.Bundle> bundles) throws Exception
Exceptionprotected void refreshBundles(Collection<org.osgi.framework.Bundle> bundles, long timeout, TimeUnit unit) throws Exception
ExceptionCopyright © 2016 JBoss by Red Hat. All rights reserved.