Class ExternalWebXml

  • All Implemented Interfaces:
    org.junit.jupiter.api.extension.AfterAllCallback, org.junit.jupiter.api.extension.BeforeAllCallback, org.junit.jupiter.api.extension.Extension, org.junit.jupiter.api.extension.TestInstancePostProcessor

    public class ExternalWebXml
    extends java.lang.Object
    implements org.junit.jupiter.api.extension.TestInstancePostProcessor, org.junit.jupiter.api.extension.BeforeAllCallback, org.junit.jupiter.api.extension.AfterAllCallback
    Load an external web.xml for testing.
    Author:
    jumperchen
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String WEB_XML_KEY  
    • Constructor Summary

      Constructors 
      Constructor Description
      ExternalWebXml​(java.lang.Class<? extends BaseTestCase> testClass)
      Pass a test class and will find web.xml by a convention rule.
      ExternalWebXml​(java.lang.String configPath)
      Pass a path to web.xml manually.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void afterAll​(org.junit.jupiter.api.extension.ExtensionContext context)  
      void beforeAll​(org.junit.jupiter.api.extension.ExtensionContext context)  
      void postProcessTestInstance​(java.lang.Object testInstance, org.junit.jupiter.api.extension.ExtensionContext context)  
      • Methods inherited from class java.lang.Object

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

      • ExternalWebXml

        public ExternalWebXml​(java.lang.String configPath)
        Pass a path to web.xml manually.
        Parameters:
        configPath - a path to web.xml
      • ExternalWebXml

        public ExternalWebXml​(java.lang.Class<? extends BaseTestCase> testClass)
        Pass a test class and will find web.xml by a convention rule.

        e.g. F95_ZK_1234Test => /test2/F95-ZK-1234-web.xml

        Parameters:
        testClass - a test class (WebDriverTestCase only)
    • Method Detail

      • afterAll

        public void afterAll​(org.junit.jupiter.api.extension.ExtensionContext context)
                      throws java.lang.Exception
        Specified by:
        afterAll in interface org.junit.jupiter.api.extension.AfterAllCallback
        Throws:
        java.lang.Exception
      • beforeAll

        public void beforeAll​(org.junit.jupiter.api.extension.ExtensionContext context)
                       throws java.lang.Exception
        Specified by:
        beforeAll in interface org.junit.jupiter.api.extension.BeforeAllCallback
        Throws:
        java.lang.Exception
      • postProcessTestInstance

        public void postProcessTestInstance​(java.lang.Object testInstance,
                                            org.junit.jupiter.api.extension.ExtensionContext context)
                                     throws java.lang.Exception
        Specified by:
        postProcessTestInstance in interface org.junit.jupiter.api.extension.TestInstancePostProcessor
        Throws:
        java.lang.Exception