001: /* Copyright (C) 2004 - 2007 db4objects Inc. http://www.db4o.com
002:
003: This file is part of the db4o open source object database.
004:
005: db4o is free software; you can redistribute it and/or modify it under
006: the terms of version 2 of the GNU General Public License as published
007: by the Free Software Foundation and as clarified by db4objects' GPL
008: interpretation policy, available at
009: http://www.db4o.com/about/company/legalpolicies/gplinterpretation/
010: Alternatively you can write to db4objects, Inc., 1900 S Norfolk Street,
011: Suite 350, San Mateo, CA 94403, USA.
012:
013: db4o is distributed in the hope that it will be useful, but WITHOUT ANY
014: WARRANTY; without even the implied warranty of MERCHANTABILITY or
015: FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
016: for more details.
017:
018: You should have received a copy of the GNU General Public License along
019: with this program; if not, write to the Free Software Foundation, Inc.,
020: 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
021: package com.db4o.test.types;
022:
023: import java.util.*;
024:
025: public class UntypedPrivate extends RTest {
026: private Object oBoolean;
027: private Object nBoolean;
028:
029: private Object oByte;
030: private Object nByte;
031:
032: private Object oCharacter;
033: private Object nCharacter;
034:
035: private Object oDouble;
036: private Object nDouble;
037:
038: private Object oFloat;
039: private Object nFloat;
040:
041: private Object oInteger;
042: private Object nInteger;
043:
044: private Object oLong;
045: private Object nLong;
046:
047: private Object oShort;
048: private Object nShort;
049:
050: private Object oString;
051: private Object nString;
052:
053: private Object oDate;
054: private Object nDate;
055:
056: private Object oObject;
057: private Object nObject;
058:
059: public void set(int ver) {
060: if (ver == 1) {
061: oBoolean = new Boolean(true);
062: nBoolean = null;
063:
064: oByte = new Byte(Byte.MAX_VALUE);
065: nByte = null;
066:
067: oCharacter = new Character((char) (Character.MAX_VALUE - 1));
068: nCharacter = null;
069:
070: oDouble = new Double(Double.MAX_VALUE - 1);
071: nDouble = null;
072:
073: oFloat = new Float(Float.MAX_VALUE - 1);
074: nFloat = null;
075:
076: oInteger = new Integer(Integer.MAX_VALUE - 1);
077: nInteger = null;
078:
079: oLong = new Long(Long.MAX_VALUE - 1);
080: nLong = null;
081:
082: oShort = new Short((short) (Short.MAX_VALUE - 1));
083: nShort = null;
084:
085: oString = "db4o rules";
086: nString = null;
087:
088: oDate = new GregorianCalendar(2000, 0, 1).getTime();
089: nDate = null;
090:
091: oObject = new ObjectSimplePrivate("s1");
092: nObject = null;
093: } else {
094: oBoolean = new Boolean(false);
095: nBoolean = new Boolean(true);
096:
097: oByte = new Byte((byte) 0);
098: nByte = new Byte(Byte.MIN_VALUE);
099:
100: oCharacter = new Character((char) 0);
101: nCharacter = new Character(Character.MIN_VALUE);
102:
103: oDouble = new Double(0);
104: nDouble = new Double(Double.MIN_VALUE);
105:
106: oFloat = new Float(0);
107: nFloat = new Float(Float.MIN_VALUE);
108:
109: oInteger = new Integer(0);
110: nInteger = new Integer(Integer.MIN_VALUE);
111:
112: oLong = new Long(0);
113: nLong = new Long(Long.MIN_VALUE);
114:
115: oShort = new Short((short) 0);
116: nShort = new Short(Short.MIN_VALUE);
117:
118: oString = "db4o rules of course";
119: nString = "yeah";
120:
121: oDate = null;
122: nDate = new GregorianCalendar(2001, 1, 1).getTime();
123:
124: oObject = new ObjectSimplePrivate("s2o");
125: nObject = new ObjectSimplePrivate("s2n");
126: }
127: }
128:
129: public boolean jdk2() {
130: return true;
131: }
132: }
|