public class AbstractMemoryLeakWebAppTest extends JerseyTest
Constructor and Description |
---|
AbstractMemoryLeakWebAppTest() |
Modifier and Type | Method and Description |
---|---|
protected void |
configureClient(ClientConfig config)
Configure the test client.
|
protected DeploymentContext |
configureDeployment()
Create and configure deployment context for the tested application.
|
void |
verifyNoOutOfMemoryOccurred()
Verifies no OutOfMemoryError is present in associated log file.
The motivation is to have the OutOfMemory error included in the JUnit test result if possible. The problem is that even of OutOfMemoryError occurred, it may not be logged yet. |
client, close, closeIfNotNull, configure, disable, enable, forceDisable, forceEnable, forceSet, getAsyncTimeoutMultiplier, getBaseUri, getClient, getLastLoggedRecord, getLoggedRecords, getPort, getTestContainerFactory, isEnabled, set, set, setClient, setUp, target, target, tearDown
public void verifyNoOutOfMemoryOccurred() throws IOException
IOException
protected DeploymentContext configureDeployment()
JerseyTest
JerseyTest
instance properties.
The method is invoked from JerseyTest
constructors to provide deployment context for the tested application.
Default implementation of this method creates
new deployment context
using JAX-RS application instance obtained by calling the JerseyTest.configure()
method.
Note that since the method is invoked from JerseyTest
constructor, the overriding implementation of the method
must not depend on any subclass fields as those will not be initialized yet when the method is invoked.
Also note that in case the JerseyTest.JerseyTest(javax.ws.rs.core.Application)
constructor is used, the method is never
invoked.
configureDeployment
in class JerseyTest
protected void configureClient(ClientConfig config)
JerseyTest
JerseyTest
subclasses to conveniently configure the test client instance
used by Jersey test framework (either returned from JerseyTest.client()
method or used to create
WebTarget
instances returned from one of the target
methods
(JerseyTest.target()
or JerseyTest.target(String)
).
Prior to every test method run, a new client instance is configured and created using the client configuration
provided by the TestContainer
as well as any internal JerseyTest
client configuration settings.
Before the actual client instance creation, Jersey test framework invokes this method in order to allow the subclasses to further customize created client instance.
After each test method is run, the existing client instance is closed
and discarded.
Default implementation of the method is "no-op".
configureClient
in class JerseyTest
config
- Jersey test client configuration that can be modified before the client is created.Copyright © 2007-2015, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.