Package org.infinispan.commons.test
Class TestResourceTracker
java.lang.Object
org.infinispan.commons.test.TestResourceTracker
Keeps track of resources created by tests and cleans them up at the end of the test.
- Since:
- 7.0
- Author:
- Dan Berindei
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddResource(String testName, TestResourceTracker.Cleaner<?> cleaner) static voidaddResource(TestResourceTracker.Cleaner<?> cleaner) Add a resource to the current thread's running test.static voidcleanUpResources(String testName) static Stringstatic Stringstatic StringgetNameForIndex(int i) static Stringstatic Stringstatic voidsetThreadTestName(String testName) static voidsetThreadTestNameIfMissing(String testName) static voidtestFinished(String testName) Called on the "main" test thread, after any configuration method.static voidtestStarted(String testName) Called on the "main" test thread, before any configuration method.static voidtestThreadStarted(String testName) Should be called by the user on any "background" test thread that creates resources, e.g.
-
Constructor Details
-
TestResourceTracker
public TestResourceTracker()
-
-
Method Details
-
addResource
-
addResource
Add a resource to the current thread's running test. -
cleanUpResources
-
getCurrentTestShortName
-
getCurrentTestName
-
testStarted
Called on the "main" test thread, before any configuration method. -
testFinished
Called on the "main" test thread, after any configuration method. -
testThreadStarted
Should be called by the user on any "background" test thread that creates resources, e.g. at the beginning of a test with a@Test(timeout=n)annotation.- Parameters:
testName-
-
setThreadTestName
-
setThreadTestNameIfMissing
-
getNextNodeName
-
getNextTestThreadName
-
getNameForIndex
-