org.knowhowlab.osgi.testing.assertions
Class BundleAssert

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

public class BundleAssert
extends OSGiAssert

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

Before use it should be initialized OSGiAssert.init(org.osgi.framework.BundleContext)

Version:
1.0
Author:
dmytro.pishchukhin
See Also:
AssertionError, OSGiAssert

Method Summary
static void assertBundleAvailable(long bundleId)
          Asserts that Bundle with bundleId is available in OSGi framework.
static void assertBundleAvailable(String symbolicName)
          Asserts that Bundle with symbolic name is available in OSGi framework.
static void assertBundleAvailable(String message, long bundleId)
          Asserts that Bundle with bundleId is available in OSGi framework.
static void assertBundleAvailable(String message, String symbolicName)
          Asserts that Bundle with symbolic name is available in OSGi framework.
static void assertBundleAvailable(String message, String symbolicName, org.osgi.framework.Version version)
          Asserts that Bundle with symbolic name and version is available in OSGi framework.
static void assertBundleAvailable(String symbolicName, org.osgi.framework.Version version)
          Asserts that Bundle with symbolic name and version is available in OSGi framework.
static void assertBundleState(int state, long bundleId)
          Asserts that Bundle with bundleId has given state value.
static void assertBundleState(int state, String symbolicName)
          Asserts that Bundle with symbolic name has given state value.
static void assertBundleState(int state, String symbolicName, org.osgi.framework.Version version)
          Asserts that Bundle with symbolic name and version has given state value.
static void assertBundleState(String message, int state, long bundleId)
          Asserts that Bundle with bundleId has given state value.
static void assertBundleState(String message, int state, String symbolicName)
          Asserts that Bundle with symbolic name has given state value.
static void assertBundleState(String message, int state, String symbolicName, org.osgi.framework.Version version)
          Asserts that Bundle with symbolic name and version has given state value.
static void assertBundleUnavailable(long bundleId)
          Asserts that Bundle with bundleId is unavailable in OSGi framework.
static void assertBundleUnavailable(String symbolicName)
          Asserts that Bundle with symbolic name is unavailable in OSGi framework.
static void assertBundleUnavailable(String message, long bundleId)
          Asserts that Bundle with bundleId is unavailable in OSGi framework.
static void assertBundleUnavailable(String message, String symbolicName)
          Asserts that Bundle with symbolic name is unavailable in OSGi framework.
static void assertBundleUnavailable(String message, String symbolicName, org.osgi.framework.Version version)
          Asserts that Bundle with symbolic name and version is unavailable in OSGi framework.
static void assertBundleUnavailable(String symbolicName, org.osgi.framework.Version version)
          Asserts that Bundle with symbolic name and version is unavailable in OSGi framework.
static void assertFragment(long bundleId)
          Asserts that Bundle with bundleId is fragment bundle.
static void assertFragment(String symbolicName)
          Asserts that Bundle with symbolic name is fragment bundle.
static void assertFragment(String message, long bundleId)
          Asserts that Bundle with bundleId is fragment bundle.
static void assertFragment(String message, String symbolicName)
          Asserts that Bundle with symbolic name is fragment bundle.
static void assertFragment(String message, String symbolicName, org.osgi.framework.Version version)
          Asserts that Bundle with symbolic name and version is fragment bundle.
static void assertFragment(String symbolicName, org.osgi.framework.Version version)
          Asserts that Bundle with symbolic name and version is fragment bundle.
static void assertNotFragment(long bundleId)
          Asserts that Bundle with bundleId is not a fragment bundle.
static void assertNotFragment(String symbolicName)
          Asserts that Bundle with symbolic name is not a fragment bundle.
static void assertNotFragment(String message, long bundleId)
          Asserts that Bundle with bundleId is not a fragment bundle.
static void assertNotFragment(String message, String symbolicName)
          Asserts that Bundle with symbolic name is not a fragment bundle.
static void assertNotFragment(String message, String symbolicName, org.osgi.framework.Version version)
          Asserts that Bundle with symbolic name and version is not a fragment bundle.
static void assertNotFragment(String symbolicName, org.osgi.framework.Version version)
          Asserts that Bundle with symbolic name and version is not a fragment bundle.
 
Methods inherited from class org.knowhowlab.osgi.testing.assertions.OSGiAssert
getBundleContext, init
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

assertBundleState

public static void assertBundleState(int state,
                                     long bundleId)
Asserts that Bundle with bundleId has given state value. If it not as expected AssertionError without a message is thrown

Parameters:
state - bundle state value
bundleId - bundle id

assertBundleState

public static void assertBundleState(String message,
                                     int state,
                                     long bundleId)
Asserts that Bundle with bundleId has given state value. If it not as expected AssertionError is thrown with the given message

Parameters:
message - message
state - bundle state value
bundleId - bundle id

assertBundleState

public static void assertBundleState(int state,
                                     String symbolicName)
Asserts that Bundle with symbolic name has given state value. If it not as expected AssertionError without a message is thrown

Parameters:
state - bundle state value
symbolicName - symbolic name

assertBundleState

public static void assertBundleState(String message,
                                     int state,
                                     String symbolicName)
Asserts that Bundle with symbolic name has given state value. If it not as expected AssertionError is thrown with the given message

Parameters:
message - message
state - bundle state value
symbolicName - symbolic name

assertBundleState

public static void assertBundleState(int state,
                                     String symbolicName,
                                     org.osgi.framework.Version version)
Asserts that Bundle with symbolic name and version has given state value. If it not as expected AssertionError without a message is thrown

Parameters:
state - bundle state value
symbolicName - symbolic name
version - version

assertBundleState

public static void assertBundleState(String message,
                                     int state,
                                     String symbolicName,
                                     org.osgi.framework.Version version)
Asserts that Bundle with symbolic name and version has given state value. If it not as expected AssertionError is thrown with the given message

Parameters:
message - message
state - bundle state value
symbolicName - symbolic name
version - version

assertBundleAvailable

public static void assertBundleAvailable(long bundleId)
Asserts that Bundle with bundleId is available in OSGi framework. If it not as expected AssertionError without a message is thrown

Parameters:
bundleId - bundle id

assertBundleAvailable

public static void assertBundleAvailable(String message,
                                         long bundleId)
Asserts that Bundle with bundleId is available in OSGi framework. If it not as expected AssertionError is thrown with the given message

Parameters:
message - message
bundleId - bundle id

assertBundleAvailable

public static void assertBundleAvailable(String symbolicName)
Asserts that Bundle with symbolic name is available in OSGi framework. If it not as expected AssertionError without a message is thrown

Parameters:
symbolicName - symbolic name

assertBundleAvailable

public static void assertBundleAvailable(String message,
                                         String symbolicName)
Asserts that Bundle with symbolic name is available in OSGi framework. If it not as expected AssertionError is thrown with the given message

Parameters:
message - message
symbolicName - symbolic name

assertBundleAvailable

public static void assertBundleAvailable(String symbolicName,
                                         org.osgi.framework.Version version)
Asserts that Bundle with symbolic name and version is available in OSGi framework. If it not as expected AssertionError without a message is thrown

Parameters:
symbolicName - symbolic name
version - version

assertBundleAvailable

public static void assertBundleAvailable(String message,
                                         String symbolicName,
                                         org.osgi.framework.Version version)
Asserts that Bundle with symbolic name and version is available in OSGi framework. If it not as expected AssertionError is thrown with the given message

Parameters:
message - message
symbolicName - symbolic name
version - version

assertBundleUnavailable

public static void assertBundleUnavailable(long bundleId)
Asserts that Bundle with bundleId is unavailable in OSGi framework. If it not as expected AssertionError without a message is thrown

Parameters:
bundleId - bundle id

assertBundleUnavailable

public static void assertBundleUnavailable(String message,
                                           long bundleId)
Asserts that Bundle with bundleId is unavailable in OSGi framework. If it not as expected AssertionError is thrown with the given message

Parameters:
message - message
bundleId - bundle id

assertBundleUnavailable

public static void assertBundleUnavailable(String symbolicName)
Asserts that Bundle with symbolic name is unavailable in OSGi framework. If it not as expected AssertionError without a message is thrown

Parameters:
symbolicName - symbolic name

assertBundleUnavailable

public static void assertBundleUnavailable(String message,
                                           String symbolicName)
Asserts that Bundle with symbolic name is unavailable in OSGi framework. If it not as expected AssertionError is thrown with the given message

Parameters:
message - message
symbolicName - symbolic name

assertBundleUnavailable

public static void assertBundleUnavailable(String symbolicName,
                                           org.osgi.framework.Version version)
Asserts that Bundle with symbolic name and version is unavailable in OSGi framework. If it not as expected AssertionError without a message is thrown

Parameters:
symbolicName - symbolic name
version - version

assertBundleUnavailable

public static void assertBundleUnavailable(String message,
                                           String symbolicName,
                                           org.osgi.framework.Version version)
Asserts that Bundle with symbolic name and version is unavailable in OSGi framework. If it not as expected AssertionError is thrown with the given message

Parameters:
message - message
symbolicName - symbolic name
version - version

assertFragment

public static void assertFragment(long bundleId)
Asserts that Bundle with bundleId is fragment bundle. If it not as expected AssertionError without a message is thrown

Parameters:
bundleId - bundle id

assertFragment

public static void assertFragment(String message,
                                  long bundleId)
Asserts that Bundle with bundleId is fragment bundle. If it not as expected AssertionError is thrown with the given message

Parameters:
message - message
bundleId - bundle id

assertFragment

public static void assertFragment(String symbolicName)
Asserts that Bundle with symbolic name is fragment bundle. If it not as expected AssertionError without a message is thrown

Parameters:
symbolicName - symbolic name

assertFragment

public static void assertFragment(String message,
                                  String symbolicName)
Asserts that Bundle with symbolic name is fragment bundle. If it not as expected AssertionError is thrown with the given message

Parameters:
message - message
symbolicName - symbolic name

assertFragment

public static void assertFragment(String symbolicName,
                                  org.osgi.framework.Version version)
Asserts that Bundle with symbolic name and version is fragment bundle. If it not as expected AssertionError without a message is thrown

Parameters:
symbolicName - symbolic name
version - version

assertFragment

public static void assertFragment(String message,
                                  String symbolicName,
                                  org.osgi.framework.Version version)
Asserts that Bundle with symbolic name and version is fragment bundle. If it not as expected AssertionError is thrown with the given message

Parameters:
message - message
symbolicName - symbolic name
version - version

assertNotFragment

public static void assertNotFragment(long bundleId)
Asserts that Bundle with bundleId is not a fragment bundle. If it not as expected AssertionError without a message is thrown

Parameters:
bundleId - bundle id

assertNotFragment

public static void assertNotFragment(String message,
                                     long bundleId)
Asserts that Bundle with bundleId is not a fragment bundle. If it not as expected AssertionError is thrown with the given message

Parameters:
message - message
bundleId - bundle id

assertNotFragment

public static void assertNotFragment(String symbolicName)
Asserts that Bundle with symbolic name is not a fragment bundle. If it not as expected AssertionError without a message is thrown

Parameters:
symbolicName - symbolic name

assertNotFragment

public static void assertNotFragment(String message,
                                     String symbolicName)
Asserts that Bundle with symbolic name is not a fragment bundle. If it not as expected AssertionError is thrown with the given message

Parameters:
message - message
symbolicName - symbolic name

assertNotFragment

public static void assertNotFragment(String symbolicName,
                                     org.osgi.framework.Version version)
Asserts that Bundle with symbolic name and version is not a fragment bundle. If it not as expected AssertionError without a message is thrown

Parameters:
symbolicName - symbolic name
version - version

assertNotFragment

public static void assertNotFragment(String message,
                                     String symbolicName,
                                     org.osgi.framework.Version version)
Asserts that Bundle with symbolic name and version is not a fragment bundle. If it not as expected AssertionError is thrown with the given message

Parameters:
message - message
symbolicName - symbolic name
version - version


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