use of com.oracle.tck.lib.autd2.unittests.BaseTestGroup in project jtharness by openjdk.
the class MyTest method testRun_DataFilteredOutCompletely2.
@Test
public void testRun_DataFilteredOutCompletely2() {
final ArrayList<String> arrayList = new ArrayList<String>();
com.oracle.tck.lib.autd2.TestResult status = com.oracle.tck.lib.autd2.unittests.TU.runTestGroup(new BaseTestGroup() {
Values setupOne() {
return createColumn(1, 2).filter(new Object() {
@Transform
String filterOut(int i) {
return null;
}
});
}
@TestCase
@TestData("setupOne")
public void myTest(String s) {
arrayList.add(s);
}
}, TU.EMPTY_ARGV);
Assert.assertEquals(0, arrayList.size());
Assert.assertTrue(status.isOK());
Assert.assertEquals("Passed. test cases: 1; all passed", status.toString());
}
use of com.oracle.tck.lib.autd2.unittests.BaseTestGroup in project jtharness by openjdk.
the class MyTest method testRun_Data_partlyFilteredInTheEnd_safetyFilter.
@Test
public void testRun_Data_partlyFilteredInTheEnd_safetyFilter() {
final ArrayList<String> arrayList = new ArrayList<String>();
com.oracle.tck.lib.autd2.TestResult status = com.oracle.tck.lib.autd2.unittests.TU.runTestGroup(new BaseTestGroup() {
Values setupOne() {
return createColumn(1, 2).filter(new Object() {
@Transform
String filterOut(int i) {
return "a";
}
}).multiply(createColumn("a", "b", "d").filter(new Object() {
@Transform
String end(String s) {
return null;
}
})).filter(new Object() {
// if data construction failed, this prefents test failing
// instead of it test is skipped
@Transform
Values safetyFilter(Object... args) {
if (args.length != 2) {
// just skipping
return null;
}
String s1 = (String) args[0], s2 = (String) args[1];
return createRow(s1, s2);
}
});
}
@TestCase
@TestData("setupOne")
public void myTest(String s1, String s2) {
arrayList.add(s1);
}
}, TU.EMPTY_ARGV);
Assert.assertEquals(0, arrayList.size());
Assert.assertTrue(status.isOK());
Assert.assertEquals("Passed. test cases: 1; all passed", status.toString());
}
use of com.oracle.tck.lib.autd2.unittests.BaseTestGroup in project jtharness by openjdk.
the class MyTest method testRun_DataOK_safetyFilterAtTheEnd.
@Test
public void testRun_DataOK_safetyFilterAtTheEnd() {
final ArrayList<String> arrayList = new ArrayList<String>();
com.oracle.tck.lib.autd2.TestResult status = com.oracle.tck.lib.autd2.unittests.TU.runTestGroup(new BaseTestGroup() {
Values setupOne() {
return createColumn(1, 2).filter(new Object() {
@Transform
String filterOut(int i) {
return "a";
}
}).multiply(createColumn("a", "b", "d").filter(new Object() {
@Transform
String end(String s) {
return s;
}
})).filter(new Object() {
// if data construction failed, this prefents test failing
// instead of it test is skipped
@Transform
Values safetyFilter(String s1, String s2) {
return createRow(s1, s2);
}
});
}
@TestCase
@TestData("setupOne")
public void myTest(String s1, String s2) {
arrayList.add(s1);
}
}, TU.EMPTY_ARGV);
Assert.assertEquals(6, arrayList.size());
Assert.assertTrue(status.isOK());
Assert.assertEquals("Passed. test cases: 1; all passed", status.toString());
}
use of com.oracle.tck.lib.autd2.unittests.BaseTestGroup in project jtharness by openjdk.
the class MyTest method testRun_DataFilteredOutCompletely3.
@Test
public void testRun_DataFilteredOutCompletely3() {
final ArrayList<String> arrayList = new ArrayList<String>();
com.oracle.tck.lib.autd2.TestResult status = com.oracle.tck.lib.autd2.unittests.TU.runTestGroup(new BaseTestGroup() {
Values setupOne() {
return createColumn(1, 2).filter(new Object() {
@Transform
String filterOut(int i) {
return null;
}
}).multiply(1, 2, 3);
}
@TestCase
@TestData("setupOne")
public void myTest(String s) {
arrayList.add(s);
}
}, TU.EMPTY_ARGV);
Assert.assertEquals(0, arrayList.size());
Assert.assertTrue(status.isOK());
Assert.assertEquals("Passed. test cases: 1; all passed", status.toString());
}
use of com.oracle.tck.lib.autd2.unittests.BaseTestGroup in project jtharness by openjdk.
the class Multiply method testRun_DataFilteredOutCompletely4.
@Test
public void testRun_DataFilteredOutCompletely4() {
final ArrayList<String> arrayList = new ArrayList<String>();
com.oracle.tck.lib.autd2.TestResult status = com.oracle.tck.lib.autd2.unittests.TU.runTestGroup(new BaseTestGroup() {
Values setupOne() {
return DataFactory.createColumn().multiply(1, 2, 3);
}
@TestCase
@TestData("setupOne")
public void myTest(String s) {
arrayList.add(s);
}
}, TU.EMPTY_ARGV);
Assert.assertEquals(0, arrayList.size());
Assert.assertTrue(status.isOK());
Assert.assertEquals("Passed. test cases: 1; all passed", status.toString());
}
Aggregations