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

Method testClone

src/test/java/com/amazon/ion/LoaderTest.java:268–289  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

266
267
268 @Test
269 public void testClone()
270 throws Exception
271 {
272 IonDatagram contents = loadTestFile("good/one.ion");
273 IonValue one = contents.get(0);
274 assertEquals(contents, one.getContainer());
275
276 IonValue onePrime = system().clone(one);
277 assertNotSame(one, onePrime);
278 assertEquals(one, onePrime);
279 assertNull("cloned value has container", onePrime.getContainer());
280
281 IonList parent = system().newNullList();
282 parent.add(onePrime);
283 assertSame(parent, onePrime.getContainer());
284 checkInt(1, onePrime);
285
286 ((IonInt)one).setValue(2);
287 checkInt(2, one);
288 checkInt(1, onePrime);
289 }
290
291 // TODO move to ScannerTest
292 @Test

Callers

nothing calls this directly

Calls 10

getMethod · 0.95
getContainerMethod · 0.95
loadTestFileMethod · 0.80
cloneMethod · 0.65
newNullListMethod · 0.65
addMethod · 0.65
setValueMethod · 0.65
assertEqualsMethod · 0.45
systemMethod · 0.45
checkIntMethod · 0.45

Tested by

no test coverage detected