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