Class AbstractMemoryLeakWebAppTest

java.lang.Object
org.glassfish.jersey.test.JerseyTest
org.glassfish.jersey.test.memleak.common.AbstractMemoryLeakWebAppTest

public class AbstractMemoryLeakWebAppTest extends org.glassfish.jersey.test.JerseyTest
Adds support for web application testing and memory leak detection in target JVM.
Author:
Stepan Vavra
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
     
    protected org.glassfish.jersey.test.DeploymentContext
     
    void
    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.

    Methods inherited from class org.glassfish.jersey.test.JerseyTest

    client, close, closeIfNotNull, configure, disable, enable, forceDisable, forceEnable, forceSet, getAsyncTimeoutMultiplier, getBaseUri, getClient, getLastLoggedRecord, getLoggedRecords, getPort, getSslContext, getSslParameters, getTestContainerFactory, isEnabled, set, set, setClient, setUp, target, target, tearDown

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • AbstractMemoryLeakWebAppTest

      public AbstractMemoryLeakWebAppTest()
  • Method Details

    • verifyNoOutOfMemoryOccurred

      @AfterEach public void verifyNoOutOfMemoryOccurred() throws IOException
      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. Therefore the log file needs to be inspected when the JVM is shut down and all its resources are flushed and closed.
      Throws:
      IOException
    • configureDeployment

      protected org.glassfish.jersey.test.DeploymentContext configureDeployment()
      Overrides:
      configureDeployment in class org.glassfish.jersey.test.JerseyTest
    • configureClient

      protected void configureClient(ClientConfig config)
      Overrides:
      configureClient in class org.glassfish.jersey.test.JerseyTest