KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > jorm > runtime > basictype > TestBasicType


1 /**
2  * JORM: an implementation of a generic mapping system for persistent Java
3  * objects. Two mapping are supported: to RDBMS and to binary files.
4  * Copyright (C) 2001-2003 France Telecom R&D - INRIA
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19  *
20  * Contact: jorm-team@objectweb.org
21  *
22  */

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 JavaDoc;
34 import java.math.BigDecimal JavaDoc;
35 import java.math.BigInteger JavaDoc;
36
37 /**
38  * @author P. Dechamboux
39  */

40 public class TestBasicType extends TestRuntimeHelper {
41     private final static String JavaDoc LOGGER_NAME
42             = "test.org.objectweb.jorm.basictype";
43
44     public TestBasicType(String JavaDoc name) throws Exception JavaDoc {
45         super(name);
46     }
47
48     protected String JavaDoc getLoggerName() {
49         return LOGGER_NAME;
50     }
51
52     protected PBinder getBinder(String JavaDoc className) throws Exception JavaDoc {
53         try {
54             return new BasidBinder(mapper,
55                     "org.objectweb.jorm.runtime.basictype.TestBasicType",
56                     PClassMapping.CLEANUP_REMOVEALL);
57         } catch (PException e) {
58             Exception JavaDoc 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     // Definition of test units
68

69     // test units for boolean
70
private final static String JavaDoc CNBOOLEAN = "org.objectweb.jorm.pobject.basictype.Boolean";
71
72     public void testBooleanTrue() throws Exception JavaDoc {
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 JavaDoc {
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 JavaDoc {
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     // test units for oboolean
105
private final static String JavaDoc CNOBOOLEAN = "org.objectweb.jorm.pobject.basictype.Oboolean";
106
107     public void testObooleanNull() throws Exception JavaDoc {
108         changeLogger(LOGGER_NAME + ".boolean");
109         BasicTypeAccessor acc1 = new BasicTypeAccessor(null);
110         BasicTypeAccessor acc2 = new BasicTypeAccessor(new Boolean JavaDoc(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 JavaDoc {
118         changeLogger(LOGGER_NAME + ".boolean");
119         BasicTypeAccessor acc1 = new BasicTypeAccessor(new Boolean JavaDoc(true));
120         BasicTypeAccessor acc2 = new BasicTypeAccessor(new Boolean JavaDoc(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 JavaDoc {
128         changeLogger(LOGGER_NAME + ".boolean");
129         BasicTypeAccessor acc1 = new BasicTypeAccessor(new Boolean JavaDoc(false));
130         BasicTypeAccessor acc2 = new BasicTypeAccessor(new Boolean JavaDoc(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 JavaDoc {
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     // test units for byte
150
private final static String JavaDoc CNBYTE = "org.objectweb.jorm.pobject.basictype.Byte";
151
152     public void testByte0() throws Exception JavaDoc {
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 JavaDoc {
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 JavaDoc {
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 JavaDoc {
182         changeLogger(LOGGER_NAME + ".byte");
183         GenericAccessor acc1 = new GenericAccessor(
184                 PTypeSpace.BYTE, "byteValue", new Byte JavaDoc((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     // test units for byte
194

195     // test units for obyte
196
private final static String JavaDoc CNOBYTE = "org.objectweb.jorm.pobject.basictype.Obyte";
197
198     public void testObyteNull() throws Exception JavaDoc {
199         changeLogger(LOGGER_NAME + ".byte");
200         BasicTypeAccessor acc1 = new BasicTypeAccessor(null);
201         BasicTypeAccessor acc2 = new BasicTypeAccessor(new Byte JavaDoc((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 JavaDoc {
209         changeLogger(LOGGER_NAME + ".byte");
210         BasicTypeAccessor acc1 = new BasicTypeAccessor(new Byte JavaDoc((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 JavaDoc {
219         changeLogger(LOGGER_NAME + ".byte");
220         BasicTypeAccessor acc1 = new BasicTypeAccessor(new Byte JavaDoc(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 JavaDoc {
229         changeLogger(LOGGER_NAME + ".byte");
230         BasicTypeAccessor acc1 = new BasicTypeAccessor(new Byte JavaDoc(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 JavaDoc {
239         changeLogger(LOGGER_NAME + ".byte");
240         GenericAccessor acc1 = new GenericAccessor(
241                 PTypeSpace.OBJBYTE, "obyteValue", new Byte JavaDoc((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 JavaDoc((byte)34), acc2.paGetObyteField("obyteValue"));
247         }
248     }
249
250     // test units for char
251
private final static String JavaDoc CNCHAR = "org.objectweb.jorm.pobject.basictype.Char";
252
253     public void testCharSP() throws Exception JavaDoc {
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 JavaDoc {
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 JavaDoc {
273         changeLogger(LOGGER_NAME + ".char");
274         GenericAccessor acc1 = new GenericAccessor(
275                 PTypeSpace.CHAR, "charValue", new Character JavaDoc('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     // test units for ochar
285
private final static String JavaDoc CNOCHAR = "org.objectweb.jorm.pobject.basictype.Ochar";
286
287     public void testOcharNull() throws Exception JavaDoc {
288         changeLogger(LOGGER_NAME + ".char");
289         BasicTypeAccessor acc1 = new BasicTypeAccessor(null);
290         BasicTypeAccessor acc2 = new BasicTypeAccessor(new Character JavaDoc(' '));
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 JavaDoc {
298         changeLogger(LOGGER_NAME + ".char");
299         BasicTypeAccessor acc1 = new BasicTypeAccessor(new Character JavaDoc(' '));
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 JavaDoc {
308         changeLogger(LOGGER_NAME + ".char");
309         BasicTypeAccessor acc1 = new BasicTypeAccessor(new Character JavaDoc('.'));
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 JavaDoc {
317         changeLogger(LOGGER_NAME + ".char");
318         GenericAccessor acc1 = new GenericAccessor(
319                 PTypeSpace.OBJCHAR, "ocharValue", new Character JavaDoc('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 JavaDoc('a'), acc2.paGetOcharField("ocharValue"));
325         }
326     }
327
328     // test units for short
329
private final static String JavaDoc CNSHORT = "org.objectweb.jorm.pobject.basictype.Short";
330
331     public void testShort0() throws Exception JavaDoc {
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 JavaDoc {
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 JavaDoc {
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 JavaDoc {
361         changeLogger(LOGGER_NAME + ".short");
362         GenericAccessor acc1 = new GenericAccessor(
363                 PTypeSpace.SHORT, "shortValue", new Short JavaDoc((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     // test units for Short
373
private final static String JavaDoc CNOSHORT = "org.objectweb.jorm.pobject.basictype.Oshort";
374
375     public void testOshortNull() throws Exception JavaDoc {
376         changeLogger(LOGGER_NAME + ".short");
377         BasicTypeAccessor acc1 = new BasicTypeAccessor(null);
378         BasicTypeAccessor acc2 = new BasicTypeAccessor(new Short JavaDoc((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 JavaDoc {
386         changeLogger(LOGGER_NAME + ".short");
387         BasicTypeAccessor acc1 = new BasicTypeAccessor(new Short JavaDoc((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 JavaDoc {
396         changeLogger(LOGGER_NAME + ".short");
397         BasicTypeAccessor acc1 = new BasicTypeAccessor(new Short JavaDoc(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 JavaDoc {
406         changeLogger(LOGGER_NAME + ".short");
407         BasicTypeAccessor acc1 = new BasicTypeAccessor(new Short JavaDoc(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 JavaDoc {
415         changeLogger(LOGGER_NAME + ".short");
416         GenericAccessor acc1 = new GenericAccessor(
417                 PTypeSpace.OBJSHORT, "oshortValue", new Short JavaDoc((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 JavaDoc((short) 2), acc2.paGetOshortField("oshortValue"));
423         }
424     }
425
426     // test units for int
427
private final static String JavaDoc CNINT = "org.objectweb.jorm.pobject.basictype.Int";
428
429     public void testInt0() throws Exception JavaDoc {
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 JavaDoc {
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 JavaDoc {
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 JavaDoc {
459         changeLogger(LOGGER_NAME + ".int");
460         GenericAccessor acc1 = new GenericAccessor(
461                 PTypeSpace.INT, "intValue", new Integer JavaDoc(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     // test units for Int
471
private final static String JavaDoc CNOINT = "org.objectweb.jorm.pobject.basictype.Oint";
472
473     public void testOintNull() throws Exception JavaDoc {
474         changeLogger(LOGGER_NAME + ".int");
475         BasicTypeAccessor acc1 = new BasicTypeAccessor(null);
476         BasicTypeAccessor acc2 = new BasicTypeAccessor(new Integer JavaDoc(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 JavaDoc {
484         changeLogger(LOGGER_NAME + ".int");
485         BasicTypeAccessor acc1 = new BasicTypeAccessor(new Integer JavaDoc(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 JavaDoc {
494         changeLogger(LOGGER_NAME + ".int");
495         BasicTypeAccessor acc1 = new BasicTypeAccessor(new Integer JavaDoc(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 JavaDoc {
504         changeLogger(LOGGER_NAME + ".int");
505         BasicTypeAccessor acc1 = new BasicTypeAccessor(new Integer JavaDoc(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 JavaDoc {
513         changeLogger(LOGGER_NAME + ".int");
514         GenericAccessor acc1 = new GenericAccessor(
515                 PTypeSpace.OBJINT, "ointValue", new Integer JavaDoc(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 JavaDoc(45678), acc2.paGetOintField("ointValue"));
521         }
522     }
523
524
525     // test units for long
526
private final static String JavaDoc CNLONG = "org.objectweb.jorm.pobject.basictype.Long";
527
528     public void testLong0() throws Exception JavaDoc {
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 JavaDoc {
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 JavaDoc {
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 JavaDoc {
558         changeLogger(LOGGER_NAME + ".long");
559         GenericAccessor acc1 = new GenericAccessor(
560                 PTypeSpace.LONG, "longValue", new Long JavaDoc(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     // test units for Long
571
private final static String JavaDoc CNOLONG = "org.objectweb.jorm.pobject.basictype.Olong";
572
573     public void testOlongNull() throws Exception JavaDoc {
574         changeLogger(LOGGER_NAME + ".long");
575         BasicTypeAccessor acc1 = new BasicTypeAccessor(null);
576         BasicTypeAccessor acc2 = new BasicTypeAccessor(new Long JavaDoc(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 JavaDoc {
584         changeLogger(LOGGER_NAME + ".long");
585         BasicTypeAccessor acc1 = new BasicTypeAccessor(new Long JavaDoc(0));
586         BasicTypeAccessor acc2 = new BasicTypeAccessor(null);
587         if (performIO(CNOLONG, acc1, acc2)) {
588             assertEquals("Cannot read written long value"