Class PhotonAppWebTestRule

  • All Implemented Interfaces:
    org.junit.rules.TestRule

    public class PhotonAppWebTestRule
    extends com.helger.web.scope.mock.WebScopeTestRule
    Web scope aware test rule, with a defined storage root directory
    Author:
    Philip Helger
    • Constructor Detail

      • PhotonAppWebTestRule

        public PhotonAppWebTestRule()
        Ctor using the default storage path from ScopeTestRule
      • PhotonAppWebTestRule

        public PhotonAppWebTestRule​(@Nonnull
                                    File aPath)
        Ctor with an arbitrary path
        Parameters:
        aPath - The data AND servlet context path to be used. May not be null.
        Since:
        8.0.1
      • PhotonAppWebTestRule

        public PhotonAppWebTestRule​(@Nonnull
                                    File aDataPath,
                                    @Nonnull @Nonempty
                                    String sServletContextPath)
        Ctor with an arbitrary path
        Parameters:
        aDataPath - The data path to be used. May not be null.
        sServletContextPath - The servlet context path to be used. May not be null.
    • Method Detail

      • getDataPath

        @Nonnull
        public final File getDataPath()
        Returns:
        The used data path. Never null.
      • getServletContextPath

        @Nonnull
        @Nonempty
        public final String getServletContextPath()
        Returns:
        The used servlet context path. Never null.
      • setDeleteAllData

        @Nonnull
        public final PhotonAppWebTestRule setDeleteAllData​(boolean bDeleteAllData)
        Delete the directories with data and servlet context path before each iteration?
        Parameters:
        bDeleteAllData - true to delete them in before(), false if not.
        Returns:
        this for chaining
      • before

        public void before()
        Overrides:
        before in class com.helger.web.scope.mock.WebScopeTestRule
      • after

        public void after()
        Overrides:
        after in class com.helger.web.scope.mock.WebScopeTestRule