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

Method testReadOnlyInt

src/test/java/com/amazon/ion/IntTest.java:261–288  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

259
260
261 @Test
262 public void testReadOnlyInt()
263 {
264 IonInt v = system().newInt(1);
265 v.makeReadOnly();
266 assertEquals(1, v.intValue());
267
268 try {
269 v.setValue(2);
270 fail("Expected exception for modifying read-only value");
271 }
272 catch (ReadOnlyValueException e) { }
273 assertEquals(1, v.intValue());
274
275 try {
276 v.setValue(2L);
277 fail("Expected exception for modifying read-only value");
278 }
279 catch (ReadOnlyValueException e) { }
280 assertEquals(1, v.intValue());
281
282 try {
283 v.setValue(Long.valueOf(2));
284 fail("Expected exception for modifying read-only value");
285 }
286 catch (ReadOnlyValueException e) { }
287 assertEquals(1, v.intValue());
288 }
289
290 @Test
291 public void testBinaryInt()

Callers

nothing calls this directly

Calls 8

intValueMethod · 0.95
setValueMethod · 0.95
failMethod · 0.80
newIntMethod · 0.65
makeReadOnlyMethod · 0.65
systemMethod · 0.45
assertEqualsMethod · 0.45
valueOfMethod · 0.45

Tested by

no test coverage detected