public class

JarProbeOption

extends Object
implements Option
java.lang.Object
   ↳ org.ops4j.pax.exam.options.JarProbeOption

Class Overview

This option can be used to define the contents of a JAR probe for CDI test containers. When a JAR probe option is present, the test container builds a JAR on the fly, creates a classloader for this JAR and uses this as thread context classloader while the container is running.

Otherwise, when no JAR probe option is present, the CDI test container simply uses the system classloader.

Users should create instances of this class using jarProbe() and then invoke methods of this class in fluent syntax to configure the JAR probe.

Summary

Public Constructors
JarProbeOption()
Creates an empty JAR probe option.
Public Methods
JarProbeOption classes(Class...<?> klass)
Adds the given classes to the JAR.
List<Class<?>> getClasses()
Returns the classes of this JAR.
List<String> getMetaInfResources()
Returns the META-INF resources.
String getName()
Returns the base name of this JAR.
List<String> getResources()
Returns the classpath resources.
JarProbeOption metaInfResource(String resourcePath)
Adds the given resources from the current class path to the WAR in META-INF/.
JarProbeOption name(String _name)
Sets the base name of this JAR.
JarProbeOption resources(String... resourcePath)
Adds the given resources from the current class path to the JAR.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public JarProbeOption ()

Creates an empty JAR probe option. Application code should not invoke this constructor. Use warProbe() instead.

Public Methods

public JarProbeOption classes (Class...<?> klass)

Adds the given classes to the JAR.

Parameters
klass list of classes
Returns
  • this for fluent syntax

public List<Class<?>> getClasses ()

Returns the classes of this JAR.

Internal API, do no use in application code.

Returns
  • classes (possibly empty but not null)

public List<String> getMetaInfResources ()

Returns the META-INF resources.

Internal API, do no use in application code.

Returns
  • resources (possibly empty but not null)

public String getName ()

Returns the base name of this JAR.

Internal API, do no use in application code.

Returns
  • application name

public List<String> getResources ()

Returns the classpath resources.

Internal API, do no use in application code.

Returns
  • resources (possibly empty but not null)

public JarProbeOption metaInfResource (String resourcePath)

Adds the given resources from the current class path to the WAR in META-INF/.

Returns
  • this for fluent syntax

public JarProbeOption name (String _name)

Sets the base name of this JAR.

Parameters
_name base name
Returns
  • this for fluent syntax

public JarProbeOption resources (String... resourcePath)

Adds the given resources from the current class path to the JAR.

Returns
  • this for fluent syntax