org.knowhowlab.osgi.testing.assertions.cmpn
Class ConfigurationAdminAssert

java.lang.Object
  extended by org.knowhowlab.osgi.testing.assertions.OSGiAssert
      extended by org.knowhowlab.osgi.testing.assertions.cmpn.ConfigurationAdminAssert

public class ConfigurationAdminAssert
extends OSGiAssert

A set of OSGi ConfigurationAdmin specific assertion methods useful for writing tests.

Before use it could be initialized with default BundleContext OSGiAssert.setDefaultBundleContext(org.osgi.framework.BundleContext)

Author:
dmytro.pishchukhin
See Also:
AssertionError, OSGiAssert

Method Summary
static void assertConfigurationAvailable(org.osgi.framework.BundleContext bc, org.osgi.framework.Filter filter)
          Asserts that Configuration by filter is available for specific Bundle.
static void assertConfigurationAvailable(org.osgi.framework.BundleContext bc, String pid, String factoryPid)
          Asserts that Configuration with PID, FactoryPID is available for specific Bundle.
static void assertConfigurationAvailable(org.osgi.framework.Filter filter)
          Asserts that Configuration by filter is available.
static void assertConfigurationAvailable(String message, org.osgi.framework.BundleContext bc, org.osgi.framework.Filter filter)
          Asserts that Configuration by filter is available for specific Bundle.
static void assertConfigurationAvailable(String message, org.osgi.framework.BundleContext bc, String pid, String factoryPid)
          Asserts that Configuration with PID, FactoryPID is available for specific Bundle.
static void assertConfigurationAvailable(String message, org.osgi.framework.Filter filter)
          Asserts that Configuration by filter is available.
static void assertConfigurationAvailable(String pid, String factoryPid, String location)
          Asserts that Configuration with PID, FactoryPID and bundle location is available.
static void assertConfigurationAvailable(String message, String pid, String factoryPid, String location)
          Asserts that Configuration with PID, FactoryPID and bundle location is available.
static void assertConfigurationDeleted(String pid, String factoryPid, String location, long timeoutInMillis)
          Asserts that DELETE ConfigurationEvent with event filter will be fired within given timeoutInMillis.
static void assertConfigurationDeleted(String pid, String factoryPid, String location, long timeout, TimeUnit timeUnit)
          Asserts that DELETE ConfigurationEvent with event filter will be fired within given timeoutInMillis.
static void assertConfigurationDeleted(String message, String pid, String factoryPid, String location, long timeoutInMillis)
          Asserts that DELETE ConfigurationEvent with event filter will be fired within given timeoutInMillis.
static void assertConfigurationDeleted(String message, String pid, String factoryPid, String location, long timeout, TimeUnit timeUnit)
          Asserts that DELETE ConfigurationEvent with event filter will be fired within given timeoutInMillis.
static void assertConfigurationEvent(int eventTypeMask, long timeoutInMillis)
          Asserts that ConfigurationEvent with event type will be fired within given timeoutInMillis.
static void assertConfigurationEvent(int eventTypeMask, long timeout, TimeUnit timeUnit)
          Asserts that ConfigurationEvent with event type will be fired within given timeoutInMillis.
static void assertConfigurationEvent(int eventTypeMask, String pid, String factoryPid, String location, long timeoutInMillis)
          Asserts that ConfigurationEvent with event filter will be fired within given timeoutInMillis.
static void assertConfigurationEvent(int eventTypeMask, String pid, String factoryPid, String location, long timeout, TimeUnit timeUnit)
          Asserts that ConfigurationEvent with event filter will be fired within given timeoutInMillis.
static void assertConfigurationEvent(String message, int eventTypeMask, long timeoutInMillis)
          Asserts that ConfigurationEvent with event type will be fired within given timeoutInMillis.
static void assertConfigurationEvent(String message, int eventTypeMask, long timeout, TimeUnit timeUnit)
          Asserts that ConfigurationEvent with event type will be fired within given timeoutInMillis.
static void assertConfigurationEvent(String message, int eventTypeMask, String pid, String factoryPid, String location, long timeoutInMillis)
          Asserts that ConfigurationEvent with event filter will be fired within given timeoutInMillis.
static void assertConfigurationEvent(String message, int eventTypeMask, String pid, String factoryPid, String location, long timeout, TimeUnit timeUnit)
          Asserts that ConfigurationEvent with event filter will be fired within given timeoutInMillis.
static void assertConfigurationUnavailable(org.osgi.framework.BundleContext bc, org.osgi.framework.Filter filter)
          Asserts that Configuration by filter is unavailable for specific Bundle.
static void assertConfigurationUnavailable(org.osgi.framework.BundleContext bc, String pid, String factoryPid)
          Asserts that Configuration with PID, FactoryPID is unavailable for specific Bundle.
static void assertConfigurationUnavailable(org.osgi.framework.Filter filter)
          Asserts that Configuration by filter is unavailable.
static void assertConfigurationUnavailable(String message, org.osgi.framework.BundleContext bc, org.osgi.framework.Filter filter)
          Asserts that Configuration by filter is unavailable for specific Bundle.
static void assertConfigurationUnavailable(String message, org.osgi.framework.BundleContext bc, String pid, String factoryPid)
          Asserts that Configuration with PID, FactoryPID is unavailable for specific Bundle.
static void assertConfigurationUnavailable(String message, org.osgi.framework.Filter filter)
          Asserts that Configuration by filter is available.
static void assertConfigurationUnavailable(String pid, String factoryPid, String location)
          Asserts that Configuration with PID, FactoryPID and bundle location is unavailable.
static void assertConfigurationUnavailable(String message, String pid, String factoryPid, String location)
          Asserts that Configuration with PID, FactoryPID and bundle location is unavailable.
static void assertConfigurationUpdated(String pid, String factoryPid, String location, long timeoutInMillis)
          Asserts that UPDATE ConfigurationEvent with event filter will be fired within given timeoutInMillis.
static void assertConfigurationUpdated(String pid, String factoryPid, String location, long timeout, TimeUnit timeUnit)
          Asserts that UPDATE ConfigurationEvent with event filter will be fired within given timeoutInMillis.
static void assertConfigurationUpdated(String message, String pid, String factoryPid, String location, long timeoutInMillis)
          Asserts that UPDATE ConfigurationEvent with event filter will be fired within given timeoutInMillis.
static void assertConfigurationUpdated(String message, String pid, String factoryPid, String location, long timeout, TimeUnit timeUnit)
          Asserts that UPDATE ConfigurationEvent with event filter will be fired within given timeoutInMillis.
 
Methods inherited from class org.knowhowlab.osgi.testing.assertions.OSGiAssert
getBundleContext, setDefaultBundleContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

assertConfigurationAvailable

public static void assertConfigurationAvailable(String pid,
                                                String factoryPid,
                                                String location)
Asserts that Configuration with PID, FactoryPID and bundle location is available. If it not as expected AssertionError without a message is thrown

Parameters:
pid - PID
factoryPid - FactoryPID
location - bundle location
Since:
1.0

assertConfigurationAvailable

public static void assertConfigurationAvailable(String message,
                                                String pid,
                                                String factoryPid,
                                                String location)
Asserts that Configuration with PID, FactoryPID and bundle location is available. If it not as expected AssertionError with the given message

Parameters:
message - message
pid - PID
factoryPid - FactoryPID
location - bundle location

assertConfigurationAvailable

public static void assertConfigurationAvailable(org.osgi.framework.Filter filter)
Asserts that Configuration by filter is available. If it not as expected AssertionError without a message is thrown

Parameters:
filter - filter
Since:
1.0

assertConfigurationAvailable

public static void assertConfigurationAvailable(String message,
                                                org.osgi.framework.Filter filter)
Asserts that Configuration by filter is available. If it not as expected AssertionError with the given message

Parameters:
message - message
filter - filter
Since:
1.0

assertConfigurationUnavailable

public static void assertConfigurationUnavailable(String pid,
                                                  String factoryPid,
                                                  String location)
Asserts that Configuration with PID, FactoryPID and bundle location is unavailable. If it not as expected AssertionError without a message is thrown

Parameters:
pid - PID
factoryPid - FactoryPID
location - bundle location
Since:
1.0

assertConfigurationUnavailable

public static void assertConfigurationUnavailable(String message,
                                                  String pid,
                                                  String factoryPid,
                                                  String location)
Asserts that Configuration with PID, FactoryPID and bundle location is unavailable. If it not as expected AssertionError with the given message

Parameters:
message - message
pid - PID
factoryPid - FactoryPID
location - bundle location
Since:
1.0

assertConfigurationUnavailable

public static void assertConfigurationUnavailable(org.osgi.framework.Filter filter)
Asserts that Configuration by filter is unavailable. If it not as expected AssertionError without a message is thrown

Parameters:
filter - filter
Since:
1.0

assertConfigurationUnavailable

public static void assertConfigurationUnavailable(String message,
                                                  org.osgi.framework.Filter filter)
Asserts that Configuration by filter is available. If it not as expected AssertionError with the given message

Parameters:
message - message
filter - filter
Since:
1.0

assertConfigurationAvailable

public static void assertConfigurationAvailable(org.osgi.framework.BundleContext bc,
                                                String pid,
                                                String factoryPid)
Asserts that Configuration with PID, FactoryPID is available for specific Bundle. If it not as expected AssertionError without a message is thrown

Parameters:
bc - BundleContext
pid - PID
factoryPid - FactoryPID
Since:
1.1

assertConfigurationAvailable

public static void assertConfigurationAvailable(String message,
                                                org.osgi.framework.BundleContext bc,
                                                String pid,
                                                String factoryPid)
Asserts that Configuration with PID, FactoryPID is available for specific Bundle. If it not as expected AssertionError with the given message

Parameters:
message - message
bc - BundleContext
pid - PID
factoryPid - FactoryPID
Since:
1.1

assertConfigurationAvailable

public static void assertConfigurationAvailable(org.osgi.framework.BundleContext bc,
                                                org.osgi.framework.Filter filter)
Asserts that Configuration by filter is available for specific Bundle. If it not as expected AssertionError without a message is thrown

Parameters:
bc - BundleContext
filter - filter
Since:
1.1

assertConfigurationAvailable

public static void assertConfigurationAvailable(String message,
                                                org.osgi.framework.BundleContext bc,
                                                org.osgi.framework.Filter filter)
Asserts that Configuration by filter is available for specific Bundle. If it not as expected AssertionError with the given message

Parameters:
message - message
bc - BundleContext
filter - filter
Since:
1.1

assertConfigurationUnavailable

public static void assertConfigurationUnavailable(org.osgi.framework.BundleContext bc,
                                                  String pid,
                                                  String factoryPid)
Asserts that Configuration with PID, FactoryPID is unavailable for specific Bundle. If it not as expected AssertionError without a message is thrown

Parameters:
bc - BundleContext
pid - PID
factoryPid - FactoryPID
Since:
1.1

assertConfigurationUnavailable

public static void assertConfigurationUnavailable(String message,
                                                  org.osgi.framework.BundleContext bc,
                                                  String pid,
                                                  String factoryPid)
Asserts that Configuration with PID, FactoryPID is unavailable for specific Bundle. If it not as expected AssertionError with the given message

Parameters:
message - message
bc - BundleContext
pid - PID
factoryPid - FactoryPID
Since:
1.1

assertConfigurationUnavailable

public static void assertConfigurationUnavailable(org.osgi.framework.BundleContext bc,
                                                  org.osgi.framework.Filter filter)
Asserts that Configuration by filter is unavailable for specific Bundle. If it not as expected AssertionError without a message is thrown

Parameters:
bc - BundleContext
filter - filter
Since:
1.1

assertConfigurationUnavailable

public static void assertConfigurationUnavailable(String message,
                                                  org.osgi.framework.BundleContext bc,
                                                  org.osgi.framework.Filter filter)
Asserts that Configuration by filter is unavailable for specific Bundle. If it not as expected AssertionError with the given message

Parameters:
bc - BundleContext
message - message
filter - filter
Since:
1.1

assertConfigurationEvent

public static void assertConfigurationEvent(int eventTypeMask,
                                            long timeoutInMillis)
Asserts that ConfigurationEvent with event type will be fired within given timeoutInMillis. If it not as expected AssertionError without a message is thrown

Parameters:
eventTypeMask - ServiceEvent type mask
timeoutInMillis - time interval in millis to wait. If zero, the method will wait indefinitely.
Since:
1.0

assertConfigurationEvent

public static void assertConfigurationEvent(int eventTypeMask,
                                            String pid,
                                            String factoryPid,
                                            String location,
                                            long timeoutInMillis)
Asserts that ConfigurationEvent with event filter will be fired within given timeoutInMillis. If it not as expected AssertionError without a message is thrown

Parameters:
eventTypeMask - ServiceEvent type mask
pid - PID
factoryPid - FactoryPID
location - bundle location
timeoutInMillis - time interval in millis to wait. If zero, the method will wait indefinitely.
Since:
1.0

assertConfigurationUpdated

public static void assertConfigurationUpdated(String pid,
                                              String factoryPid,
                                              String location,
                                              long timeoutInMillis)
Asserts that UPDATE ConfigurationEvent with event filter will be fired within given timeoutInMillis. If it not as expected AssertionError without a message is thrown

Parameters:
pid - PID
factoryPid - FactoryPID
location - bundle location
timeoutInMillis - time interval in millis to wait. If zero, the method will wait indefinitely.
Since:
1.0

assertConfigurationDeleted

public static void assertConfigurationDeleted(String pid,
                                              String factoryPid,
                                              String location,
                                              long timeoutInMillis)
Asserts that DELETE ConfigurationEvent with event filter will be fired within given timeoutInMillis. If it not as expected AssertionError without a message is thrown

Parameters:
pid - PID
factoryPid - FactoryPID
location - bundle location
timeoutInMillis - time interval in millis to wait. If zero, the method will wait indefinitely.
Since:
1.0

assertConfigurationEvent

public static void assertConfigurationEvent(String message,
                                            int eventTypeMask,
                                            long timeoutInMillis)
Asserts that ConfigurationEvent with event type will be fired within given timeoutInMillis. If it not as expected AssertionError is thrown with the given message

Parameters:
message - message
eventTypeMask - ServiceEvent type mask
timeoutInMillis - time interval in millis to wait. If zero, the method will wait indefinitely.
Since:
1.0

assertConfigurationEvent

public static void assertConfigurationEvent(String message,
                                            int eventTypeMask,
                                            String pid,
                                            String factoryPid,
                                            String location,
                                            long timeoutInMillis)
Asserts that ConfigurationEvent with event filter will be fired within given timeoutInMillis. If it not as expected AssertionError is thrown with the given message

Parameters:
message - message
eventTypeMask - ServiceEvent type mask
pid - PID
factoryPid - FactoryPID
location - bundle location
timeoutInMillis - time interval in millis to wait. If zero, the method will wait indefinitely.
Since:
1.0

assertConfigurationUpdated

public static void assertConfigurationUpdated(String message,
                                              String pid,
                                              String factoryPid,
                                              String location,
                                              long timeoutInMillis)
Asserts that UPDATE ConfigurationEvent with event filter will be fired within given timeoutInMillis. If it not as expected AssertionError is thrown with the given message

Parameters:
message - message
pid - PID
factoryPid - FactoryPID
location - bundle location
timeoutInMillis - time interval in millis to wait. If zero, the method will wait indefinitely.
Since:
1.0

assertConfigurationDeleted

public static void assertConfigurationDeleted(String message,
                                              String pid,
                                              String factoryPid,
                                              String location,
                                              long timeoutInMillis)
Asserts that DELETE ConfigurationEvent with event filter will be fired within given timeoutInMillis. If it not as expected AssertionError is thrown with the given message

Parameters:
message - message
pid - PID
factoryPid - FactoryPID
location - bundle location
timeoutInMillis - time interval in millis to wait. If zero, the method will wait indefinitely.
Since:
1.0

assertConfigurationEvent

public static void assertConfigurationEvent(int eventTypeMask,
                                            long timeout,
                                            TimeUnit timeUnit)
Asserts that ConfigurationEvent with event type will be fired within given timeoutInMillis. If it not as expected AssertionError without a message is thrown

Parameters:
eventTypeMask - ServiceEvent type mask
timeout - time interval to wait. If zero, the method will wait indefinitely.
timeUnit - time unit for the time interval
Since:
1.0

assertConfigurationEvent

public static void assertConfigurationEvent(int eventTypeMask,
                                            String pid,
                                            String factoryPid,
                                            String location,
                                            long timeout,
                                            TimeUnit timeUnit)
Asserts that ConfigurationEvent with event filter will be fired within given timeoutInMillis. If it not as expected AssertionError without a message is thrown

Parameters:
eventTypeMask - ServiceEvent type mask
pid - PID
factoryPid - FactoryPID
location - bundle location
timeout - time interval to wait. If zero, the method will wait indefinitely.
timeUnit - time unit for the time interval
Since:
1.0

assertConfigurationUpdated

public static void assertConfigurationUpdated(String pid,
                                              String factoryPid,
                                              String location,
                                              long timeout,
                                              TimeUnit timeUnit)
Asserts that UPDATE ConfigurationEvent with event filter will be fired within given timeoutInMillis. If it not as expected AssertionError without a message is thrown

Parameters:
pid - PID
factoryPid - FactoryPID
location - bundle location
timeout - time interval to wait. If zero, the method will wait indefinitely.
timeUnit - time unit for the time interval
Since:
1.0

assertConfigurationDeleted

public static void assertConfigurationDeleted(String pid,
                                              String factoryPid,
                                              String location,
                                              long timeout,
                                              TimeUnit timeUnit)
Asserts that DELETE ConfigurationEvent with event filter will be fired within given timeoutInMillis. If it not as expected AssertionError without a message is thrown

Parameters:
pid - PID
factoryPid - FactoryPID
location - bundle location
timeout - time interval to wait. If zero, the method will wait indefinitely.
timeUnit - time unit for the time interval
Since:
1.0

assertConfigurationEvent

public static void assertConfigurationEvent(String message,
                                            int eventTypeMask,
                                            long timeout,
                                            TimeUnit timeUnit)
Asserts that ConfigurationEvent with event type will be fired within given timeoutInMillis. If it not as expected AssertionError is thrown with the given message

Parameters:
message - message
eventTypeMask - ServiceEvent type mask
timeout - time interval to wait. If zero, the method will wait indefinitely.
timeUnit - time unit for the time interval
Since:
1.0

assertConfigurationEvent

public static void assertConfigurationEvent(String message,
                                            int eventTypeMask,
                                            String pid,
                                            String factoryPid,
                                            String location,
                                            long timeout,
                                            TimeUnit timeUnit)
Asserts that ConfigurationEvent with event filter will be fired within given timeoutInMillis. If it not as expected AssertionError is thrown with the given message

Parameters:
message - message
eventTypeMask - ServiceEvent type mask
pid - PID
factoryPid - FactoryPID
location - bundle location
timeout - time interval to wait. If zero, the method will wait indefinitely.
timeUnit - time unit for the time interval
Since:
1.0

assertConfigurationUpdated

public static void assertConfigurationUpdated(String message,
                                              String pid,
                                              String factoryPid,
                                              String location,
                                              long timeout,
                                              TimeUnit timeUnit)
Asserts that UPDATE ConfigurationEvent with event filter will be fired within given timeoutInMillis. If it not as expected AssertionError is thrown with the given message

Parameters:
message - message
pid - PID
factoryPid - FactoryPID
location - bundle location
timeout - time interval to wait. If zero, the method will wait indefinitely.
timeUnit - time unit for the time interval
Since:
1.0

assertConfigurationDeleted

public static void assertConfigurationDeleted(String message,
                                              String pid,
                                              String factoryPid,
                                              String location,
                                              long timeout,
                                              TimeUnit timeUnit)
Asserts that DELETE ConfigurationEvent with event filter will be fired within given timeoutInMillis. If it not as expected AssertionError is thrown with the given message

Parameters:
message - message
pid - PID
factoryPid - FactoryPID
location - bundle location
timeout - time interval to wait. If zero, the method will wait indefinitely.
timeUnit - time unit for the time interval
Since:
1.0


Copyright © 2013 Know-How Lab. All Rights Reserved.