Package org.glassfish.jersey.test.spi
Interface TestNgStrategy
-
- All Known Implementing Classes:
ContainerPerClassTestNgStrategy
,ContainerPerMethodTestNgStrategy
public interface TestNgStrategy
Strategy defining how test containers and clients are stored and passed to TestNG tests.Jersey Test
callstestContainer(TestContainer)
/client(jakarta.ws.rs.client.Client)
methods beforetestContainer()
/client()
. Strategy is not supposed to create instances of test container / client. It's purpose is to appropriately store given instances for different TestNG approaches defined by@BeforeXXX
and@AfterXXX
annotations.- Author:
- Michal Gajdos
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Client
client()
Return a JAX-RS client.Client
client(Client client)
Set a new JAX-RS client instance and return the old, previously stored, instance.TestContainer
testContainer()
Return a test container to run the tests in.TestContainer
testContainer(TestContainer testContainer)
Set a new test container instance to run the tests in and return the old, previously stored, instance.
-
-
-
Method Detail
-
testContainer
TestContainer testContainer()
Return a test container to run the tests in. This method is called aftertestContainer(TestContainer)
.- Returns:
- a test container instance or
null
if the test container is not set.
-
testContainer
TestContainer testContainer(TestContainer testContainer)
Set a new test container instance to run the tests in and return the old, previously stored, instance.- Parameters:
testContainer
- new container instance.- Returns:
- an old container instance or
null
if the container is not set.
-
client
Client client()
Return a JAX-RS client. This method is called afterclient(jakarta.ws.rs.client.Client)
.- Returns:
- a client instance or
null
if the client is not set.
-
-