org.knowhowlab.osgi.testing.assertions
Class FrameworkAssert

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

public class FrameworkAssert
extends OSGiAssert

A set of OSGi Framework 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 assertFrameworkEvent(int eventTypeMask, int bundleId, long timeoutInMillis)
          Asserts that FrameworkEvent for defined bundle will be fired within given timeoutInMillis.
static void assertFrameworkEvent(int eventTypeMask, int bundleId, long timeout, TimeUnit timeUnit)
          Asserts that FrameworkEvent for defined bundle will be fired within given timeout.
static void assertFrameworkEvent(int eventTypeMask, String symbolicName, long timeoutInMillis)
          Asserts that FrameworkEvent for defined bundle will be fired within given timeoutInMillis.
static void assertFrameworkEvent(int eventTypeMask, String symbolicName, long timeout, TimeUnit timeUnit)
          Asserts that FrameworkEvent for defined bundle will be fired within given timeout.
static void assertFrameworkEvent(int eventTypeMask, String symbolicName, org.osgi.framework.Version version, long timeoutInMillis)
          Asserts that FrameworkEvent for defined bundle will be fired within given timeoutInMillis.
static void assertFrameworkEvent(int eventTypeMask, String symbolicName, org.osgi.framework.Version version, long timeout, TimeUnit timeUnit)
          Asserts that FrameworkEvent for defined bundle will be fired within given timeout.
static void assertFrameworkEvent(String message, int eventTypeMask, int bundleId, long timeoutInMillis)
          Asserts that FrameworkEvent for defined bundle will be fired within given timeoutInMillis.
static void assertFrameworkEvent(String message, int eventTypeMask, int bundleId, long timeout, TimeUnit timeUnit)
          Asserts that FrameworkEvent for defined bundle will be fired within given timeout.
static void assertFrameworkEvent(String message, int eventTypeMask, String symbolicName, long timeoutInMillis)
          Asserts that FrameworkEvent for defined bundle will be fired within given timeoutInMillis.
static void assertFrameworkEvent(String message, int eventTypeMask, String symbolicName, long timeout, TimeUnit timeUnit)
          Asserts that FrameworkEvent for defined bundle will be fired within given timeout.
static void assertFrameworkEvent(String message, int eventTypeMask, String symbolicName, org.osgi.framework.Version version, long timeoutInMillis)
          Asserts that FrameworkEvent for defined bundle will be fired within given timeoutInMillis.
static void assertFrameworkEvent(String message, int eventTypeMask, String symbolicName, org.osgi.framework.Version version, long timeout, TimeUnit timeUnit)
          Asserts that FrameworkEvent for defined bundle will be fired within given timeout.
 
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

assertFrameworkEvent

public static void assertFrameworkEvent(int eventTypeMask,
                                        int bundleId,
                                        long timeoutInMillis)
Asserts that FrameworkEvent for defined bundle will be fired within given timeoutInMillis. If it not as expected AssertionError is thrown

Parameters:
eventTypeMask - FrameworkEvent type mask
bundleId - bundle id
timeoutInMillis - time interval in millis to wait. If zero, the method will wait indefinitely.
Since:
1.1

assertFrameworkEvent

public static void assertFrameworkEvent(String message,
                                        int eventTypeMask,
                                        int bundleId,
                                        long timeoutInMillis)
Asserts that FrameworkEvent for defined bundle will be fired within given timeoutInMillis. If it not as expected AssertionError is thrown with the given message

Parameters:
message - message
eventTypeMask - FrameworkEvent type mask
bundleId - bundle id
timeoutInMillis - time interval in millis to wait. If zero, the method will wait indefinitely.
Since:
1.1

assertFrameworkEvent

public static void assertFrameworkEvent(int eventTypeMask,
                                        int bundleId,
                                        long timeout,
                                        TimeUnit timeUnit)
Asserts that FrameworkEvent for defined bundle will be fired within given timeout. If it not as expected AssertionError is thrown

Parameters:
eventTypeMask - FrameworkEvent type mask
bundleId - bundle id
timeout - time interval to wait. If zero, the method will wait indefinitely.
timeUnit - time unit for the time interval
Since:
1.1

assertFrameworkEvent

public static void assertFrameworkEvent(String message,
                                        int eventTypeMask,
                                        int bundleId,
                                        long timeout,
                                        TimeUnit timeUnit)
Asserts that FrameworkEvent for defined bundle will be fired within given timeout. If it not as expected AssertionError is thrown with the given message

Parameters:
message - message
eventTypeMask - FrameworkEvent type mask
bundleId - bundle id
timeout - time interval to wait. If zero, the method will wait indefinitely.
timeUnit - time unit for the time interval
Since:
1.1

assertFrameworkEvent

public static void assertFrameworkEvent(int eventTypeMask,
                                        String symbolicName,
                                        long timeoutInMillis)
Asserts that FrameworkEvent for defined bundle will be fired within given timeoutInMillis. If it not as expected AssertionError is thrown

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

assertFrameworkEvent

public static void assertFrameworkEvent(String message,
                                        int eventTypeMask,
                                        String symbolicName,
                                        long timeoutInMillis)
Asserts that FrameworkEvent for defined bundle will be fired within given timeoutInMillis. If it not as expected AssertionError is thrown with the given message

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

assertFrameworkEvent

public static void assertFrameworkEvent(int eventTypeMask,
                                        String symbolicName,
                                        long timeout,
                                        TimeUnit timeUnit)
Asserts that FrameworkEvent for defined bundle will be fired within given timeout. If it not as expected AssertionError is thrown

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

assertFrameworkEvent

public static void assertFrameworkEvent(String message,
                                        int eventTypeMask,
                                        String symbolicName,
                                        long timeout,
                                        TimeUnit timeUnit)
Asserts that FrameworkEvent for defined bundle will be fired within given timeout. If it not as expected AssertionError is thrown with the given message

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

assertFrameworkEvent

public static void assertFrameworkEvent(int eventTypeMask,
                                        String symbolicName,
                                        org.osgi.framework.Version version,
                                        long timeoutInMillis)
Asserts that FrameworkEvent for defined bundle will be fired within given timeoutInMillis. If it not as expected AssertionError is thrown

Parameters:
eventTypeMask - FrameworkEvent type mask
symbolicName - symbolicName
version - version
timeoutInMillis - time interval in millis to wait. If zero, the method will wait indefinitely.
Since:
1.1

assertFrameworkEvent

public static void assertFrameworkEvent(String message,
                                        int eventTypeMask,
                                        String symbolicName,
                                        org.osgi.framework.Version version,
                                        long timeoutInMillis)
Asserts that FrameworkEvent for defined bundle will be fired within given timeoutInMillis. If it not as expected AssertionError is thrown with the given message

Parameters:
message - message
eventTypeMask - FrameworkEvent type mask
symbolicName - symbolicName
version - version
timeoutInMillis - time interval in millis to wait. If zero, the method will wait indefinitely.
Since:
1.1

assertFrameworkEvent

public static void assertFrameworkEvent(int eventTypeMask,
                                        String symbolicName,
                                        org.osgi.framework.Version version,
                                        long timeout,
                                        TimeUnit timeUnit)
Asserts that FrameworkEvent for defined bundle will be fired within given timeout. If it not as expected AssertionError is thrown

Parameters:
eventTypeMask - FrameworkEvent type mask
symbolicName - symbolicName
version - version
timeout - time interval to wait. If zero, the method will wait indefinitely.
timeUnit - time unit for the time interval
Since:
1.1

assertFrameworkEvent

public static void assertFrameworkEvent(String message,
                                        int eventTypeMask,
                                        String symbolicName,
                                        org.osgi.framework.Version version,
                                        long timeout,
                                        TimeUnit timeUnit)
Asserts that FrameworkEvent for defined bundle will be fired within given timeout. If it not as expected AssertionError is thrown with the given message

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


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