public abstract static class JerseyTestNg.ContainerPerMethodTest extends JerseyTestNg
setUp()
/ tearDown()
methods
annotated by TestNG annotations BeforeMethod
/ AfterMethod
.JerseyTestNg.ContainerPerClassTest, JerseyTestNg.ContainerPerMethodTest
Constructor and Description |
---|
ContainerPerMethodTest() |
ContainerPerMethodTest(javax.ws.rs.core.Application jaxrsApplication) |
ContainerPerMethodTest(TestContainerFactory testContainerFactory) |
Modifier and Type | Method and Description |
---|---|
protected TestNgStrategy |
configureStrategy()
Configure
strategy for this TestNG JerseyTest. |
void |
setUp()
Set up the test by creating a test container instance,
starting it and by creating a new
pre-configured test client. |
void |
tearDown()
Tear down the test by
stopping the test container obtained from the
test container factory and by closing
and discarding the pre-configured test client
that was set up for the test. |
getClient, setClient
client, close, closeIfNotNull, configure, configureClient, configureDeployment, disable, enable, forceDisable, forceEnable, forceSet, getAsyncTimeoutMultiplier, getBaseUri, getLastLoggedRecord, getLoggedRecords, getPort, getTestContainerFactory, isEnabled, set, set, target, target
public ContainerPerMethodTest() throws TestContainerException
TestContainerException
public ContainerPerMethodTest(TestContainerFactory testContainerFactory)
public ContainerPerMethodTest(javax.ws.rs.core.Application jaxrsApplication) throws TestContainerException
TestContainerException
public void setUp() throws Exception
JerseyTest
starting
it and by creating a new
pre-configured
test client.
The test container is obtained from the test container factory
.setUp
in class JerseyTest
TestContainerException
- if the default test container factory cannot be obtained,
or the test application deployment context is not supported
by the test container factory.Exception
- if an exception is thrown during setting up the test environment.public void tearDown() throws Exception
JerseyTest
stopping
the test container obtained from the
test container factory
and by closing
and discarding the pre-configured
test client
that was set up
for the test.tearDown
in class JerseyTest
Exception
- if an exception is thrown during tearing down the test environment.protected TestNgStrategy configureStrategy()
JerseyTestNg
strategy
for this TestNG JerseyTest. The strategy defines
how a test container / client is stored (per class, per thread) and is also responsible for disposing stored instances.configureStrategy
in class JerseyTestNg
Copyright © 2007-2015, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.