Search in sources :

Example 1 with LeafIterator

use of com.sun.tck.lib.tgf.LeafIterator in project jtharness by openjdk.

the class TestLeafIterator method zeroTwoDimArray.

@Test
public void zeroTwoDimArray() {
    LeafIterator iterator = new LeafIterator(new Object[][] {});
    Assert.assertFalse(iterator.hasNext());
}
Also used : LeafIterator(com.sun.tck.lib.tgf.LeafIterator) Test(org.junit.Test)

Example 2 with LeafIterator

use of com.sun.tck.lib.tgf.LeafIterator in project jtharness by openjdk.

the class TestLeafIterator method emptyIterator.

@Test
public void emptyIterator() {
    LeafIterator iterator = new LeafIterator();
    Assert.assertFalse(iterator.hasNext());
    try {
        iterator.next();
        Assert.fail("ArrayIndexOutOfBoundsException expected");
    } catch (ArrayIndexOutOfBoundsException e) {
    // OK, lets freeze this behavior for now
    }
}
Also used : LeafIterator(com.sun.tck.lib.tgf.LeafIterator) Test(org.junit.Test)

Example 3 with LeafIterator

use of com.sun.tck.lib.tgf.LeafIterator in project jtharness by openjdk.

the class TestLeafIterator method zeroDimArray.

@Test
public void zeroDimArray() {
    LeafIterator iterator = new LeafIterator(new Object[] {});
    Assert.assertFalse(iterator.hasNext());
    try {
        iterator.next();
        Assert.fail("ArrayIndexOutOfBoundsException expected");
    } catch (ArrayIndexOutOfBoundsException e) {
    // OK, lets freeze this behavior for now
    }
}
Also used : LeafIterator(com.sun.tck.lib.tgf.LeafIterator) Test(org.junit.Test)

Example 4 with LeafIterator

use of com.sun.tck.lib.tgf.LeafIterator 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());
}
Also used : TransformingIterator(com.sun.tck.lib.tgf.TransformingIterator) LeafIterator(com.sun.tck.lib.tgf.LeafIterator) Transform(com.sun.tck.lib.tgf.Transform) Test(org.junit.Test)

Aggregations

LeafIterator (com.sun.tck.lib.tgf.LeafIterator)4 Test (org.junit.Test)4 Transform (com.sun.tck.lib.tgf.Transform)1 TransformingIterator (com.sun.tck.lib.tgf.TransformingIterator)1