org.jboss.osgi.testing
Class OSGiTestHelper

java.lang.Object
  extended by org.jboss.osgi.testing.OSGiTestHelper
Direct Known Subclasses:
OSGiRuntimeHelper

public class OSGiTestHelper
extends Object

An OSGi Test Helper

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

Constructor Summary
OSGiTestHelper()
           
 
Method Summary
 org.jboss.shrinkwrap.api.Archive<?> assembleArchive(String name, String[] resources, Class<?>... packages)
           
 org.jboss.shrinkwrap.api.Archive<?> assembleArchive(String name, String resource, Class<?>... packages)
           
 void assertBundleState(int expState, int wasState)
           
 Class<?> assertLoadClass(Bundle bundle, String className)
           
 void assertLoadClassFail(Bundle bundle, String className)
           
 String getFrameworkName()
           
 InitialContext getInitialContext()
           
 File getResourceFile(String resource)
          Try to discover the File for the test resource
 URL getResourceURL(String resource)
          Try to discover the URL for the test resource
 String getServerHost()
           
 String getTargetContainer()
           
 File getTestArchiveFile(String archive)
          Try to discover the File for the deployment archive
 String getTestArchivePath(String archive)
          Try to discover the absolute path for the deployment archive
 URL getTestArchiveURL(String archive)
          Try to discover the URL for the deployment 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
 

Constructor Detail

OSGiTestHelper

public OSGiTestHelper()
Method Detail

getResourceURL

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


getResourceFile

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


getTestArchiveURL

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


getTestArchivePath

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


getTestArchiveFile

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


getInitialContext

public InitialContext getInitialContext()
                                 throws NamingException
Throws:
NamingException

getServerHost

public String getServerHost()

getTargetContainer

public String getTargetContainer()

getFrameworkName

public String getFrameworkName()

assembleArchive

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

assembleArchive

public org.jboss.shrinkwrap.api.Archive<?> 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

assertBundleState

public void assertBundleState(int expState,
                              int wasState)

assertLoadClass

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

assertLoadClassFail

public void assertLoadClassFail(Bundle bundle,
                                String className)


Copyright © 2010 JBoss, a division of Red Hat, Inc.. All Rights Reserved.