Public Member Functions | |
CCNTestHelper (String testClassName) | |
Create a test helper for a named unit test class. | |
CCNTestHelper (ContentName externalPrefix, String testClassName) | |
CCNTestHelper (Class<?> unitTestClass) | |
Create a test helper for a specified unit test class. | |
CCNTestHelper (ContentName externalPrefix, Class<?> unitTestClass) | |
Create a test helper for a specified unit test class. | |
ContentName | getClassNamespace () |
Retrieve the timestamped, top-level name for data generated by this set of test cases. | |
ContentName | getClassChildName (String childName) |
Helper method to build child names for the class under test. | |
ContentName | getTestNamespace (String testName) |
Retrieve a name for data for a specific test. | |
ContentName | getTestChildName (String testName, String childName) |
Helper method to build child names for a specific test. | |
CCNTime | getTestTime () |
Get the timestamp used for this test run. | |
Protected Member Functions | |
ContentName | testPrefix () |
Static Protected Attributes | |
static final String | TEST_PREFIX_STRING = "/ccnx.org/test" |
static ContentName | TEST_PREFIX |
Static Package Functions | |
[static initializer] | |
Package Attributes | |
ContentName | _testNamespace |
String | _testName |
CCNTime | _testTime |
Given a unit test class named UnitTestClass, we name all the data generated by that test class as /ccnx.org/test/UnitTestClass-TIMESTAMP
for a unit test UnitTest in that class, ideally the data for that specific unit test will be stored under /ccnx.org/test/UnitTestClass-TIMESTAMP/UnitTest
To use, make a static CCNTestHelper in your test class, e.g.:
static CCNTestHelper testHelper = new CCNTestHelper(TestClass.class);
and then in a test called TestFoo, get the name prefix to use for generated data by:
ContentName dataPrefix = testHelper.getTestNamespace("TestFoo");
for data shared across tests, use the class-level name prefix:
ContentName sharedFileName = ContentName.fromNative(testHelper.getClassNamespace(), "shared_file.txt");
org.ccnx.ccn.test.CCNTestHelper.CCNTestHelper | ( | String | testClassName | ) |
org.ccnx.ccn.test.CCNTestHelper.CCNTestHelper | ( | Class<?> | unitTestClass | ) |
org.ccnx.ccn.test.CCNTestHelper.CCNTestHelper | ( | ContentName | externalPrefix, | |
Class<?> | unitTestClass | |||
) |
ContentName org.ccnx.ccn.test.CCNTestHelper.getClassNamespace | ( | ) |
Retrieve the timestamped, top-level name for data generated by this set of test cases.
ContentName org.ccnx.ccn.test.CCNTestHelper.getTestNamespace | ( | String | testName | ) |
CCNTime org.ccnx.ccn.test.CCNTestHelper.getTestTime | ( | ) |
Get the timestamp used for this test run.
All data is gathered under the same timestamp.