public class

PaxExamRuntime

extends Object
java.lang.Object
   ↳ org.ops4j.pax.exam.spi.PaxExamRuntime

Class Overview

Pax Exam runtime.

Summary

Public Methods
static TestContainer createContainer(ExamSystem system)
Convenience factory when just dealing with one container (intentionally).
static TestContainer createContainer(String configurationClassName)
Creates and starts a test container using options from a configuration class.
static ExamSystem createServerSystem(Option... options)
static ExamSystem createTestSystem(Option... options)
static TestContainerFactory getTestContainerFactory(Class<? extends TestContainerFactory> select)
Select yourself
static TestContainerFactory getTestContainerFactory()
Discovers the regression container.
static void main(String[] args)
Runs a standalone container in server mode which can be terminated gracefully by sending text commands over a socket.
[Expand]
Inherited Methods
From class java.lang.Object

Public Methods

public static TestContainer createContainer (ExamSystem system)

Convenience factory when just dealing with one container (intentionally). Note, this will break if there is not exaclty one container available and parsed from options. If there are more containers, just the first (whatever comes first) will be picked.

Parameters
system to be used.
Returns
  • exactly one Test Container.

public static TestContainer createContainer (String configurationClassName)

Creates and starts a test container using options from a configuration class.

Parameters
configurationClassName fully qualified class name of a configuration class.
Returns
  • started test container
Throws
Exception

public static ExamSystem createServerSystem (Option... options)

Throws
IOException

public static ExamSystem createTestSystem (Option... options)

Throws
IOException

public static TestContainerFactory getTestContainerFactory (Class<? extends TestContainerFactory> select)

Select yourself

Parameters
select the exact implementation if you dont want to rely on commons util discovery or change different containers in a single project.
Returns
  • discovered regression container

public static TestContainerFactory getTestContainerFactory ()

Discovers the regression container. Discovery is performed via ServiceLoader discovery mechanism.

Returns
  • discovered test container

public static void main (String[] args)

Runs a standalone container in server mode which can be terminated gracefully by sending text commands over a socket.

This class must be invoked with two arguments:

  • The fully qualified name of a @Configuration class
  • A port number.
After starting the container, this process will listen on the given port for a "stop" command, sending a reply of "stopped". When finally receiving a "quit" command, the process will exit.

Parameters
args command line argument
Throws
Exception