org.eclipse.gemini.blueprint.test.internal.support
Class OsgiJUnitTestAdapter

java.lang.Object
  extended by org.eclipse.gemini.blueprint.test.internal.support.OsgiJUnitTestAdapter
All Implemented Interfaces:
OsgiJUnitTest

public class OsgiJUnitTestAdapter
extends Object
implements OsgiJUnitTest

Reflection-based adapter for OsgiJUnitTest used for wrapping AbstractOsgiTests & co. with OsgiJUnitTest interface without exposing the latter interface (which is internal and might be modified in the future).

Author:
Costin Leau

Constructor Summary
OsgiJUnitTestAdapter(junit.framework.TestCase target)
           
 
Method Summary
 junit.framework.TestCase getTestCase()
          Simple getter that returns the raw TestCase class.
 void injectBundleContext(org.osgi.framework.BundleContext bundleContext)
          Provides the OSGi bundle context to the test
 void osgiRunTest()
          Replacement for the 'traditional' runTest.
 void osgiSetUp()
          Replacement for the 'traditional' setUp.
 void osgiTearDown()
          Replacement for the 'traditional' tearDown.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OsgiJUnitTestAdapter

public OsgiJUnitTestAdapter(junit.framework.TestCase target)
Method Detail

injectBundleContext

public void injectBundleContext(org.osgi.framework.BundleContext bundleContext)
Description copied from interface: OsgiJUnitTest
Provides the OSGi bundle context to the test

Specified by:
injectBundleContext in interface OsgiJUnitTest

osgiRunTest

public void osgiRunTest()
                 throws Throwable
Description copied from interface: OsgiJUnitTest
Replacement for the 'traditional' runTest. Called by TestRunnerService.

Specified by:
osgiRunTest in interface OsgiJUnitTest
Throws:
Throwable

osgiSetUp

public void osgiSetUp()
               throws Exception
Description copied from interface: OsgiJUnitTest
Replacement for the 'traditional' setUp. Called by TestRunnerService.

Specified by:
osgiSetUp in interface OsgiJUnitTest
Throws:
Exception
See Also:
TestCase.setUp()

osgiTearDown

public void osgiTearDown()
                  throws Exception
Description copied from interface: OsgiJUnitTest
Replacement for the 'traditional' tearDown. Called by TestRunnerService.

Specified by:
osgiTearDown in interface OsgiJUnitTest
Throws:
Exception
See Also:
TestCase.tearDown()

getTestCase

public junit.framework.TestCase getTestCase()
Description copied from interface: OsgiJUnitTest
Simple getter that returns the raw TestCase class. Used mainly when applying OsgiJUnit functionality through decoration rather then inheritance.

Specified by:
getTestCase in interface OsgiJUnitTest
Returns:


Copyright © 2006-2013. All Rights Reserved.