Package com.helger.photon.app.mock
Class PhotonAppWebTestRule
- java.lang.Object
-
- org.junit.rules.ExternalResource
-
- com.helger.web.scope.mock.WebScopeTestRule
-
- com.helger.photon.app.mock.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 Summary
Constructors Constructor Description PhotonAppWebTestRule()
Ctor using the default storage path fromScopeTestRule
PhotonAppWebTestRule(File aPath)
Ctor with an arbitrary pathPhotonAppWebTestRule(File aDataPath, String sServletContextPath)
Ctor with an arbitrary path
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
after()
void
before()
File
getDataPath()
String
getServletContextPath()
PhotonAppWebTestRule
setDeleteAllData(boolean bDeleteAllData)
Delete the directories with data and servlet context path before each iteration?
-
-
-
Constructor Detail
-
PhotonAppWebTestRule
public PhotonAppWebTestRule()
Ctor using the default storage path fromScopeTestRule
-
PhotonAppWebTestRule
public PhotonAppWebTestRule(@Nonnull File aPath)
Ctor with an arbitrary path- Parameters:
aPath
- The data AND servlet context path to be used. May not benull
.- Since:
- 8.0.1
-
-
Method Detail
-
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 inbefore()
,false
if not.- Returns:
- this for chaining
-
before
public void before()
- Overrides:
before
in classcom.helger.web.scope.mock.WebScopeTestRule
-
after
public void after()
- Overrides:
after
in classcom.helger.web.scope.mock.WebScopeTestRule
-
-