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

Method testPutAll

src/test/java/com/amazon/ion/StructTest.java:387–416  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

385 }
386
387 @Test
388 public void testPutAll()
389 {
390 IonStruct value = struct("{}");
391 HashMap<String,IonValue> m = new HashMap<String,IonValue>();
392 m.put("a", system().newInt(1));
393 m.put("b", system().newInt(2));
394
395 value.putAll(m);
396 assertEquals(2, value.size());
397 assertSame(m.get("a"), value.get("a"));
398 assertSame(m.get("b"), value.get("b"));
399
400 try {
401 value.putAll(m);
402 fail("expected exception");
403 }
404 catch (ContainedValueException e) { }
405
406 try {
407 value.putAll(null);
408 fail("expected exception");
409 }
410 catch (NullPointerException e) { }
411
412 m.clear();
413 m.put("a", null);
414 value.putAll(m);
415 assertEquals(null, value.get("a"));
416 }
417
418
419 @Test

Callers

nothing calls this directly

Calls 10

putAllMethod · 0.95
sizeMethod · 0.95
getMethod · 0.95
structMethod · 0.80
failMethod · 0.80
putMethod · 0.65
newIntMethod · 0.65
clearMethod · 0.65
systemMethod · 0.45
assertEqualsMethod · 0.45

Tested by

no test coverage detected