public class AbstractMemoryLeakWebAppTest extends JerseyTest
|Constructor and Description|
|Modifier and Type||Method and Description|
Configure the test client.
Create and configure deployment context for the tested application.
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
protected DeploymentContext configureDeployment()
This method may be overridden by subclasses to provide custom test container deployment context for the tested
application. The method may be also used to configure
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
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
protected void configureClient(ClientConfig config)
The method can be overridden by
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
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
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
Default implementation of the method is "no-op".
Copyright © 2007-2015, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.