Class TestResource<T>
java.lang.Object
com.atlassian.confluence.util.test.rules.TestResource<T>
- Type Parameters:
T
- the type of the resource to load
- All Implemented Interfaces:
org.junit.rules.TestRule
- Direct Known Subclasses:
XmlResource
@Deprecated
public abstract class TestResource<T>
extends Object
implements org.junit.rules.TestRule
Deprecated.
since 7.20 no replacement
Load a resource via the defining ClassLoader of the given test class.
By default, a resource is located relative to the class, meaning it has to reside in the same folder.
- Since:
- 5.4
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal org.junit.runners.model.Statement
apply
(org.junit.runners.model.Statement statement, org.junit.runner.Description description) Deprecated.get()
Deprecated.protected abstract T
load
(InputStream testResourceStream) Deprecated.protected String
toFileName
(String testMethodName) Deprecated.Composes the file name of the resource based upon a hyphenated version of the test class and method name and the given name suffix.protected String
toRelativePathFromClassLoaderRoot
(Method testMethod) Deprecated.
-
Field Details
-
nameSuffix
Deprecated. -
testClass
Deprecated.
-
-
Constructor Details
-
TestResource
Deprecated.- Parameters:
testClass
- the class of the test the rule is used fornameSuffix
- the file name is composed of the hyphenated method name and the given suffix
-
-
Method Details
-
apply
public final org.junit.runners.model.Statement apply(org.junit.runners.model.Statement statement, org.junit.runner.Description description) Deprecated.- Specified by:
apply
in interfaceorg.junit.rules.TestRule
-
load
Deprecated. -
toRelativePathFromClassLoaderRoot
Deprecated. -
toFileName
Deprecated.Composes the file name of the resource based upon a hyphenated version of the test class and method name and the given name suffix.Example:
public class VersionedTemplateTest { @literal @Rule public XmlResource source = new XmlResource(VersionedTemplateTest.class, "source.xml"); @literal @Rule public XmlResource expected = new XmlResource(VersionedTemplateTest.class, "expected.xml"); @literal @Test public void multipleVersionGroups() { // do something with the loaded documents } }
versioned-template-test-multiple-version-groups-source.xml
andversioned-template-test-multiple-version-groups-expected.xml
. -
get
Deprecated.
-