Package com.helger.photon.app.mock
Class PhotonAppTestRule
java.lang.Object
org.junit.rules.ExternalResource
com.helger.scope.mock.ScopeTestRule
com.helger.photon.app.mock.PhotonAppTestRule
- All Implemented Interfaces:
org.junit.rules.TestRule
public class PhotonAppTestRule
extends com.helger.scope.mock.ScopeTestRule
Non-web scope aware test rule, with a defined storage root directory
- Author:
- Philip Helger
-
Field Summary
Fields inherited from class com.helger.scope.mock.ScopeTestRule
STORAGE_PATH -
Constructor Summary
ConstructorsConstructorDescriptionCtor using the default storage path fromScopeTestRulePhotonAppTestRule(File aPath) Ctor with an arbitrary pathPhotonAppTestRule(File aDataPath, String sServletContextPath) Ctor with an arbitrary path -
Method Summary
Modifier and TypeMethodDescriptionvoidafter()voidbefore()final Filefinal Stringfinal PhotonAppTestRulesetDeleteAllData(boolean bDeleteAllData) Delete the directories with data and servlet context path before each iteration?Methods inherited from class org.junit.rules.ExternalResource
apply
-
Constructor Details
-
PhotonAppTestRule
public PhotonAppTestRule()Ctor using the default storage path fromScopeTestRule -
PhotonAppTestRule
Ctor with an arbitrary path- Parameters:
aPath- The data AND servlet context path to be used. May not benull.- Since:
- 8.0.1
-
PhotonAppTestRule
Ctor with an arbitrary path- Parameters:
aDataPath- The data path to be used. May not benull.sServletContextPath- The servlet context path to be used. May not benull.
-
-
Method Details
-
getDataPath
- Returns:
- The used data path. Never
null.
-
getServletContextPath
- Returns:
- The used servlet context path. Never
null.
-
setDeleteAllData
Delete the directories with data and servlet context path before each iteration?- Parameters:
bDeleteAllData-trueto delete them inbefore(),falseif not.- Returns:
- this for chaining
-
before
public void before()- Overrides:
beforein classcom.helger.scope.mock.ScopeTestRule
-
after
public void after()- Overrides:
afterin classcom.helger.scope.mock.ScopeTestRule
-