Package org.zkoss.zats.junit
Class AutoEnvironment
java.lang.Object
org.junit.rules.ExternalResource
org.zkoss.zats.junit.AutoEnvironment
- All Implemented Interfaces:
org.junit.rules.TestRule
public class AutoEnvironment
extends org.junit.rules.ExternalResource
A
TestRule implementing ExternalResource creating and destroying a ZatsEnvironment.
Used with ClassRule it provides a pluggable alternative to separate static methods annotated with BeforeClass and AfterClass
Also see: dzone.com/articles/junit-49-class-and-suite-level-rules-
Constructor Summary
ConstructorsConstructorDescriptionAutoEnvironment(String resourceRoot) Creates a defaultDefaultZatsEnvironment()AutoEnvironment(String webInfPath, String resourceRoot) Creates aDefaultZatsEnvironment()with a specified WEB-INF folder -
Method Summary
Modifier and TypeMethodDescriptionprotected voidafter()creates anAutoClientrule from the currentAutoEnvironmentprotected voidbefore()Methods inherited from class org.junit.rules.ExternalResource
apply
-
Constructor Details
-
AutoEnvironment
Creates a defaultDefaultZatsEnvironment()- Parameters:
resourceRoot- - will be passed toZatsEnvironment.init(String)
-
AutoEnvironment
Creates aDefaultZatsEnvironment()with a specified WEB-INF folder- Parameters:
webInfPath- - will be used as the constructor argument inDefaultZatsEnvironment(String)resourceRoot- - will be passed toZatsEnvironment.init(String)
-
-
Method Details
-
before
- Overrides:
beforein classorg.junit.rules.ExternalResource- Throws:
Throwable
-
after
protected void after()- Overrides:
afterin classorg.junit.rules.ExternalResource
-
autoClient
creates anAutoClientrule from the currentAutoEnvironment- Returns:
- an
AutoClientrule
-
getZatsEnvironment
-