| java.lang.Object com.ibm.icu.dev.test.ResourceModule
ResourceModule | class ResourceModule implements TestDataModule(Code) | | Represents a collection of test data described in a UResourceBoundle file.
The root of the UResourceBoundle file is a table resource, and it has one
Info and one TestData sub-resources. The Info describes the data module
itself. The TestData, which is a table resource, has a collection of test
data.
The test data is a named table resource which has Info, Settings, Headers,
and Cases sub-resources.
DataModule:table(nofallback){
Info:table {}
TestData:table {
entry_name:table{
Info:table{}
Settings:array{}
Headers:array{}
Cases:array{}
}
}
}
The test data is expected to be fed to test code by following sequence
for each setting in Setting{
prepare the setting
for each test data in Cases{
perform the test
}
}
For detail of the specification, please refer to the code. The code is
initially ported from "icu4c/source/tools/ctestfw/unicode/tstdtmod.h"
and should be maintained parallelly.
author: Raymond Yang |
ResourceModule | ResourceModule(String baseName, String localeName) throws DataModuleFormatError(Code) | | |
assert_is | static void assert_is(boolean eq, String msg)(Code) | | Avoid use Java 1.4 language new assert keyword
|
assert_is | static void assert_is(boolean eq)(Code) | | |
assert_not | static void assert_not(boolean eq, String msg)(Code) | | |
assert_not | static void assert_not(boolean eq)(Code) | | |
getFromTable | static ICUResourceBundle getFromTable(ICUResourceBundle res, String key, int expResType) throws DataModuleFormatError(Code) | | Internal helper function to get resource with following add-on
1. Assert the returned resource is never null.
2. Check the type of resource.
The UResourceTypeMismatchException for various get() method is a
RuntimeException which can be silently bypassed. This behavior is a
trouble. One purpose of the class is to enforce format checking for
resource file. We don't want to the exceptions are silently bypassed
and spreaded to our customer's code.
Notice, the MissingResourceException for get() method is also a
RuntimeException. The caller functions should avoid sepread the execption
silently also. The behavior is modified because some resource are
optional and can be missed.
|
getInfo | public DataMap getInfo()(Code) | | |
getStringArrayHelper | static String[] getStringArrayHelper(ICUResourceBundle res, String key) throws DataModuleFormatError(Code) | | Unfortunately, ICUResourceBundle is unable to treat one string as string array.
This function return a String[] from ICUResourceBundle, regardless it is an array or a string
|
getTestData | public TestData getTestData(String testName) throws DataModuleFormatError(Code) | | |
|
|