MCPcopy Create free account
hub / github.com/amazon-ion/ion-java / testListParsing

Method testListParsing

src/test/java/com/amazon/ion/ListTest.java:129–153  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

127
128
129 @Test
130 public void testListParsing()
131 {
132 IonValue nine = oneValue("9");
133 IonValue four = oneValue("4");
134
135 IonList value = (IonList) oneValue("[9,4]");
136 assertEquals(2, value.size());
137 assertEquals(nine, value.get(0));
138 assertEquals(four, value.get(1));
139
140 try
141 {
142 value.get(2);
143 fail("Expected IndexOutOfBoundsException");
144 }
145 catch (IndexOutOfBoundsException e) { }
146
147 Iterator<IonValue> i = value.iterator();
148 assertTrue(i.hasNext());
149 assertEquals(nine, i.next());
150 assertTrue(i.hasNext());
151 assertEquals(four, i.next());
152 assertFalse(i.hasNext());
153 }
154
155
156 @Test

Callers

nothing calls this directly

Calls 8

failMethod · 0.80
sizeMethod · 0.65
getMethod · 0.65
iteratorMethod · 0.65
hasNextMethod · 0.65
nextMethod · 0.65
oneValueMethod · 0.45
assertEqualsMethod · 0.45

Tested by

no test coverage detected