org.jboss.osgi.testing
Class OSGiTestHelper

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

public class OSGiTestHelper
extends java.lang.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(java.lang.String name, java.lang.String[] resources, java.lang.Class<?>... packages)
           
 org.jboss.shrinkwrap.api.Archive<?> assembleArchive(java.lang.String name, java.lang.String resource, java.lang.Class<?>... packages)
           
 void assertBundleState(int expState, int wasState)
           
 java.lang.Class<?> assertLoadClass(org.osgi.framework.Bundle bundle, java.lang.String className)
           
 void assertLoadClassFail(org.osgi.framework.Bundle bundle, java.lang.String className)
           
 java.lang.String getFrameworkName()
           
 javax.naming.InitialContext getInitialContext()
           
 java.io.File getResourceFile(java.lang.String resource)
          Try to discover the File for the test resource
 java.net.URL getResourceURL(java.lang.String resource)
          Try to discover the URL for the test resource
 java.lang.String getServerHost()
           
 java.lang.String getTargetContainer()
           
 java.io.File getTestArchiveFile(java.lang.String archive)
          Try to discover the File for the deployment archive
 java.lang.String getTestArchivePath(java.lang.String archive)
          Try to discover the absolute path for the deployment archive
 java.net.URL getTestArchiveURL(java.lang.String archive)
          Try to discover the URL for the deployment archive
static org.jboss.osgi.vfs.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 java.net.URL getResourceURL(java.lang.String resource)
Try to discover the URL for the test resource


getResourceFile

public java.io.File getResourceFile(java.lang.String resource)
Try to discover the File for the test resource


getTestArchiveURL

public java.net.URL getTestArchiveURL(java.lang.String archive)
Try to discover the URL for the deployment archive


getTestArchivePath

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


getTestArchiveFile

public java.io.File getTestArchiveFile(java.lang.String archive)
Try to discover the File for the deployment archive


getInitialContext

public javax.naming.InitialContext getInitialContext()
                                              throws javax.naming.NamingException
Throws:
javax.naming.NamingException

getServerHost

public java.lang.String getServerHost()

getTargetContainer

public java.lang.String getTargetContainer()

getFrameworkName

public java.lang.String getFrameworkName()

assembleArchive

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

assembleArchive

public org.jboss.shrinkwrap.api.Archive<?> assembleArchive(java.lang.String name,
                                                           java.lang.String[] resources,
                                                           java.lang.Class<?>... packages)
                                                    throws java.io.IOException
Throws:
java.io.IOException

toVirtualFile

public static org.jboss.osgi.vfs.VirtualFile toVirtualFile(org.jboss.shrinkwrap.api.Archive archive)
                                                    throws java.io.IOException,
                                                           java.net.MalformedURLException
Throws:
java.io.IOException
java.net.MalformedURLException

assertBundleState

public void assertBundleState(int expState,
                              int wasState)

assertLoadClass

public java.lang.Class<?> assertLoadClass(org.osgi.framework.Bundle bundle,
                                          java.lang.String className)

assertLoadClassFail

public void assertLoadClassFail(org.osgi.framework.Bundle bundle,
                                java.lang.String className)


Copyright © 2010. All Rights Reserved.