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
-
Field Summary
Fields inherited from class com.helger.web.scope.mock.WebScopeTestRule
MOCK_CONTEXT_PATH -
Constructor Summary
ConstructorsConstructorDescriptionCtor using the default storage path fromScopeTestRulePhotonAppWebTestRule(File aPath) Ctor with an arbitrary pathPhotonAppWebTestRule(File aDataPath, String sServletContextPath) Ctor with an arbitrary path -
Method Summary
Modifier and TypeMethodDescriptionvoidafter()voidbefore()final Filefinal Stringfinal PhotonAppWebTestRulesetDeleteAllData(boolean bDeleteAllData) Delete the directories with data and servlet context path before each iteration?Methods inherited from class com.helger.web.scope.mock.WebScopeTestRule
createMockRequest, createMockServletContext, getContextPath, getRequest, getServletContext, getServletContextInitParameters, getServletPool, getSession, initListener, setContextPath, setServletContextInitParameters, toStringMethods inherited from class org.junit.rules.ExternalResource
apply
-
Constructor Details
-
PhotonAppWebTestRule
public PhotonAppWebTestRule()Ctor using the default storage path fromScopeTestRule -
PhotonAppWebTestRule
Ctor with an arbitrary path- Parameters:
aPath- The data AND servlet context path to be used. May not benull.- Since:
- 8.0.1
-
PhotonAppWebTestRule
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.web.scope.mock.WebScopeTestRule
-
after
public void after()- Overrides:
afterin classcom.helger.web.scope.mock.WebScopeTestRule
-