()
| 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 |
nothing calls this directly
no test coverage detected