org.jboss.osgi.testing
Class OSGiFrameworkTest

java.lang.Object
  extended by org.jboss.osgi.testing.OSGiTest
      extended by org.jboss.osgi.testing.OSGiFrameworkTest
All Implemented Interfaces:
java.util.EventListener, org.osgi.framework.BundleListener, org.osgi.framework.FrameworkListener, org.osgi.framework.ServiceListener, org.osgi.framework.SynchronousBundleListener

public abstract class OSGiFrameworkTest
extends OSGiTest
implements org.osgi.framework.ServiceListener, org.osgi.framework.SynchronousBundleListener, org.osgi.framework.FrameworkListener

Parent for native framework tests.

Since:
10-Mar-2010
Author:
Thomas.Diesler@jboss.com

Field Summary
protected static org.osgi.framework.launch.Framework framework
           
protected static org.osgi.framework.BundleContext systemContext
           
 
Constructor Summary
OSGiFrameworkTest()
           
 
Method Summary
static void afterFrameworkTestClass()
           
protected  void assertAllReferences(org.osgi.framework.BundleContext bundleContext, java.lang.String clazz, org.osgi.framework.ServiceReference... expected)
           
protected  void assertAllReferences(org.osgi.framework.BundleContext bundleContext, java.lang.String clazz, java.lang.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, java.lang.Class<? extends java.lang.Throwable> expectedThrowable)
           
protected  void assertGetReference(org.osgi.framework.BundleContext bundleContext, java.lang.String clazz, org.osgi.framework.ServiceReference expected)
           
protected
<T> T
assertInstanceOf(java.lang.Object o, java.lang.Class<T> expectedType)
           
protected
<T> T
assertInstanceOf(java.lang.Object o, java.lang.Class<T> expectedType, boolean allowNull)
           
protected  void assertLoadClass(org.osgi.framework.Bundle bundle, java.lang.String className, org.osgi.framework.Bundle exporter)
           
protected  void assertNoAllReferences(org.osgi.framework.BundleContext bundleContext, java.lang.String clazz)
           
protected  void assertNoAllReferences(org.osgi.framework.BundleContext bundleContext, java.lang.String clazz, java.lang.String filter)
           
protected  void assertNoBundleEvent()
           
protected  void assertNoFrameworkEvent()
           
protected  void assertNoGetReference(org.osgi.framework.BundleContext bundleContext, java.lang.String clazz)
           
protected  void assertNoReferences(org.osgi.framework.BundleContext bundleContext, java.lang.String clazz)
           
protected  void assertNoReferences(org.osgi.framework.BundleContext bundleContext, java.lang.String clazz, java.lang.String filter)
           
protected  void assertNoServiceEvent()
           
protected  void assertReferences(org.osgi.framework.BundleContext bundleContext, java.lang.String clazz, org.osgi.framework.ServiceReference... expected)
           
protected  void assertReferences(org.osgi.framework.BundleContext bundleContext, java.lang.String clazz, java.lang.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)
           
static void beforeFrameworkTestClass()
           
 void bundleChanged(org.osgi.framework.BundleEvent event)
           
 void frameworkEvent(org.osgi.framework.FrameworkEvent event)
           
protected  org.osgi.service.packageadmin.PackageAdmin getPackageAdmin()
           
protected  org.osgi.framework.Bundle installBundle(org.jboss.shrinkwrap.api.Archive<?> archive)
           
protected  org.osgi.framework.Bundle installBundle(java.lang.String location)
           
protected  org.osgi.framework.Bundle installBundle(java.lang.String location, java.io.InputStream inputStream)
           
protected  org.osgi.framework.Bundle installBundle(org.jboss.osgi.vfs.VirtualFile virtualFile)
           
 void serviceChanged(org.osgi.framework.ServiceEvent event)
           
 
Methods inherited from class org.jboss.osgi.testing.OSGiTest
assembleArchive, assembleArchive, assertBundleState, assertLoadClass, assertLoadClassFail, getFrameworkName, getInitialContext, getLongName, getResourceFile, getResourceURL, getServerHost, getShortName, getTargetContainer, getTestArchiveFile, getTestArchivePath, getTestArchiveURL, getTestHelper, setUp, tearDown, toVirtualFile
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

framework

protected static org.osgi.framework.launch.Framework framework

systemContext

protected static org.osgi.framework.BundleContext systemContext
Constructor Detail

OSGiFrameworkTest

public OSGiFrameworkTest()
Method Detail

beforeFrameworkTestClass

public static void beforeFrameworkTestClass()
                                     throws java.lang.Exception
Throws:
java.lang.Exception

afterFrameworkTestClass

public static void afterFrameworkTestClass()
                                    throws java.lang.Exception
Throws:
java.lang.Exception

getPackageAdmin

protected org.osgi.service.packageadmin.PackageAdmin getPackageAdmin()

installBundle

protected org.osgi.framework.Bundle installBundle(org.jboss.shrinkwrap.api.Archive<?> archive)
                                           throws org.osgi.framework.BundleException,
                                                  java.io.IOException
Throws:
org.osgi.framework.BundleException
java.io.IOException

installBundle

protected org.osgi.framework.Bundle installBundle(org.jboss.osgi.vfs.VirtualFile virtualFile)
                                           throws org.osgi.framework.BundleException,
                                                  java.io.IOException
Throws:
org.osgi.framework.BundleException
java.io.IOException

installBundle

protected org.osgi.framework.Bundle installBundle(java.lang.String location)
                                           throws org.osgi.framework.BundleException,
                                                  java.io.IOException
Throws:
org.osgi.framework.BundleException
java.io.IOException

installBundle

protected org.osgi.framework.Bundle installBundle(java.lang.String location,
                                                  java.io.InputStream inputStream)
                                           throws org.osgi.framework.BundleException
Throws:
org.osgi.framework.BundleException

assertLoadClass

protected void assertLoadClass(org.osgi.framework.Bundle bundle,
                               java.lang.String className,
                               org.osgi.framework.Bundle exporter)

frameworkEvent

public void frameworkEvent(org.osgi.framework.FrameworkEvent event)
Specified by:
frameworkEvent in interface org.osgi.framework.FrameworkListener

assertNoFrameworkEvent

protected void assertNoFrameworkEvent()
                               throws java.lang.Exception
Throws:
java.lang.Exception

assertFrameworkEvent

protected void assertFrameworkEvent(int type,
                                    org.osgi.framework.Bundle bundle,
                                    java.lang.Class<? extends java.lang.Throwable> expectedThrowable)
                             throws java.lang.Exception
Throws:
java.lang.Exception

bundleChanged

public void bundleChanged(org.osgi.framework.BundleEvent event)
Specified by:
bundleChanged in interface org.osgi.framework.BundleListener

assertNoBundleEvent

protected void assertNoBundleEvent()
                            throws java.lang.Exception
Throws:
java.lang.Exception

assertBundleEvent

protected void assertBundleEvent(int type,
                                 org.osgi.framework.Bundle bundle)
                          throws java.lang.Exception
Throws:
java.lang.Exception

serviceChanged

public void serviceChanged(org.osgi.framework.ServiceEvent event)
Specified by:
serviceChanged in interface org.osgi.framework.ServiceListener

assertNoServiceEvent

protected void assertNoServiceEvent()
                             throws java.lang.Exception
Throws:
java.lang.Exception

assertServiceEvent

protected void assertServiceEvent(int type,
                                  org.osgi.framework.ServiceReference reference)
                           throws java.lang.Exception
Throws:
java.lang.Exception

assertNoAllReferences

protected void assertNoAllReferences(org.osgi.framework.BundleContext bundleContext,
                                     java.lang.String clazz)
                              throws java.lang.Exception
Throws:
java.lang.Exception

assertNoAllReferences

protected void assertNoAllReferences(org.osgi.framework.BundleContext bundleContext,
                                     java.lang.String clazz,
                                     java.lang.String filter)
                              throws java.lang.Exception
Throws:
java.lang.Exception

assertAllReferences

protected void assertAllReferences(org.osgi.framework.BundleContext bundleContext,
                                   java.lang.String clazz,
                                   org.osgi.framework.ServiceReference... expected)
                            throws java.lang.Exception
Throws:
java.lang.Exception

assertAllReferences

protected void assertAllReferences(org.osgi.framework.BundleContext bundleContext,
                                   java.lang.String clazz,
                                   java.lang.String filter,
                                   org.osgi.framework.ServiceReference... expected)
                            throws java.lang.Exception
Throws:
java.lang.Exception

assertNoReferences

protected void assertNoReferences(org.osgi.framework.BundleContext bundleContext,
                                  java.lang.String clazz)
                           throws java.lang.Exception
Throws:
java.lang.Exception

assertNoReferences

protected void assertNoReferences(org.osgi.framework.BundleContext bundleContext,
                                  java.lang.String clazz,
                                  java.lang.String filter)
                           throws java.lang.Exception
Throws:
java.lang.Exception

assertReferences

protected void assertReferences(org.osgi.framework.BundleContext bundleContext,
                                java.lang.String clazz,
                                org.osgi.framework.ServiceReference... expected)
                         throws java.lang.Exception
Throws:
java.lang.Exception

assertReferences

protected void assertReferences(org.osgi.framework.BundleContext bundleContext,
                                java.lang.String clazz,
                                java.lang.String filter,
                                org.osgi.framework.ServiceReference... expected)
                         throws java.lang.Exception
Throws:
java.lang.Exception

assertNoGetReference

protected void assertNoGetReference(org.osgi.framework.BundleContext bundleContext,
                                    java.lang.String clazz)
                             throws java.lang.Exception
Throws:
java.lang.Exception

assertGetReference

protected void assertGetReference(org.osgi.framework.BundleContext bundleContext,
                                  java.lang.String clazz,
                                  org.osgi.framework.ServiceReference expected)
                           throws java.lang.Exception
Throws:
java.lang.Exception

assertUsingBundles

protected void assertUsingBundles(org.osgi.framework.ServiceReference reference,
                                  org.osgi.framework.Bundle... bundles)

assertInstanceOf

protected <T> T assertInstanceOf(java.lang.Object o,
                                 java.lang.Class<T> expectedType)

assertInstanceOf

protected <T> T assertInstanceOf(java.lang.Object o,
                                 java.lang.Class<T> expectedType,
                                 boolean allowNull)


Copyright © 2010. All Rights Reserved.