| 1 23 24 package org.objectweb.jorm.runtime.basictype; 25 26 import org.objectweb.jorm.runtime.TestRuntimeHelper; 27 import org.objectweb.jorm.type.api.PTypeSpace; 28 import org.objectweb.jorm.api.PClassMapping; 29 import org.objectweb.jorm.api.PException; 30 import org.objectweb.jorm.facility.naming.basidir.BasidBinder; 31 import org.objectweb.jorm.naming.api.PBinder; 32 33 import java.util.Date ; 34 import java.math.BigDecimal ; 35 import java.math.BigInteger ; 36 37 40 public class TestBasicType extends TestRuntimeHelper { 41 private final static String LOGGER_NAME 42 = "test.org.objectweb.jorm.basictype"; 43 44 public TestBasicType(String name) throws Exception { 45 super(name); 46 } 47 48 protected String getLoggerName() { 49 return LOGGER_NAME; 50 } 51 52 protected PBinder getBinder(String className) throws Exception { 53 try { 54 return new BasidBinder(mapper, 55 "org.objectweb.jorm.runtime.basictype.TestBasicType", 56 PClassMapping.CLEANUP_REMOVEALL); 57 } catch (PException e) { 58 Exception current = e; 59 while (current instanceof PException 60 && ((PException) current).getNestedException() != null) { 61 current = ((PException) current).getNestedException(); 62 } 63 throw current; 64 } 65 } 66 67 69 private final static String CNBOOLEAN = "org.objectweb.jorm.pobject.basictype.Boolean"; 71 72 public void testBooleanTrue() throws Exception { 73 changeLogger(LOGGER_NAME + ".boolean"); 74 BasicTypeAccessor acc1 = new BasicTypeAccessor(true); 75 BasicTypeAccessor acc2 = new BasicTypeAccessor(false); 76 if (performIO(CNBOOLEAN, acc1, acc2)) { 77 assertEquals("Cannot read written boolean value", 78 true, acc2.paGetBooleanValue()); 79 } 80 } 81 82 public void testBooleanFalse() throws Exception { 83 changeLogger(LOGGER_NAME + ".boolean"); 84 BasicTypeAccessor acc1 = new BasicTypeAccessor(false); 85 BasicTypeAccessor acc2 = new BasicTypeAccessor(true); 86 if (performIO(CNBOOLEAN, acc1, acc2)) { 87 assertEquals("Cannot read written boolean value", 88 false, acc2.paGetBooleanValue()); 89 } 90 } 91 92 public void testBooleanGen() throws Exception { 93 changeLogger(LOGGER_NAME + ".boolean"); 94 GenericAccessor acc1 = new GenericAccessor( 95 PTypeSpace.BOOLEAN, "booleanValue", Boolean.TRUE); 96 GenericAccessor acc2 = new GenericAccessor( 97 PTypeSpace.BOOLEAN, "booleanValue"); 98 if (performIO(CNBOOLEAN, acc1, acc2)) { 99 assertEquals("Cannot read written boolean value", 100 true, acc2.paGetBooleanField("booleanValue")); 101 } 102 } 103 104 private final static String CNOBOOLEAN = "org.objectweb.jorm.pobject.basictype.Oboolean"; 106 107 public void testObooleanNull() throws Exception { 108 changeLogger(LOGGER_NAME + ".boolean"); 109 BasicTypeAccessor acc1 = new BasicTypeAccessor(null); 110 BasicTypeAccessor acc2 = new BasicTypeAccessor(new Boolean (false)); 111 if (performIO(CNOBOOLEAN, acc1, acc2)) { 112 assertEquals("Cannot read written boolean value", 113 null, acc2.paGetObooleanValue()); 114 } 115 } 116 117 public void testObooleanTrue() throws Exception { 118 changeLogger(LOGGER_NAME + ".boolean"); 119 BasicTypeAccessor acc1 = new BasicTypeAccessor(new Boolean (true)); 120 BasicTypeAccessor acc2 = new BasicTypeAccessor(new Boolean (false)); 121 if (performIO(CNOBOOLEAN, acc1, acc2)) { 122 assertEquals("Cannot read written boolean value", 123 true, acc2.paGetObooleanValue().booleanValue()); 124 } 125 } 126 127 public void testObooleanFalse() throws Exception { 128 changeLogger(LOGGER_NAME + ".boolean"); 129 BasicTypeAccessor acc1 = new BasicTypeAccessor(new Boolean (false)); 130 BasicTypeAccessor acc2 = new BasicTypeAccessor(new Boolean (true)); 131 if (performIO(CNOBOOLEAN, acc1, acc2)) { 132 assertEquals("Cannot read written boolean value", 133 false, acc2.paGetObooleanValue().booleanValue()); 134 } 135 } 136 137 public void test0booleanGen() throws Exception { 138 changeLogger(LOGGER_NAME + ".boolean"); 139 GenericAccessor acc1 = new GenericAccessor( 140 PTypeSpace.OBJBOOLEAN, "obooleanValue", Boolean.TRUE); 141 GenericAccessor acc2 = new GenericAccessor( 142 PTypeSpace.OBJBOOLEAN, "obooleanValue"); 143 if (performIO(CNOBOOLEAN, acc1, acc2)) { 144 assertEquals("Cannot read written boolean value", 145 Boolean.TRUE, acc2.paGetObooleanField("obooleanValue")); 146 } 147 } 148 149 private final static String CNBYTE = "org.objectweb.jorm.pobject.basictype.Byte"; 151 152 public void testByte0() throws Exception { 153 changeLogger(LOGGER_NAME + ".byte"); 154 BasicTypeAccessor acc1 = new BasicTypeAccessor((byte) 0); 155 BasicTypeAccessor acc2 = new BasicTypeAccessor((byte) -1); 156 if (performIO(CNBYTE, acc1, acc2)) { 157 assertEquals("Cannot read written byte value", 158 (byte) 0, acc2.paGetByteValue()); 159 } 160 } 161 162 public void testByteMin() throws Exception { 163 changeLogger(LOGGER_NAME + ".byte"); 164 BasicTypeAccessor acc1 = new BasicTypeAccessor(Byte.MIN_VALUE); 165 BasicTypeAccessor acc2 = new BasicTypeAccessor((byte) 0); 166 if (performIO(CNBYTE, acc1, acc2)) { 167 assertEquals("Cannot read written byte value", 168 Byte.MIN_VALUE, acc2.paGetByteValue()); 169 } 170 } 171 172 public void testByteMax() throws Exception { 173 changeLogger(LOGGER_NAME + ".byte"); 174 BasicTypeAccessor acc1 = new BasicTypeAccessor(Byte.MAX_VALUE); 175 BasicTypeAccessor acc2 = new BasicTypeAccessor((byte) 0); 176 if (performIO(CNBYTE, acc1, acc2)) { 177 assertEquals("Cannot read written byte value", 178 Byte.MAX_VALUE, acc2.paGetByteValue()); 179 } 180 } 181 public void testByteGen() throws Exception { 182 changeLogger(LOGGER_NAME + ".byte"); 183 GenericAccessor acc1 = new GenericAccessor( 184 PTypeSpace.BYTE, "byteValue", new Byte ((byte)34)); 185 GenericAccessor acc2 = new GenericAccessor( 186 PTypeSpace.BYTE, "byteValue"); 187 if (performIO(CNBYTE, acc1, acc2)) { 188 assertEquals("Cannot read written byte value", 189 (byte)34, acc2.paGetByteField("byteValue")); 190 } 191 } 192 193 195 private final static String CNOBYTE = "org.objectweb.jorm.pobject.basictype.Obyte"; 197 198 public void testObyteNull() throws Exception { 199 changeLogger(LOGGER_NAME + ".byte"); 200 BasicTypeAccessor acc1 = new BasicTypeAccessor(null); 201 BasicTypeAccessor acc2 = new BasicTypeAccessor(new Byte ((byte) -1)); 202 if (performIO(CNOBYTE, acc1, acc2)) { 203 assertEquals("Cannot read written Byte value", 204 null, acc2.paGetObyteValue()); 205 } 206 } 207 208 public void testObyte0() throws Exception { 209 changeLogger(LOGGER_NAME + ".byte"); 210 BasicTypeAccessor acc1 = new BasicTypeAccessor(new Byte ((byte) 0)); 211 BasicTypeAccessor acc2 = new BasicTypeAccessor(null); 212 if (performIO(CNOBYTE, acc1, acc2)) { 213 assertEquals("Cannot read written Byte value", 214 (byte) 0, acc2.paGetObyteValue().byteValue()); 215 } 216 } 217 218 public void testObyteMin() throws Exception { 219 changeLogger(LOGGER_NAME + ".byte"); 220 BasicTypeAccessor acc1 = new BasicTypeAccessor(new Byte (Byte.MIN_VALUE)); 221 BasicTypeAccessor acc2 = new BasicTypeAccessor(null); 222 if (performIO(CNOBYTE, acc1, acc2)) { 223 assertEquals("Cannot read written Byte value", 224 Byte.MIN_VALUE, acc2.paGetObyteValue().byteValue()); 225 } 226 } 227 228 public void testObyteMax() throws Exception { 229 changeLogger(LOGGER_NAME + ".byte"); 230 BasicTypeAccessor acc1 = new BasicTypeAccessor(new Byte (Byte.MAX_VALUE)); 231 BasicTypeAccessor acc2 = new BasicTypeAccessor(null); 232 if (performIO(CNOBYTE, acc1, acc2)) { 233 assertEquals("Cannot read written Byte value", 234 Byte.MAX_VALUE, acc2.paGetObyteValue().byteValue()); 235 } 236 } 237 238 public void testObyteGen() throws Exception { 239 changeLogger(LOGGER_NAME + ".byte"); 240 GenericAccessor acc1 = new GenericAccessor( 241 PTypeSpace.OBJBYTE, "obyteValue", new Byte ((byte)34)); 242 GenericAccessor acc2 = new GenericAccessor( 243 PTypeSpace.OBJBYTE, "obyteValue"); 244 if (performIO(CNOBYTE, acc1, acc2)) { 245 assertEquals("Cannot read written byte value", 246 new Byte ((byte)34), acc2.paGetObyteField("obyteValue")); 247 } 248 } 249 250 private final static String CNCHAR = "org.objectweb.jorm.pobject.basictype.Char"; 252 253 public void testCharSP() throws Exception { 254 changeLogger(LOGGER_NAME + ".char"); 255 BasicTypeAccessor acc1 = new BasicTypeAccessor(' '); 256 BasicTypeAccessor acc2 = new BasicTypeAccessor('.'); 257 if (performIO(CNCHAR, acc1, acc2)) { 258 assertEquals("Cannot read written char value", 259 ' ', acc2.paGetCharValue()); 260 } 261 } 262 263 public void testCharDOT() throws Exception { 264 changeLogger(LOGGER_NAME + ".char"); 265 BasicTypeAccessor acc1 = new BasicTypeAccessor('.'); 266 BasicTypeAccessor acc2 = new BasicTypeAccessor(' '); 267 if (performIO(CNCHAR, acc1, acc2)) { 268 assertEquals("Cannot read written char value", 269 '.', acc2.paGetCharValue()); 270 } 271 } 272 public void testCharGen() throws Exception { 273 changeLogger(LOGGER_NAME + ".char"); 274 GenericAccessor acc1 = new GenericAccessor( 275 PTypeSpace.CHAR, "charValue", new Character ('a')); 276 GenericAccessor acc2 = new GenericAccessor( 277 PTypeSpace.CHAR, "charValue"); 278 if (performIO(CNCHAR, acc1, acc2)) { 279 assertEquals("Cannot read written char value", 280 'a', acc2.paGetCharField("charValue")); 281 } 282 } 283 284 private final static String CNOCHAR = "org.objectweb.jorm.pobject.basictype.Ochar"; 286 287 public void testOcharNull() throws Exception { 288 changeLogger(LOGGER_NAME + ".char"); 289 BasicTypeAccessor acc1 = new BasicTypeAccessor(null); 290 BasicTypeAccessor acc2 = new BasicTypeAccessor(new Character (' ')); 291 if (performIO(CNOCHAR, acc1, acc2)) { 292 assertEquals("Cannot read written Char value", 293 null, acc2.paGetOcharValue()); 294 } 295 } 296 297 public void testOcharSP() throws Exception { 298 changeLogger(LOGGER_NAME + ".char"); 299 BasicTypeAccessor acc1 = new BasicTypeAccessor(new Character (' ')); 300 BasicTypeAccessor acc2 = new BasicTypeAccessor(null); 301 if (performIO(CNOCHAR, acc1, acc2)) { 302 assertEquals("Cannot read written Char value", 303 ' ', acc2.paGetOcharValue().charValue()); 304 } 305 } 306 307 public void testOcharDOT() throws Exception { 308 changeLogger(LOGGER_NAME + ".char"); 309 BasicTypeAccessor acc1 = new BasicTypeAccessor(new Character ('.')); 310 BasicTypeAccessor acc2 = new BasicTypeAccessor(null); 311 if (performIO(CNOCHAR, acc1, acc2)) { 312 assertEquals("Cannot read written Char value", 313 '.', acc2.paGetOcharValue().charValue()); 314 } 315 } 316 public void testOcharGen() throws Exception { 317 changeLogger(LOGGER_NAME + ".char"); 318 GenericAccessor acc1 = new GenericAccessor( 319 PTypeSpace.OBJCHAR, "ocharValue", new Character ('a')); 320 GenericAccessor acc2 = new GenericAccessor( 321 PTypeSpace.OBJCHAR, "ocharValue"); 322 if (performIO(CNOCHAR, acc1, acc2)) { 323 assertEquals("Cannot read written char value", 324 new Character ('a'), acc2.paGetOcharField("ocharValue")); 325 } 326 } 327 328 private final static String CNSHORT = "org.objectweb.jorm.pobject.basictype.Short"; 330 331 public void testShort0() throws Exception { 332 changeLogger(LOGGER_NAME + ".short"); 333 BasicTypeAccessor acc1 = new BasicTypeAccessor((short) 0); 334 BasicTypeAccessor acc2 = new BasicTypeAccessor((short) -1); 335 if (performIO(CNSHORT, acc1, acc2)) { 336 assertEquals("Cannot read written short value", 337 (short) 0, acc2.paGetShortValue()); 338 } 339 } 340 341 public void testShortMin() throws Exception { 342 changeLogger(LOGGER_NAME + ".short"); 343 BasicTypeAccessor acc1 = new BasicTypeAccessor(Short.MIN_VALUE); 344 BasicTypeAccessor acc2 = new BasicTypeAccessor((short) 0); 345 if (performIO(CNSHORT, acc1, acc2)) { 346 assertEquals("Cannot read written short value", 347 Short.MIN_VALUE, acc2.paGetShortValue()); 348 } 349 } 350 351 public void testShortMax() throws Exception { 352 changeLogger(LOGGER_NAME + ".short"); 353 BasicTypeAccessor acc1 = new BasicTypeAccessor(Short.MAX_VALUE); 354 BasicTypeAccessor acc2 = new BasicTypeAccessor((short) 0); 355 if (performIO(CNSHORT, acc1, acc2)) { 356 assertEquals("Cannot read written short value", 357 Short.MAX_VALUE, acc2.paGetShortValue()); 358 } 359 } 360 public void testShortGen() throws Exception { 361 changeLogger(LOGGER_NAME + ".short"); 362 GenericAccessor acc1 = new GenericAccessor( 363 PTypeSpace.SHORT, "shortValue", new Short ((short) 2)); 364 GenericAccessor acc2 = new GenericAccessor( 365 PTypeSpace.SHORT, "shortValue"); 366 if (performIO(CNSHORT, acc1, acc2)) { 367 assertEquals("Cannot read written short value", 368 (short) 2, acc2.paGetShortField("shortValue")); 369 } 370 } 371 372 private final static String CNOSHORT = "org.objectweb.jorm.pobject.basictype.Oshort"; 374 375 public void testOshortNull() throws Exception { 376 changeLogger(LOGGER_NAME + ".short"); 377 BasicTypeAccessor acc1 = new BasicTypeAccessor(null); 378 BasicTypeAccessor acc2 = new BasicTypeAccessor(new Short ((short) 0)); 379 if (performIO(CNOSHORT, acc1, acc2)) { 380 assertEquals("Cannot read written short value", 381 null, acc2.paGetOshortValue()); 382 } 383 } 384 385 public void testOshort0() throws Exception { 386 changeLogger(LOGGER_NAME + ".short"); 387 BasicTypeAccessor acc1 = new BasicTypeAccessor(new Short ((short) 0)); 388 BasicTypeAccessor acc2 = new BasicTypeAccessor(null); 389 if (performIO(CNOSHORT, acc1, acc2)) { 390 assertEquals("Cannot read written short value", 391 (short) 0, acc2.paGetOshortValue().shortValue()); 392 } 393 } 394 395 public void testOshortMin() throws Exception { 396 changeLogger(LOGGER_NAME + ".short"); 397 BasicTypeAccessor acc1 = new BasicTypeAccessor(new Short (Short.MIN_VALUE)); 398 BasicTypeAccessor acc2 = new BasicTypeAccessor(null); 399 if (performIO(CNOSHORT, acc1, acc2)) { 400 assertEquals("Cannot read written short value", 401 Short.MIN_VALUE, acc2.paGetOshortValue().shortValue()); 402 } 403 } 404 405 public void testOshortMax() throws Exception { 406 changeLogger(LOGGER_NAME + ".short"); 407 BasicTypeAccessor acc1 = new BasicTypeAccessor(new Short (Short.MAX_VALUE)); 408 BasicTypeAccessor acc2 = new BasicTypeAccessor(null); 409 if (performIO(CNOSHORT, acc1, acc2)) { 410 assertEquals("Cannot read written short value", 411 Short.MAX_VALUE, acc2.paGetOshortValue().shortValue()); 412 } 413 } 414 public void testOshortGen() throws Exception { 415 changeLogger(LOGGER_NAME + ".short"); 416 GenericAccessor acc1 = new GenericAccessor( 417 PTypeSpace.OBJSHORT, "oshortValue", new Short ((short) 2)); 418 GenericAccessor acc2 = new GenericAccessor( 419 PTypeSpace.OBJSHORT, "oshortValue"); 420 if (performIO(CNOSHORT, acc1, acc2)) { 421 assertEquals("Cannot read written short value", 422 new Short ((short) 2), acc2.paGetOshortField("oshortValue")); 423 } 424 } 425 426 private final static String CNINT = "org.objectweb.jorm.pobject.basictype.Int"; 428 429 public void testInt0() throws Exception { 430 changeLogger(LOGGER_NAME + ".int"); 431 BasicTypeAccessor acc1 = new BasicTypeAccessor(0); 432 BasicTypeAccessor acc2 = new BasicTypeAccessor(-1); 433 if (performIO(CNINT, acc1, acc2)) { 434 assertEquals("Cannot read written int value", 435 0, acc2.paGetIntValue()); 436 } 437 } 438 439 public void testIntMin() throws Exception { 440 changeLogger(LOGGER_NAME + ".int"); 441 BasicTypeAccessor acc1 = new BasicTypeAccessor(Integer.MIN_VALUE); 442 BasicTypeAccessor acc2 = new BasicTypeAccessor(0); 443 if (performIO(CNINT, acc1, acc2)) { 444 assertEquals("Cannot read written int value", 445 Integer.MIN_VALUE, acc2.paGetIntValue()); 446 } 447 } 448 449 public void testIntMax() throws Exception { 450 changeLogger(LOGGER_NAME + ".int"); 451 BasicTypeAccessor acc1 = new BasicTypeAccessor(Integer.MAX_VALUE); 452 BasicTypeAccessor acc2 = new BasicTypeAccessor(0); 453 if (performIO(CNINT, acc1, acc2)) { 454 assertEquals("Cannot read written int value", 455 Integer.MAX_VALUE, acc2.paGetIntValue()); 456 } 457 } 458 public void testIntGen() throws Exception { 459 changeLogger(LOGGER_NAME + ".int"); 460 GenericAccessor acc1 = new GenericAccessor( 461 PTypeSpace.INT, "intValue", new Integer (45678)); 462 GenericAccessor acc2 = new GenericAccessor( 463 PTypeSpace.INT, "intValue"); 464 if (performIO(CNINT, acc1, acc2)) { 465 assertEquals("Cannot read written int value", 466 45678, acc2.paGetIntField("intValue")); 467 } 468 } 469 470 private final static String CNOINT = "org.objectweb.jorm.pobject.basictype.Oint"; 472 473 public void testOintNull() throws Exception { 474 changeLogger(LOGGER_NAME + ".int"); 475 BasicTypeAccessor acc1 = new BasicTypeAccessor(null); 476 BasicTypeAccessor acc2 = new BasicTypeAccessor(new Integer (0)); 477 if (performIO(CNOINT, acc1, acc2)) { 478 assertEquals("Cannot read written int value", 479 null, acc2.paGetOintValue()); 480 } 481 } 482 483 public void testOint0() throws Exception { 484 changeLogger(LOGGER_NAME + ".int"); 485 BasicTypeAccessor acc1 = new BasicTypeAccessor(new Integer (0)); 486 BasicTypeAccessor acc2 = new BasicTypeAccessor(null); 487 if (performIO(CNOINT, acc1, acc2)) { 488 assertEquals("Cannot read written int value", 489 0, acc2.paGetOintValue().intValue()); 490 } 491 } 492 493 public void testOintMin() throws Exception { 494 changeLogger(LOGGER_NAME + ".int"); 495 BasicTypeAccessor acc1 = new BasicTypeAccessor(new Integer (Integer.MIN_VALUE)); 496 BasicTypeAccessor acc2 = new BasicTypeAccessor(null); 497 if (performIO(CNOINT, acc1, acc2)) { 498 assertEquals("Cannot read written int value", 499 Integer.MIN_VALUE, acc2.paGetOintValue().intValue()); 500 } 501 } 502 503 public void testOintMax() throws Exception { 504 changeLogger(LOGGER_NAME + ".int"); 505 BasicTypeAccessor acc1 = new BasicTypeAccessor(new Integer (Integer.MAX_VALUE)); 506 BasicTypeAccessor acc2 = new BasicTypeAccessor(null); 507 if (performIO(CNOINT, acc1, acc2)) { 508 assertEquals("Cannot read written int value", 509 Integer.MAX_VALUE, acc2.paGetOintValue().intValue()); 510 } 511 } 512 public void testOintGen() throws Exception { 513 changeLogger(LOGGER_NAME + ".int"); 514 GenericAccessor acc1 = new GenericAccessor( 515 PTypeSpace.OBJINT, "ointValue", new Integer (45678)); 516 GenericAccessor acc2 = new GenericAccessor( 517 PTypeSpace.OBJINT, "ointValue"); 518 if (performIO(CNOINT, acc1, acc2)) { 519 assertEquals("Cannot read written oint value", 520 new Integer (45678), acc2.paGetOintField("ointValue")); 521 } 522 } 523 524 525 private final static String CNLONG = "org.objectweb.jorm.pobject.basictype.Long"; 527 528 public void testLong0() throws Exception { 529 changeLogger(LOGGER_NAME + ".long"); 530 BasicTypeAccessor acc1 = new BasicTypeAccessor((long) 0); 531 BasicTypeAccessor acc2 = new BasicTypeAccessor((long) -1); 532 if (performIO(CNLONG, acc1, acc2)) { 533 assertEquals("Cannot read written long value", 534 (long) 0, acc2.paGetLongValue()); 535 } 536 } 537 538 public void testLongMin() throws Exception { 539 changeLogger(LOGGER_NAME + ".long"); 540 BasicTypeAccessor acc1 = new BasicTypeAccessor(Long.MIN_VALUE); 541 BasicTypeAccessor acc2 = new BasicTypeAccessor((long) 0); 542 if (performIO(CNLONG, acc1, acc2)) { 543 assertEquals("Cannot read written long value", 544 Long.MIN_VALUE, acc2.paGetLongValue()); 545 } 546 } 547 548 public void testLongMax() throws Exception { 549 changeLogger(LOGGER_NAME + ".long"); 550 BasicTypeAccessor acc1 = new BasicTypeAccessor(Long.MAX_VALUE); 551 BasicTypeAccessor acc2 = new BasicTypeAccessor((long) 0); 552 if (performIO(CNLONG, acc1, acc2)) { 553 assertEquals("Cannot read written long value", 554 Long.MAX_VALUE, acc2.paGetLongValue()); 555 } 556 } 557 public void testLongGen() throws Exception { 558 changeLogger(LOGGER_NAME + ".long"); 559 GenericAccessor acc1 = new GenericAccessor( 560 PTypeSpace.LONG, "longValue", new Long (100000000000L)); 561 GenericAccessor acc2 = new GenericAccessor( 562 PTypeSpace.LONG, "longValue"); 563 if (performIO(CNLONG, acc1, acc2)) { 564 assertEquals("Cannot read written long value", 565 100000000000L, acc2.paGetLongField("longValue")); 566 } 567 } 568 569 570 private final static String CNOLONG = "org.objectweb.jorm.pobject.basictype.Olong"; 572 573 public void testOlongNull() throws Exception { 574 changeLogger(LOGGER_NAME + ".long"); 575 BasicTypeAccessor acc1 = new BasicTypeAccessor(null); 576 BasicTypeAccessor acc2 = new BasicTypeAccessor(new Long (0)); 577 if (performIO(CNOLONG, acc1, acc2)) { 578 assertEquals("Cannot read written long value", 579 null, acc2.paGetOlongValue()); 580 } 581 } 582 583 public void testOlong0() throws Exception { 584 changeLogger(LOGGER_NAME + ".long"); 585 BasicTypeAccessor acc1 = new BasicTypeAccessor(new Long (0)); 586 BasicTypeAccessor acc2 = new BasicTypeAccessor(null); 587 if (performIO(CNOLONG, acc1, acc2)) { 588 assertEquals("Cannot read written long value"
|