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 TypedPublic extends RTest {
026: public Boolean oBoolean;
027: public Boolean nBoolean;
028: public boolean sBoolean;
029:
030: public Byte oByte;
031: public Byte nByte;
032: public byte sByte;
033:
034: public Character oCharacter;
035: public Character nCharacter;
036: public char sChar;
037:
038: public Double oDouble;
039: public Double nDouble;
040: public double sDouble;
041:
042: public Float oFloat;
043: public Float nFloat;
044: public float sFloat;
045:
046: public Integer oInteger;
047: public Integer nInteger;
048: public int sInteger;
049:
050: public Long oLong;
051: public Long nLong;
052: public long sLong;
053:
054: public Short oShort;
055: public Short nShort;
056: public short sShort;
057:
058: public String oString;
059: public String nString;
060:
061: public Date oDate;
062: public Date nDate;
063:
064: public ObjectSimplePublic oObject;
065: public ObjectSimplePublic 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.MAX_VALUE);
074: nByte = null;
075: sByte = Byte.MIN_VALUE;
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 ObjectSimplePublic("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.MIN_VALUE);
116: sByte = Byte.MAX_VALUE;
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 ObjectSimplePublic("s2o");
149: nObject = new ObjectSimplePublic("s2n");
150: }
151: }
152: }
|