use of android.icu.dev.test.TestDataModule.TestData in project j2objc by google.
the class DataDrivenFormatTest method formatTest.
/* (non-Javadoc)
* @see android.icu.dev.test.ModuleTest#processModules()
*/
@Test
@Parameters(method = "getTestData")
public void formatTest(TestDataPair pair) {
TestData td = pair.td;
DataMap settings = pair.dm;
String type = settings.getString("Type");
if (type.equals("date_format")) {
testConvertDate(td, settings, true);
} else if (type.equals("date_parse")) {
testConvertDate(td, settings, false);
} else {
errln("Unknown type: " + type);
}
}
use of android.icu.dev.test.TestDataModule.TestData in project j2objc by google.
the class ModuleTest method getTestData.
public static List<TestDataPair> getTestData(String moduleLocation, String moduleName) throws Exception {
List<TestDataPair> list = new ArrayList<TestDataPair>();
TestDataModule m = ModuleTest.loadTestData(moduleLocation, moduleName);
Iterator<TestData> tIter = m.getTestDataIterator();
while (tIter.hasNext()) {
TestData t = tIter.next();
for (Iterator siter = t.getSettingsIterator(); siter.hasNext(); ) {
DataMap settings = (DataMap) siter.next();
list.add(new TestDataPair(t, settings));
}
}
return list;
}
use of android.icu.dev.test.TestDataModule.TestData in project j2objc by google.
the class DataDrivenCalendarTest method calendarTest.
/* (non-Javadoc)
* @see android.icu.dev.test.ModuleTest#processModules()
*/
@Test
@Parameters(method = "getTestData")
public void calendarTest(TestDataPair pair) {
TestData td = pair.td;
DataMap settings = pair.dm;
String type = settings.getString("Type");
if (type.equals("convert_fwd")) {
testConvert(td, settings, true);
} else if (type.equals("convert_rev")) {
testConvert(td, settings, false);
} else if (type.equals("ops")) {
testOps(td, settings);
} else {
errln("Unknown type: " + type);
}
}
Aggregations