|
SMILA (incubation) API documentation | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.ObjectTestCase
org.eclipse.smila.test.DeclarativeServiceTestCase
public abstract class DeclarativeServiceTestCase
Abstract base class for JUnit tests dealing with DeclarativeServices.
| Field Summary | |
|---|---|
protected Log |
_log
The log. |
protected static int |
DEFAULT_SERVICE_MAX_WAITING
The Constant DEFAULT_SERVICE_MAX_WAITING. |
| Constructor Summary | |
|---|---|
DeclarativeServiceTestCase()
|
|
| Method Summary | ||
|---|---|---|
protected static void |
assertServiceRegistered(java.lang.Class<?> serviceInterface,
java.lang.Class<?> implementationClass)
check if a service with the given service and implementation class was registered. |
|
protected
|
getService(java.lang.Class<T> clazz)
Gets the service with default wait delay. |
|
protected
|
getService(java.lang.Class<T> clazz,
long timeout)
Deprecated. |
|
protected
|
getService(java.lang.Class<T> clazz,
java.lang.String filter)
Gets the service with default wait delay. |
|
protected
|
getService(java.lang.Class<T> clazz,
java.lang.String filter,
long timeout)
Uses a ServiceTracker to get the given DeclarativeService. |
|
protected java.lang.Object |
getService(java.lang.String clazz,
long timeout)
Deprecated. |
|
protected java.lang.Object |
getService(java.lang.String clazz,
java.lang.String filter,
long timeout)
Deprecated. |
|
protected
|
registerService(java.lang.Object service,
java.util.Dictionary<java.lang.String,?> properties,
java.lang.Class<T> clazz,
long timeout)
Registers the given service and returns it. |
|
protected java.net.URL |
resolveResourceURL(java.lang.String relativePath)
Resolve resource URL. |
|
static void |
setBundleContext(BundleContext bundleContext)
Sets the BundleContext. |
|
protected void |
unregisterService(java.lang.Class<?> clazz)
Unregisters the given service. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static final int DEFAULT_SERVICE_MAX_WAITING
protected final Log _log
| Constructor Detail |
|---|
public DeclarativeServiceTestCase()
| Method Detail |
|---|
public static void setBundleContext(BundleContext bundleContext)
bundleContext - the BundleContext
@Deprecated
protected java.lang.Object getService(java.lang.String clazz,
long timeout)
throws java.lang.InterruptedException
clazz - the class name of the DeclarativeService interfacetimeout - the number of milliseconds to wait for the ServiceTracker to find the service
java.lang.InterruptedException - a InterruptedException
@Deprecated
protected <T> T getService(java.lang.Class<T> clazz,
long timeout)
throws java.lang.InterruptedException
clazz - the service class of the DeclarativeService interfacetimeout - the number of milliseconds to wait for the ServiceTracker to find the service
java.lang.InterruptedException - a InterruptedException
protected <T> T getService(java.lang.Class<T> clazz)
throws java.lang.InterruptedException
clazz - the clazz
java.lang.InterruptedException - the interrupted exception
protected <T> T getService(java.lang.Class<T> clazz,
java.lang.String filter,
long timeout)
throws java.lang.InterruptedException
clazz - the service class of the DeclarativeService interfacefilter - the filtertimeout - the number of milliseconds to wait for the ServiceTracker to find the service
java.lang.InterruptedException - a InterruptedException
protected <T> T getService(java.lang.Class<T> clazz,
java.lang.String filter)
throws java.lang.InterruptedException
clazz - the clazzfilter - the filter
java.lang.InterruptedException - the interrupted exception
@Deprecated
protected java.lang.Object getService(java.lang.String clazz,
java.lang.String filter,
long timeout)
throws java.lang.InterruptedException
clazz - the class name of the DeclarativeService interfacetimeout - the number of milliseconds to wait for the ServiceTracker to find the service
java.lang.InterruptedException - a InterruptedException
protected <T> T registerService(java.lang.Object service,
java.util.Dictionary<java.lang.String,?> properties,
java.lang.Class<T> clazz,
long timeout)
throws java.lang.InterruptedException
service - the service to registerproperties - propertiesclazz - the service class of the DeclarativeService interfacetimeout - the number of milliseconds to wait for the ServiceTracker to find the service
java.lang.InterruptedException - a InterruptedException
protected void unregisterService(java.lang.Class<?> clazz)
throws java.lang.InterruptedException
clazz - the service class to be unregistered
java.lang.InterruptedException - a InterruptedExceptionorg.osgi.framework.BundleContext#ungetService(ServiceReference)}.
protected java.net.URL resolveResourceURL(java.lang.String relativePath)
throws java.io.IOException
relativePath - the relative path
java.io.IOException - Signals that an I/O exception has occurred.
protected static void assertServiceRegistered(java.lang.Class<?> serviceInterface,
java.lang.Class<?> implementationClass)
serviceInterface - service interface classimplementationClass - implementation class
|
SMILA (incubation) API documentation | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||