org.jboss.osgi.testing
Class OSGiTestHelper

java.lang.Object
  extended by org.jboss.osgi.testing.OSGiTestHelper

public class OSGiTestHelper
extends Object

An OSGi Test Helper

Since:
25-Sep-2008
Author:
Thomas.Diesler@jboss.org

Field Summary
static String SYSPROP_TEST_ARCHIVE_DIRECTORY
           
static String SYSPROP_TEST_RESOURCES_DIRECTORY
           
 
Method Summary
static org.jboss.shrinkwrap.api.spec.JavaArchive assembleArchive(String name, String[] resources, Class<?>... packages)
           
static org.jboss.shrinkwrap.api.spec.JavaArchive assembleArchive(String name, String resource, Class<?>... packages)
           
static void assertBundleState(int expState, int wasState)
           
static Class<?> assertLoadClass(Bundle bundle, String className)
           
static void assertLoadClass(Bundle bundle, String className, Bundle exporter)
           
static void assertLoadClassFail(Bundle bundle, String className)
           
static String getFrameworkName()
           
static File getResourceFile(String resource)
          Try to discover the File for the test resource
static URL getResourceURL(String resource)
          Try to discover the URL for the test resource
static String getServerHost()
           
static String getTargetContainer()
           
static File getTestArchiveFile(String archive)
          Try to discover the File for the deployment archive
static String getTestArchivePath(String archive)
          Try to discover the absolute path for the deployment archive
static URL getTestArchiveURL(String archive)
          Try to discover the URL for the deployment archive
static InputStream toInputStream(org.jboss.shrinkwrap.api.Archive<?> archive)
           
static VirtualFile toVirtualFile(org.jboss.shrinkwrap.api.Archive<?> archive)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SYSPROP_TEST_RESOURCES_DIRECTORY

public static final String SYSPROP_TEST_RESOURCES_DIRECTORY
See Also:
Constant Field Values

SYSPROP_TEST_ARCHIVE_DIRECTORY

public static final String SYSPROP_TEST_ARCHIVE_DIRECTORY
See Also:
Constant Field Values
Method Detail

getResourceURL

public static URL getResourceURL(String resource)
Try to discover the URL for the test resource


getResourceFile

public static File getResourceFile(String resource)
Try to discover the File for the test resource


getTestArchiveURL

public static URL getTestArchiveURL(String archive)
Try to discover the URL for the deployment archive


getTestArchivePath

public static String getTestArchivePath(String archive)
Try to discover the absolute path for the deployment archive


getTestArchiveFile

public static File getTestArchiveFile(String archive)
Try to discover the File for the deployment archive


getServerHost

public static String getServerHost()

getTargetContainer

public static String getTargetContainer()

getFrameworkName

public static String getFrameworkName()

assembleArchive

public static org.jboss.shrinkwrap.api.spec.JavaArchive assembleArchive(String name,
                                                                        String resource,
                                                                        Class<?>... packages)
                                                                 throws Exception
Throws:
Exception

assembleArchive

public static org.jboss.shrinkwrap.api.spec.JavaArchive assembleArchive(String name,
                                                                        String[] resources,
                                                                        Class<?>... packages)
                                                                 throws IOException
Throws:
IOException

toVirtualFile

public static VirtualFile toVirtualFile(org.jboss.shrinkwrap.api.Archive<?> archive)
                                 throws IOException,
                                        MalformedURLException
Throws:
IOException
MalformedURLException

toInputStream

public static InputStream toInputStream(org.jboss.shrinkwrap.api.Archive<?> archive)
                                 throws IOException
Throws:
IOException

assertBundleState

public static void assertBundleState(int expState,
                                     int wasState)

assertLoadClass

public static Class<?> assertLoadClass(Bundle bundle,
                                       String className)

assertLoadClassFail

public static void assertLoadClassFail(Bundle bundle,
                                       String className)

assertLoadClass

public static void assertLoadClass(Bundle bundle,
                                   String className,
                                   Bundle exporter)


Copyright © 2012. All Rights Reserved.