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 TypedPrivate extends RTest {
026: private Boolean oBoolean;
027: private Boolean nBoolean;
028: private boolean sBoolean;
029:
030: private Byte oByte;
031: private Byte nByte;
032: private byte sByte;
033:
034: private Character oCharacter;
035: private Character nCharacter;
036: private char sChar;
037:
038: private Double oDouble;
039: private Double nDouble;
040: private double sDouble;
041:
042: private Float oFloat;
043: private Float nFloat;
044: private float sFloat;
045:
046: private Integer oInteger;
047: private Integer nInteger;
048: private int sInteger;
049:
050: private Long oLong;
051: private Long nLong;
052: private long sLong;
053:
054: private Short oShort;
055: private Short nShort;
056: private short sShort;
057:
058: private String oString;
059: private String nString;
060:
061: private Date oDate;
062: private Date nDate;
063:
064: private ObjectSimplePrivate oObject;
065: private ObjectSimplePrivate nObject;
066:
067: public void set(int ver) {
068: if (ver == 1) {
069: oBoolean = new Boolean(true);
070: nBoolean = null;
071: sBoolean = false;
072:
073: oByte = new Byte((byte) (Byte.MAX_VALUE - 2));
074: nByte = new Byte((byte) 3);
075: sByte = Byte.MIN_VALUE + 1;
076:
077: oCharacter = new Character((char) (Character.MAX_VALUE - 1));
078: nCharacter = null;
079: sChar = Character.MIN_VALUE;
080:
081: oDouble = new Double(Double.MAX_VALUE - 1);
082: nDouble = null;
083: sDouble = Double.MIN_VALUE;
084:
085: oFloat = new Float(Float.MAX_VALUE - 1);
086: nFloat = null;
087: sFloat = Float.MIN_VALUE;
088:
089: oInteger = new Integer(Integer.MAX_VALUE - 1);
090: nInteger = null;
091: sInteger = Integer.MIN_VALUE;
092:
093: oLong = new Long(Long.MAX_VALUE - 1);
094: nLong = null;
095: sLong = Long.MIN_VALUE;
096:
097: oShort = new Short((short) (Short.MAX_VALUE - 1));
098: nShort = null;
099: sShort = Short.MIN_VALUE;
100:
101: oString = "db4o rules";
102: nString = null;
103:
104: oDate = new GregorianCalendar(2000, 0, 1).getTime();
105: nDate = null;
106:
107: oObject = new ObjectSimplePrivate("s1");
108: nObject = null;
109: } else {
110: oBoolean = new Boolean(false);
111: nBoolean = new Boolean(true);
112: sBoolean = true;
113:
114: oByte = new Byte((byte) 0);
115: nByte = new Byte((byte) (Byte.MIN_VALUE + 1));
116: sByte = Byte.MAX_VALUE - 1;
117:
118: oCharacter = new Character((char) 0);
119: nCharacter = new Character(Character.MIN_VALUE);
120: sChar = (char) (Character.MAX_VALUE - 1);
121:
122: oDouble = new Double(0);
123: nDouble = new Double(Double.MIN_VALUE);
124: sDouble = Double.MAX_VALUE - 1;
125:
126: oFloat = new Float(0);
127: nFloat = new Float(Float.MIN_VALUE);
128: sFloat = Float.MAX_VALUE - 1;
129:
130: oInteger = new Integer(0);
131: nInteger = new Integer(Integer.MIN_VALUE);
132: sInteger = Integer.MAX_VALUE - 1;
133:
134: oLong = new Long(0);
135: nLong = new Long(Long.MIN_VALUE);
136: sLong = Long.MAX_VALUE - 1;
137:
138: oShort = new Short((short) 0);
139: nShort = new Short(Short.MIN_VALUE);
140: sShort = (short) (Short.MAX_VALUE - 1);
141:
142: oString = "db4o rules of course";
143: nString = "yeah";
144:
145: oDate = null;
146: nDate = new GregorianCalendar(2001, 1, 1).getTime();
147:
148: oObject = new ObjectSimplePrivate("s2o");
149: nObject = new ObjectSimplePrivate("s2n");
150: }
151: }
152:
153: public boolean jdk2() {
154: return true;
155: }
156: }
|