public class ConfigureJohnson
extends org.junit.rules.ExternalResource
TestRule
that configures the Johnson framework before the test and tears it down
afterwards. You would typically configure it to run before and after your test class, as follows:
@ClassRule public static final TestRule johnsonRule = ConfigureJohnson.withDefaultConfiguration();Or if you want to run it before and after each test method, do this:
@Rule public final TestRule johnsonRule = ConfigureJohnson.withDefaultConfiguration();
Modifier and Type | Method and Description |
---|---|
protected void |
after() |
protected void |
before() |
static org.junit.rules.TestRule |
withConfiguration(String location)
Creates an instance of this rule in which Johnson uses the given configuration file.
|
static org.junit.rules.TestRule |
withDefaultConfiguration()
Creates an instance of this rule in which Johnson uses the default configuration file, namely
"johnson-config.xml" . |
@Nonnull public static org.junit.rules.TestRule withDefaultConfiguration()
"johnson-config.xml"
.Johnson.initialize(String)
@Nonnull public static org.junit.rules.TestRule withConfiguration(@Nonnull String location)
location
- the location of the Johnson configurationJohnson.initialize(String)
protected void before() throws Throwable
before
in class org.junit.rules.ExternalResource
Throwable
protected void after()
after
in class org.junit.rules.ExternalResource
Copyright © 2002-2018 Atlassian. All Rights Reserved.