Class 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
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected void configureClient​(org.glassfish.jersey.client.ClientConfig config)  
      protected org.glassfish.jersey.test.DeploymentContext configureDeployment()  
      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.
      • 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
    • Constructor Detail

      • AbstractMemoryLeakWebAppTest

        public AbstractMemoryLeakWebAppTest()
    • Method Detail

      • verifyNoOutOfMemoryOccurred

        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​(org.glassfish.jersey.client.ClientConfig config)
        Overrides:
        configureClient in class org.glassfish.jersey.test.JerseyTest