use of com.sun.tck.lib.tgf.Transform in project jtharness by openjdk.
the class TestTransformingIterator method testToString.
@Test
public void testToString() {
TransformingIterator iterator = new TransformingIterator(new LeafIterator(1, 2, 3), new Object() {
@Transform
int transform(int i) {
return i;
}
});
Assert.assertEquals("0", iterator.toString());
}
use of com.sun.tck.lib.tgf.Transform in project jtharness by openjdk.
the class Filters method test_5_firstOut_pseudoMultiply.
@Test
public void test_5_firstOut_pseudoMultiply() {
Values values = createColumn(0, 1, 2);
values = values.filter(new Object() {
@Transform
Integer filter(int i) {
return i != 0 ? i : null;
}
}).pseudoMultiply("a", "b", "c");
List<Object[]> expected = new ArrayList<Object[]>();
expected.add(new Object[] { 1, "a" });
expected.add(new Object[] { 2, "b" });
expected.add(new Object[] { 1, "c" });
ValuesComparison.compare(values, expected);
}
use of com.sun.tck.lib.tgf.Transform in project jtharness by openjdk.
the class Filters method test_5_lastTwoOut_unite.
@Test
public void test_5_lastTwoOut_unite() {
Values values = createColumn(0, 1, 2, 3, 4);
values = values.filter(new Object() {
@Transform
Integer filter(int i) {
return i < 2 ? i : null;
}
}).unite("a", "b", "c");
List<Object[]> expected = new ArrayList<Object[]>();
expected.add(new Object[] { 0 });
expected.add(new Object[] { 1 });
expected.add(new Object[] { "a" });
expected.add(new Object[] { "b" });
expected.add(new Object[] { "c" });
ValuesComparison.compare(values, expected);
}
use of com.sun.tck.lib.tgf.Transform in project jtharness by openjdk.
the class Filters method test_5_thirdOut_unite.
@Test
public void test_5_thirdOut_unite() {
Values values = createColumn(0, 1, 2);
values = values.filter(new Object() {
@Transform
Integer filter(int i) {
return i != 2 ? i : null;
}
}).unite("a", "b", "c");
List<Object[]> expected = new ArrayList<Object[]>();
expected.add(new Object[] { 0 });
expected.add(new Object[] { 1 });
expected.add(new Object[] { "a" });
expected.add(new Object[] { "b" });
expected.add(new Object[] { "c" });
ValuesComparison.compare(values, expected);
}
use of com.sun.tck.lib.tgf.Transform in project jtharness by openjdk.
the class Filters method test_4.
@Test
public void test_4() {
Values values_2 = createColumn(1, 2).filter(new Object() {
@Transform
Values filter(int i) {
return createValues(new Object[][] { { i, i + 1 }, { i + 2, i + 3 } });
}
});
Values values_1 = createColumn(3, 4);
Values result = values_1.multiply(values_2);
List<Object[]> expected = new ArrayList<Object[]>();
expected.add(new Object[] { 3, 1, 2 });
expected.add(new Object[] { 3, 3, 4 });
expected.add(new Object[] { 3, 2, 3 });
expected.add(new Object[] { 3, 4, 5 });
expected.add(new Object[] { 4, 1, 2 });
expected.add(new Object[] { 4, 3, 4 });
expected.add(new Object[] { 4, 2, 3 });
expected.add(new Object[] { 4, 4, 5 });
ValuesComparison.compare(result, expected);
}
Aggregations