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.ExternalResourceATestRuleimplementingExternalResourcecreating and destroying aZatsEnvironment. Used withClassRuleit provides a pluggable alternative to separate static methods annotated withBeforeClassandAfterClassAlso see: dzone.com/articles/junit-49-class-and-suite-level-rules
-
-
Constructor Summary
Constructors Constructor Description AutoEnvironment(String resourceRoot)Creates a defaultDefaultZatsEnvironment()AutoEnvironment(String webInfPath, String resourceRoot)Creates aDefaultZatsEnvironment()with a specified WEB-INF folder
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidafter()AutoClientautoClient()creates anAutoClientrule from the currentAutoEnvironmentprotected voidbefore()ZatsEnvironmentgetZatsEnvironment()
-
-
-
Constructor Detail
-
AutoEnvironment
public AutoEnvironment(String resourceRoot)
Creates a defaultDefaultZatsEnvironment()- Parameters:
resourceRoot- - will be passed toZatsEnvironment.init(String)
-
AutoEnvironment
public AutoEnvironment(String webInfPath, String resourceRoot)
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 Detail
-
before
protected void before() throws Throwable- Overrides:
beforein classorg.junit.rules.ExternalResource- Throws:
Throwable
-
after
protected void after()
- Overrides:
afterin classorg.junit.rules.ExternalResource
-
autoClient
public AutoClient autoClient()
creates anAutoClientrule from the currentAutoEnvironment- Returns:
- an
AutoClientrule
-
getZatsEnvironment
public ZatsEnvironment getZatsEnvironment()
-
-