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 ArrayInObjectPublic extends RTest {
026: public Object oBoolean;
027: public Object nBoolean;
028:
029: public Object oByte;
030: public Object nByte;
031: public Object sByte;
032:
033: public Object oCharacter;
034: public Object nCharacter;
035:
036: public Object oDouble;
037: public Object nDouble;
038:
039: public Object oFloat;
040: public Object nFloat;
041:
042: public Object oInteger;
043: public Object nInteger;
044:
045: public Object oLong;
046: public Object nLong;
047:
048: public Object oShort;
049: public Object nShort;
050:
051: public Object oString;
052: public Object nString;
053:
054: public Object oDate;
055: public Object nDate;
056:
057: public void set(int ver) {
058: if (ver == 1) {
059: oBoolean = new Boolean[] { new Boolean(true),
060: new Boolean(false), null };
061: nBoolean = null;
062: sByte = new byte[] { (byte) 3 };
063:
064: oByte = new Byte[] { new Byte(Byte.MAX_VALUE),
065: new Byte(Byte.MIN_VALUE), new Byte((byte) 0), null };
066: nByte = null;
067:
068: oCharacter = new Character[] {
069: new Character((char) (Character.MAX_VALUE - 1)),
070: new Character(Character.MIN_VALUE),
071: new Character((char) (0)), null };
072: nCharacter = null;
073:
074: oDouble = new Double[] { new Double(Double.MAX_VALUE - 1),
075: new Double(Double.MIN_VALUE), new Double(0), null };
076: nDouble = null;
077:
078: oFloat = new Float[] { new Float(Float.MAX_VALUE - 1),
079: new Float(Float.MIN_VALUE), new Float(0), null };
080: nFloat = null;
081:
082: oInteger = new Integer[] {
083: new Integer(Integer.MAX_VALUE - 1),
084: new Integer(Integer.MIN_VALUE), new Integer(0),
085: null };
086: nInteger = null;
087:
088: oLong = new Long[] { new Long(Long.MAX_VALUE - 1),
089: new Long(Long.MIN_VALUE), new Long(0), null };
090: nLong = null;
091:
092: oShort = new Short[] {
093: new Short((short) (Short.MAX_VALUE - 1)),
094: new Short(Short.MIN_VALUE), new Short((short) (0)),
095: null };
096: nShort = null;
097:
098: oString = new String[] { "db4o rules", "cool", "supergreat" };
099: nString = null;
100:
101: oDate = new Date[] {
102: new GregorianCalendar(2000, 0, 1).getTime(),
103: new GregorianCalendar(2000, 0, 1).getTime(),
104: new GregorianCalendar(2001, 11, 31).getTime(), null };
105: nDate = null;
106: } else {
107: oBoolean = new Boolean[] { new Boolean(false),
108: new Boolean(true), new Boolean(true) };
109: nBoolean = new Boolean[] { null, new Boolean(true),
110: new Boolean(false) };
111:
112: oByte = new Byte[] { new Byte(Byte.MIN_VALUE),
113: new Byte(Byte.MAX_VALUE), new Byte((byte) 1),
114: new Byte((byte) -1) };
115: nByte = new Byte[] { null, new Byte(Byte.MAX_VALUE),
116: new Byte(Byte.MIN_VALUE), new Byte((byte) 0) };
117: sByte = new byte[] { (byte) 5 };
118:
119: oCharacter = new Character[] {
120: new Character(Character.MIN_VALUE),
121: new Character((char) (Character.MAX_VALUE - 1)),
122: new Character((char) (0)),
123: new Character((char) (Character.MAX_VALUE - 1)),
124: new Character((char) 1) };
125: nCharacter = new Character[] { null,
126: new Character((char) (Character.MAX_VALUE - 1)),
127: new Character(Character.MIN_VALUE),
128: new Character((char) (0)) };
129:
130: oDouble = new Double[] { new Double(Double.MIN_VALUE),
131: new Double(0) };
132: nDouble = new Double[] { null,
133: new Double(Double.MAX_VALUE - 1),
134: new Double(Double.MIN_VALUE),
135: new Double(-123.12344),
136: new Double(-12345.123445566) };
137:
138: oFloat = new Float[] { new Float((float) -98.765) };
139: nFloat = null;
140:
141: oInteger = new Integer[] {
142: new Integer(Integer.MAX_VALUE - 1),
143: new Integer(Integer.MIN_VALUE), new Integer(111),
144: new Integer(-333) };
145: nInteger = new Integer[] { null,
146: new Integer(Integer.MAX_VALUE - 1),
147: new Integer(Integer.MIN_VALUE), new Integer(0) };
148:
149: oLong = new Long[] { new Long(Long.MAX_VALUE - 1),
150: new Long(Long.MIN_VALUE), new Long(1) };
151: nLong = new Long[] { null, new Long(Long.MAX_VALUE - 1),
152: new Long(Long.MIN_VALUE), new Long(0) };
153:
154: oShort = new Short[] { new Short(Short.MIN_VALUE),
155: new Short((short) (Short.MAX_VALUE - 1)),
156: new Short((short) (0)) };
157: nShort = new Short[] {
158: new Short((short) (Short.MAX_VALUE - 1)), null,
159: new Short(Short.MIN_VALUE), new Short((short) (0)) };
160:
161: oString = new String[] { "db4o rulez", "cool", "supergreat" };
162: nString = new String[] { null, "db4o rules", "cool",
163: "supergreat", null };
164:
165: oDate = new Date[] {
166: new GregorianCalendar(2000, 0, 1).getTime(),
167: new GregorianCalendar(1999, 0, 1).getTime(),
168: new GregorianCalendar(2001, 11, 31).getTime() };
169: nDate = new Date[] { null,
170: new GregorianCalendar(2000, 0, 1).getTime(),
171: new GregorianCalendar(2000, 0, 1).getTime(),
172: new GregorianCalendar(2001, 11, 31).getTime(), null };
173: }
174: }
175: }
|