Added:
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/fieldtypes/VectorCollections.java
URL:
http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/fieldtypes/VectorCollections.java?view=auto&rev=160090
==============================================================================
---
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/fieldtypes/VectorCollections.java
(added)
+++
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/fieldtypes/VectorCollections.java
Mon Apr 4 12:41:23 2005
@@ -0,0 +1,370 @@
+/*
+ * Copyright 2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.jdo.tck.pc.fieldtypes;
+
+import java.io.Serializable;
+import java.util.Vector;
+
+public class VectorCollections {
+ public int identifier;
+ public Vector VectorOfObject0;
+ public Vector VectorOfObject1;
+ public Vector VectorOfObject2;
+ public Vector VectorOfSimpleClass3;
+ public Vector VectorOfSimpleClass4;
+ public Vector VectorOfSimpleClass5;
+ public Vector VectorOfSimpleInterface6;
+ public Vector VectorOfSimpleInterface7;
+ public Vector VectorOfSimpleInterface8;
+ public Vector VectorOfString9;
+ public Vector VectorOfString10;
+ public Vector VectorOfString11;
+ public Vector VectorOfDate12;
+ public Vector VectorOfDate13;
+ public Vector VectorOfDate14;
+ public Vector VectorOfLocale15;
+ public Vector VectorOfLocale16;
+ public Vector VectorOfLocale17;
+ public Vector VectorOfBigDecimal18;
+ public Vector VectorOfBigDecimal19;
+ public Vector VectorOfBigDecimal20;
+ public Vector VectorOfBigInteger21;
+ public Vector VectorOfBigInteger22;
+ public Vector VectorOfBigInteger23;
+ public Vector VectorOfByte24;
+ public Vector VectorOfByte25;
+ public Vector VectorOfByte26;
+ public Vector VectorOfDouble27;
+ public Vector VectorOfDouble28;
+ public Vector VectorOfDouble29;
+ public Vector VectorOfFloat30;
+ public Vector VectorOfFloat31;
+ public Vector VectorOfFloat32;
+ public Vector VectorOfInteger33;
+ public Vector VectorOfInteger34;
+ public Vector VectorOfInteger35;
+ public Vector VectorOfLong36;
+ public Vector VectorOfLong37;
+ public Vector VectorOfLong38;
+ public Vector VectorOfShort39;
+ public Vector VectorOfShort40;
+ public Vector VectorOfShort41;
+
+ public static final String [] fieldSpecs = {
+ "public Vector VectorOfObject0",
+ "embedded-element=true public Vector VectorOfObject1",
+ "embedded-element=false public Vector VectorOfObject2",
+ "public Vector VectorOfSimpleClass3",
+ "embedded-element=true public Vector VectorOfSimpleClass4",
+ "embedded-element=false public Vector VectorOfSimpleClass5",
+ "public Vector VectorOfSimpleInterface6",
+ "embedded-element=true public Vector VectorOfSimpleInterface7",
+ "embedded-element=false public Vector VectorOfSimpleInterface8",
+ "public Vector VectorOfString9",
+ "embedded-element=true public Vector VectorOfString10",
+ "embedded-element=false public Vector VectorOfString11",
+ "public Vector VectorOfDate12",
+ "embedded-element=true public Vector VectorOfDate13",
+ "embedded-element=false public Vector VectorOfDate14",
+ "public Vector VectorOfLocale15",
+ "embedded-element=true public Vector VectorOfLocale16",
+ "embedded-element=false public Vector VectorOfLocale17",
+ "public Vector VectorOfBigDecimal18",
+ "embedded-element=true public Vector VectorOfBigDecimal19",
+ "embedded-element=false public Vector VectorOfBigDecimal20",
+ "public Vector VectorOfBigInteger21",
+ "embedded-element=true public Vector VectorOfBigInteger22",
+ "embedded-element=false public Vector VectorOfBigInteger23",
+ "public Vector VectorOfByte24",
+ "embedded-element=true public Vector VectorOfByte25",
+ "embedded-element=false public Vector VectorOfByte26",
+ "public Vector VectorOfDouble27",
+ "embedded-element=true public Vector VectorOfDouble28",
+ "embedded-element=false public Vector VectorOfDouble29",
+ "public Vector VectorOfFloat30",
+ "embedded-element=true public Vector VectorOfFloat31",
+ "embedded-element=false public Vector VectorOfFloat32",
+ "public Vector VectorOfInteger33",
+ "embedded-element=true public Vector VectorOfInteger34",
+ "embedded-element=false public Vector VectorOfInteger35",
+ "public Vector VectorOfLong36",
+ "embedded-element=true public Vector VectorOfLong37",
+ "embedded-element=false public Vector VectorOfLong38",
+ "public Vector VectorOfShort39",
+ "embedded-element=true public Vector VectorOfShort40",
+ "embedded-element=false public Vector VectorOfShort41"
+ };
+ public int getLength()
+ {
+ return fieldSpecs.length;
+ }
+ public Vector get(int index)
+ {
+ switch (index)
+ {
+ case(0):
+ return VectorOfObject0;
+ case(1):
+ return VectorOfObject1;
+ case(2):
+ return VectorOfObject2;
+ case(3):
+ return VectorOfSimpleClass3;
+ case(4):
+ return VectorOfSimpleClass4;
+ case(5):
+ return VectorOfSimpleClass5;
+ case(6):
+ return VectorOfSimpleInterface6;
+ case(7):
+ return VectorOfSimpleInterface7;
+ case(8):
+ return VectorOfSimpleInterface8;
+ case(9):
+ return VectorOfString9;
+ case(10):
+ return VectorOfString10;
+ case(11):
+ return VectorOfString11;
+ case(12):
+ return VectorOfDate12;
+ case(13):
+ return VectorOfDate13;
+ case(14):
+ return VectorOfDate14;
+ case(15):
+ return VectorOfLocale15;
+ case(16):
+ return VectorOfLocale16;
+ case(17):
+ return VectorOfLocale17;
+ case(18):
+ return VectorOfBigDecimal18;
+ case(19):
+ return VectorOfBigDecimal19;
+ case(20):
+ return VectorOfBigDecimal20;
+ case(21):
+ return VectorOfBigInteger21;
+ case(22):
+ return VectorOfBigInteger22;
+ case(23):
+ return VectorOfBigInteger23;
+ case(24):
+ return VectorOfByte24;
+ case(25):
+ return VectorOfByte25;
+ case(26):
+ return VectorOfByte26;
+ case(27):
+ return VectorOfDouble27;
+ case(28):
+ return VectorOfDouble28;
+ case(29):
+ return VectorOfDouble29;
+ case(30):
+ return VectorOfFloat30;
+ case(31):
+ return VectorOfFloat31;
+ case(32):
+ return VectorOfFloat32;
+ case(33):
+ return VectorOfInteger33;
+ case(34):
+ return VectorOfInteger34;
+ case(35):
+ return VectorOfInteger35;
+ case(36):
+ return VectorOfLong36;
+ case(37):
+ return VectorOfLong37;
+ case(38):
+ return VectorOfLong38;
+ case(39):
+ return VectorOfShort39;
+ case(40):
+ return VectorOfShort40;
+ case(41):
+ return VectorOfShort41;
+ default:
+ throw new IndexOutOfBoundsException();
+ }
+ }
+ public boolean set(int index,Vector value)
+ {
+ if(fieldSpecs[index].indexOf("final") != -1)
+ return false;
+ switch (index)
+ {
+ case(0):
+ VectorOfObject0= value;
+ break;
+ case(1):
+ VectorOfObject1= value;
+ break;
+ case(2):
+ VectorOfObject2= value;
+ break;
+ case(3):
+ VectorOfSimpleClass3= value;
+ break;
+ case(4):
+ VectorOfSimpleClass4= value;
+ break;
+ case(5):
+ VectorOfSimpleClass5= value;
+ break;
+ case(6):
+ VectorOfSimpleInterface6= value;
+ break;
+ case(7):
+ VectorOfSimpleInterface7= value;
+ break;
+ case(8):
+ VectorOfSimpleInterface8= value;
+ break;
+ case(9):
+ VectorOfString9= value;
+ break;
+ case(10):
+ VectorOfString10= value;
+ break;
+ case(11):
+ VectorOfString11= value;
+ break;
+ case(12):
+ VectorOfDate12= value;
+ break;
+ case(13):
+ VectorOfDate13= value;
+ break;
+ case(14):
+ VectorOfDate14= value;
+ break;
+ case(15):
+ VectorOfLocale15= value;
+ break;
+ case(16):
+ VectorOfLocale16= value;
+ break;
+ case(17):
+ VectorOfLocale17= value;
+ break;
+ case(18):
+ VectorOfBigDecimal18= value;
+ break;
+ case(19):
+ VectorOfBigDecimal19= value;
+ break;
+ case(20):
+ VectorOfBigDecimal20= value;
+ break;
+ case(21):
+ VectorOfBigInteger21= value;
+ break;
+ case(22):
+ VectorOfBigInteger22= value;
+ break;
+ case(23):
+ VectorOfBigInteger23= value;
+ break;
+ case(24):
+ VectorOfByte24= value;
+ break;
+ case(25):
+ VectorOfByte25= value;
+ break;
+ case(26):
+ VectorOfByte26= value;
+ break;
+ case(27):
+ VectorOfDouble27= value;
+ break;
+ case(28):
+ VectorOfDouble28= value;
+ break;
+ case(29):
+ VectorOfDouble29= value;
+ break;
+ case(30):
+ VectorOfFloat30= value;
+ break;
+ case(31):
+ VectorOfFloat31= value;
+ break;
+ case(32):
+ VectorOfFloat32= value;
+ break;
+ case(33):
+ VectorOfInteger33= value;
+ break;
+ case(34):
+ VectorOfInteger34= value;
+ break;
+ case(35):
+ VectorOfInteger35= value;
+ break;
+ case(36):
+ VectorOfLong36= value;
+ break;
+ case(37):
+ VectorOfLong37= value;
+ break;
+ case(38):
+ VectorOfLong38= value;
+ break;
+ case(39):
+ VectorOfShort39= value;
+ break;
+ case(40):
+ VectorOfShort40= value;
+ break;
+ case(41):
+ VectorOfShort41= value;
+ break;
+ default:
+ throw new IndexOutOfBoundsException();
+ }
+ return true;
+ }
+
+ public static class Oid implements Serializable {
+ public int identifier;
+
+ public Oid() {
+ }
+
+ public Oid(String s) { identifier = Integer.parseInt(justTheId(s)); }
+
+ public String toString() { return this.getClass().getName() + ": " +
identifier;}
+
+ public int hashCode() { return (int)identifier ; }
+
+ public boolean equals(Object other) {
+ if (other != null && (other instanceof Oid)) {
+ Oid k = (Oid)other;
+ return k.identifier == this.identifier;
+ }
+ return false;
+ }
+
+ protected static String justTheId(String str) {
+ return str.substring(str.indexOf(':') + 1);
+ }
+
+ }
+}
Propchange:
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/fieldtypes/VectorCollections.java
------------------------------------------------------------------------------
svn:executable = *
Added:
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/inheritance/AllPersist.java
URL:
http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/inheritance/AllPersist.java?view=auto&rev=160090
==============================================================================
---
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/inheritance/AllPersist.java
(added)
+++
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/inheritance/AllPersist.java
Mon Apr 4 12:41:23 2005
@@ -0,0 +1,85 @@
+/*
+ * Copyright 2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+package org.apache.jdo.tck.pc.inheritance;
+
+import java.io.Serializable;
+
+/** */
+public class AllPersist {
+
+ public int intA; // not managed
+ public double doubleB; // persistent
+ public int intB; // persistent
+
+ private int keyValue; // persistent--used as key field in application
identity
+ private static int nextKeyValue = 1;
+
+ public int hashCode() {
+ return keyValue;
+ }
+
+ public boolean equals(Object obj) {
+ if( obj == null || !this.getClass().equals(obj.getClass()) ) return
false;
+ else return keyValue == ((Id)obj).keyValue;
+ }
+
+ public AllPersist() {
+ intA = -1;
+ doubleB = 2.0;
+ intB = -5;
+ }
+
+ public AllPersist(int intA, double doubleVal, int intB) {
+ keyValue = nextKeyValue++;
+ this.intA = intA;
+ doubleB = doubleVal;
+ this.intB = intB;
+ }
+
+ public static class Id implements Serializable {
+ public int keyValue;
+
+ public Id() {
+ }
+
+ public Id(int keyValue) {
+ this.keyValue = keyValue;
+ }
+
+ public Id(String s) {
+ try {
+ keyValue = Integer.parseInt(s);}
+ catch(NumberFormatException e){
+ keyValue = 0;
+ }
+ }
+
+ public boolean equals(Object obj) {
+ if( obj == null || !this.getClass().equals(obj.getClass()) )
return false;
+ else return keyValue == ((Id)obj).keyValue;
+ }
+
+ public int hashCode() {
+ return keyValue;
+ }
+
+ public String toString() {
+ return Integer.toString(keyValue);
+ }
+ }
+}
Propchange:
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/inheritance/AllPersist.java
------------------------------------------------------------------------------
svn:executable = *
Added:
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/inheritance/AllPersist2.java
URL:
http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/inheritance/AllPersist2.java?view=auto&rev=160090
==============================================================================
---
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/inheritance/AllPersist2.java
(added)
+++
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/inheritance/AllPersist2.java
Mon Apr 4 12:41:23 2005
@@ -0,0 +1,39 @@
+/*
+ * Copyright 2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+package org.apache.jdo.tck.pc.inheritance;
+
+/** */
+public class AllPersist2 extends AllPersist {
+
+ public char charC; // not managed
+ public boolean booleanD; // not managed
+ public float floatE; // transactional
+
+ public AllPersist2() {
+ charC = '3';
+ booleanD = false;
+ floatE = -4.4f;
+ }
+
+ public AllPersist2 (int intA, double doubleB, int intB, char charC,
boolean booleanVal, float floatE) {
+ super(intA, doubleB, intB);
+ this.charC = charC;
+ booleanD = booleanVal;
+ this.floatE = floatE;
+ }
+}
Propchange:
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/inheritance/AllPersist2.java
------------------------------------------------------------------------------
svn:executable = *
Added:
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/inheritance/AllPersist3.java
URL:
http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/inheritance/AllPersist3.java?view=auto&rev=160090
==============================================================================
---
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/inheritance/AllPersist3.java
(added)
+++
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/inheritance/AllPersist3.java
Mon Apr 4 12:41:23 2005
@@ -0,0 +1,35 @@
+/*
+ * Copyright 2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+package org.apache.jdo.tck.pc.inheritance;
+
+/** */
+public class AllPersist3 extends AllPersist2 {
+
+ public short shortF; // persistent
+ public AllPersist4 secondObj; // transactional
+ public AllPersist4 thirdObj; // persistent
+
+ public AllPersist3() {
+ shortF = 1238;
+ }
+
+ public AllPersist3 (int intA, double doubleB, int intB, char charC,
boolean booleanD, float floatE, short shortVal) {
+ super(intA, doubleB, intB, charC, booleanD, floatE);
+ shortF = shortVal;
+ }
+}
Propchange:
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/inheritance/AllPersist3.java
------------------------------------------------------------------------------
svn:executable = *
Added:
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/inheritance/AllPersist4.java
URL:
http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/inheritance/AllPersist4.java?view=auto&rev=160090
==============================================================================
---
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/inheritance/AllPersist4.java
(added)
+++
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/inheritance/AllPersist4.java
Mon Apr 4 12:41:23 2005
@@ -0,0 +1,39 @@
+/*
+ * Copyright 2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+package org.apache.jdo.tck.pc.inheritance;
+
+/** */
+public class AllPersist4 extends AllPersist3 {
+
+ public short shortG; // not managed
+ public AllPersist4 fourthObj; // not managed
+ public int intH; // persistent
+
+ public AllPersist4() {
+ shortG = -360;
+ intH = -6;
+ }
+
+ public AllPersist4 (int intA, double doubleB, int intB, char charC,
boolean booleanD,
+ float floatE, short shortF, short shortG, int intVal) {
+ super(intA, doubleB, intB, charC, booleanD, floatE, shortF);
+ this.shortG = shortG;
+ intH = intVal;
+ }
+
+}
Propchange:
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/inheritance/AllPersist4.java
------------------------------------------------------------------------------
svn:executable = *
Added:
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/inheritance/Constants.java
URL:
http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/inheritance/Constants.java?view=auto&rev=160090
==============================================================================
---
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/inheritance/Constants.java
(added)
+++
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/inheritance/Constants.java
Mon Apr 4 12:41:23 2005
@@ -0,0 +1,37 @@
+/*
+ * Copyright 2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jdo.tck.pc.inheritance;
+
+/**
+ * @author Michael Bouschen
+ *
+ * Defines constants used by the inheritance pc classes and the inheritance
tck
+ * test cases.
+ */
+public class Constants
+{
+ // 0 1 2 3
4 5 6 7 8 9 10 11
+ public static final int[] intA_V = { -1, 350, 43,
336, -447, 1, 337, 10, 43, -447, 20, 30};
+ public static final double[] doubleB_V = { 2.0, 9.8, 94.5,
-7.2, -13., 4.0, -8.2, -13, 94.5, -13, 23, 33};
+ public static final int[] intB_V = { -5 , 3334, -76,
28, 12497, 5, 38, 14, -76, 12497, 24, 34};
+ public static final char[] charC_V = { '3', 'D', 'J',
'L', 'N', 'w', '1', 'x', 'J', 'P', 'y', 'z'};
+ public static final boolean[] booleanD_V ={false, true, true,
true, true, false, true, true, true, true, true, false};
+ public static final float[] floatE_V = {-4.4f, -32.7f, -21.5f,
-3266f, -3.6f, 3.0f, -4266f, 12f, -21.5f, -3.6f, 22f, 32f};
+ public static final short[] shortF_V = { 1238, 258, 394,
8, 21, 6, 9, 15, 394, 21, 25, 35};
+ public static final short[] shortG_V = { -360, -1000, -4321,
-6, -44, 2, -7, 11, 4321, -44, 21, 31};
+ public static final int[] intH_V = { -6, -25, -347600,
-603, -7613, 7, -703, 16, -347600, -7613, 26, 36};
+
+}
Propchange:
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/inheritance/Constants.java
------------------------------------------------------------------------------
svn:executable = *
Added:
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/inheritance/FieldSameName.java
URL:
http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/inheritance/FieldSameName.java?view=auto&rev=160090
==============================================================================
---
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/inheritance/FieldSameName.java
(added)
+++
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/inheritance/FieldSameName.java
Mon Apr 4 12:41:23 2005
@@ -0,0 +1,97 @@
+/*
+ * Copyright 2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+package org.apache.jdo.tck.pc.inheritance;
+
+import java.io.Serializable;
+
+/** */
+public class FieldSameName {
+ int n1; // not managed
+ double n2; // persistent
+ int n3; // persistent
+
+ private int keyValue; // persistent--used as key field in application
identity
+ private static int nextKeyValue = 1;
+
+ public FieldSameName() {
+ n1 = -1;
+ n2 = 2.0;
+ n3 = -5;
+ }
+
+ public FieldSameName(int intA, double doubleVal, int intB) {
+ keyValue = nextKeyValue++;
+ n1 = intA;
+ n2 = doubleVal;
+ n3 = intB;
+ }
+
+ public void setIntA(int intA) {
+ n1 = intA;
+ }
+
+ public int getIntA() {
+ return n1;
+ }
+
+ public void setDoubleB(double doubleB) {
+ n2 = doubleB;
+ }
+
+ public double getDoubleB() {
+ return n2;
+ }
+
+ public void setIntB(int intB) {
+ n3 = intB;
+ }
+
+ public int getIntB() {
+ return n3;
+ }
+
+ public static class Id implements Serializable {
+ public int keyValue;
+
+ public Id() {
+ }
+
+ public Id(int keyValue) {
+ this.keyValue = keyValue;
+ }
+
+ public Id(String s) {
+ try{ keyValue = Integer.parseInt(s);}
+ catch(NumberFormatException e){
+ keyValue = 0;}
+ }
+
+ public boolean equals(Object obj) {
+ if( obj == null || !this.getClass().equals(obj.getClass()) )
return false;
+ else return keyValue == ((Id)obj).keyValue;
+ }
+
+ public int hashCode() {
+ return keyValue;
+ }
+
+ public String toString() {
+ return Integer.toString(keyValue);
+ }
+ }
+}
Propchange:
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/inheritance/FieldSameName.java
------------------------------------------------------------------------------
svn:executable = *
Added:
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/inheritance/FieldSameName2.java
URL:
http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/inheritance/FieldSameName2.java?view=auto&rev=160090
==============================================================================
---
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/inheritance/FieldSameName2.java
(added)
+++
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/inheritance/FieldSameName2.java
Mon Apr 4 12:41:23 2005
@@ -0,0 +1,62 @@
+/*
+ * Copyright 2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+package org.apache.jdo.tck.pc.inheritance;
+
+/** */
+public class FieldSameName2 extends FieldSameName {
+ char n1; // not managed
+ boolean n2; // not managed
+ float n3; // transactional
+
+ public FieldSameName2() {
+ n1 = '3';
+ n2 = false;
+ n3 = -4.4f;
+ }
+
+ public FieldSameName2 (int intA, double doubleB, int intB, char charC,
boolean booleanVal, float floatE) {
+ super(intA, doubleB, intB);
+ n1 = charC;
+ n2 = booleanVal;
+ n3 = floatE;
+ }
+
+ public void setCharC(char charC) {
+ n1 = charC;
+ }
+
+ public char getCharC() {
+ return n1;
+ }
+
+ public void setBooleanD(boolean booleanD) {
+ n2 = booleanD;
+ }
+
+ public boolean getBooleanD() {
+ return n2;
+ }
+
+ public void setFloatE(float floatE) {
+ n3 = floatE;
+ }
+
+ public float getFloatE() {
+ return n3;
+ }
+}
Propchange:
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/inheritance/FieldSameName2.java
------------------------------------------------------------------------------
svn:executable = *
Added:
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/inheritance/FieldSameName3.java
URL:
http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/inheritance/FieldSameName3.java?view=auto&rev=160090
==============================================================================
---
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/inheritance/FieldSameName3.java
(added)
+++
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/inheritance/FieldSameName3.java
Mon Apr 4 12:41:23 2005
@@ -0,0 +1,58 @@
+/*
+ * Copyright 2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+package org.apache.jdo.tck.pc.inheritance;
+
+/** */
+public class FieldSameName3 extends FieldSameName2 {
+ short n1; // persistent
+ FieldSameName4 n2; // transactional
+ FieldSameName4 n3; // persistent
+
+ public FieldSameName3() {
+ n1 = 1238;
+ }
+
+ public FieldSameName3 (int intA, double doubleB, int intB, char charC,
boolean booleanD, float floatE, short shortVal) {
+ super(intA, doubleB, intB, charC, booleanD, floatE);
+ n1 = shortVal;
+ }
+
+ public void setShortF(short shortF) {
+ n1 = shortF;
+ }
+
+ public short getShortF() {
+ return n1;
+ }
+
+ public void setSecondObj(FieldSameName4 secondObj) {
+ n2 = secondObj;
+ }
+
+ public FieldSameName4 getSecondObj() {
+ return n2;
+ }
+
+ public void setThirdObj(FieldSameName4 thirdObj) {
+ n3 = thirdObj;
+ }
+
+ public FieldSameName4 getThirdObj() {
+ return n3;
+ }
+}
Propchange:
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/inheritance/FieldSameName3.java
------------------------------------------------------------------------------
svn:executable = *
Added:
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/inheritance/FieldSameName4.java
URL:
http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/inheritance/FieldSameName4.java?view=auto&rev=160090
==============================================================================
---
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/inheritance/FieldSameName4.java
(added)
+++
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/inheritance/FieldSameName4.java
Mon Apr 4 12:41:23 2005
@@ -0,0 +1,62 @@
+/*
+ * Copyright 2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+package org.apache.jdo.tck.pc.inheritance;
+
+/** */
+public class FieldSameName4 extends FieldSameName3 {
+ short n1; // not managed
+ FieldSameName4 n2; // not managed
+ int n3; // persistent
+
+ public FieldSameName4() {
+ n1 = -360;
+ n3 = -6;
+ }
+
+ public FieldSameName4 (int intA, double doubleB, int intB, char charC,
boolean booleanD,
+ float floatE, short shortF, short shortG, int intVal) {
+ super(intA, doubleB, intB, charC, booleanD, floatE, shortF);
+ n1 = shortG;
+ n3 = intVal;
+ }
+
+ public void setShortG(short shortG) {
+ n1 = shortG;
+ }
+
+ public short getShortG() {
+ return n1;
+ }
+
+ public void setFourthObj(FieldSameName4 fourthObj) {
+ n2 = fourthObj;
+ }
+
+ public FieldSameName4 getFourthObj() {
+ return n2;
+ }
+
+ public void setIntH(int intH) {
+ n3 = intH;
+ }
+
+ public int getIntH() {
+ return n3;
+ }
+
+}
Propchange:
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/inheritance/FieldSameName4.java
------------------------------------------------------------------------------
svn:executable = *
Added:
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/inheritance/TopNonPersist.java
URL:
http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/inheritance/TopNonPersist.java?view=auto&rev=160090
==============================================================================
---
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/inheritance/TopNonPersist.java
(added)
+++
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/inheritance/TopNonPersist.java
Mon Apr 4 12:41:23 2005
@@ -0,0 +1,33 @@
+/*
+ * Copyright 2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+package org.apache.jdo.tck.pc.inheritance;
+
+/** */
+public class TopNonPersist { // not persistent
+
+ public int intA;
+
+ public TopNonPersist() {
+ intA = -1;
+ }
+
+ public TopNonPersist(int intA) {
+ this.intA = intA;
+ }
+
+}
Propchange:
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/inheritance/TopNonPersist.java
------------------------------------------------------------------------------
svn:executable = *
Added:
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/inheritance/TopNonPersistB.java
URL:
http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/inheritance/TopNonPersistB.java?view=auto&rev=160090
==============================================================================
---
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/inheritance/TopNonPersistB.java
(added)
+++
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/inheritance/TopNonPersistB.java
Mon Apr 4 12:41:23 2005
@@ -0,0 +1,72 @@
+/*
+ * Copyright 2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+package org.apache.jdo.tck.pc.inheritance;
+
+import java.io.Serializable;
+
+/** */
+public class TopNonPersistB extends TopNonPersist { // persistent
+
+ public double doubleB; // persistent
+ public int intB; // persistent
+
+ private int keyValue; // persistent--used as key field in application
identity
+ static private int nextKeyValue = 1;
+
+ public TopNonPersistB() {
+ doubleB = 2.0;
+ intB = -5;
+ }
+
+ public TopNonPersistB (int intA, double doubleVal, int intB) {
+ super(intA);
+ keyValue = nextKeyValue++;
+ doubleB = doubleVal;
+ this.intB = intB;
+ }
+
+ public static class Id implements Serializable {
+ public int keyValue;
+
+ public Id() {
+ }
+
+ public Id(int keyValue) {
+ this.keyValue = keyValue;
+ }
+
+ public Id(String s) {
+ try{ keyValue = Integer.parseInt(s);}
+ catch(NumberFormatException e){
+ keyValue = 0;}
+ }
+
+ public boolean equals(Object obj) {
+ if( obj == null || !this.getClass().equals(obj.getClass()) )
return false;
+ else return keyValue == ((Id)obj).keyValue;
+ }
+
+ public int hashCode() {
+ return keyValue;
+ }
+
+ public String toString() {
+ return Integer.toString(keyValue);
+ }
+ }
+}
Propchange:
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/inheritance/TopNonPersistB.java
------------------------------------------------------------------------------
svn:executable = *
Added:
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/inheritance/TopNonPersistC.java
URL:
http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/inheritance/TopNonPersistC.java?view=auto&rev=160090
==============================================================================
---
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/inheritance/TopNonPersistC.java
(added)
+++
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/inheritance/TopNonPersistC.java
Mon Apr 4 12:41:23 2005
@@ -0,0 +1,33 @@
+/*
+ * Copyright 2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+package org.apache.jdo.tck.pc.inheritance;
+
+/** */
+public class TopNonPersistC extends TopNonPersistB { // not persistent
+
+ public char charC;
+
+ public TopNonPersistC() {
+ charC = '3';
+ }
+
+ public TopNonPersistC (int intA, double doubleB, int intB, char charC) {
+ super(intA, doubleB, intB);
+ this.charC = charC;
+ }
+}
Propchange:
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/inheritance/TopNonPersistC.java
------------------------------------------------------------------------------
svn:executable = *
Added:
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/inheritance/TopNonPersistD.java
URL:
http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/inheritance/TopNonPersistD.java?view=auto&rev=160090
==============================================================================
---
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/inheritance/TopNonPersistD.java
(added)
+++
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/inheritance/TopNonPersistD.java
Mon Apr 4 12:41:23 2005
@@ -0,0 +1,33 @@
+/*
+ * Copyright 2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+package org.apache.jdo.tck.pc.inheritance;
+
+/** */
+public class TopNonPersistD extends TopNonPersistC { // not persistent
+
+ public boolean booleanD;
+
+ public TopNonPersistD() {
+ booleanD = false;
+ }
+
+ public TopNonPersistD (int int1, double doubleB, int intB, char charC,
boolean booleanVal) {
+ super(int1, doubleB, intB,charC);
+ booleanD = booleanVal;
+ }
+}
Propchange:
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/inheritance/TopNonPersistD.java
------------------------------------------------------------------------------
svn:executable = *
Added:
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/inheritance/TopNonPersistE.java
URL:
http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/inheritance/TopNonPersistE.java?view=auto&rev=160090
==============================================================================
---
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/inheritance/TopNonPersistE.java
(added)
+++
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/inheritance/TopNonPersistE.java
Mon Apr 4 12:41:23 2005
@@ -0,0 +1,33 @@
+/*
+ * Copyright 2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+package org.apache.jdo.tck.pc.inheritance;
+
+/** */
+public class TopNonPersistE extends TopNonPersistD { // persistent
+
+ public float floatE; // transactional
+
+ public TopNonPersistE () {
+ floatE = -4.4f;
+ }
+
+ public TopNonPersistE (int intA, double doubleB, int intB, char charC,
boolean booleanD, float floatE) {
+ super(intA, doubleB, intB, charC, booleanD);
+ this.floatE = floatE;
+ }
+}
Propchange:
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/inheritance/TopNonPersistE.java
------------------------------------------------------------------------------
svn:executable = *
Added:
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/inheritance/TopNonPersistF.java
URL:
http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/inheritance/TopNonPersistF.java?view=auto&rev=160090
==============================================================================
---
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/inheritance/TopNonPersistF.java
(added)
+++
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/inheritance/TopNonPersistF.java
Mon Apr 4 12:41:23 2005
@@ -0,0 +1,35 @@
+/*
+ * Copyright 2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+package org.apache.jdo.tck.pc.inheritance;
+
+/** */
+public class TopNonPersistF extends TopNonPersistE { // persistent
+
+ public short shortF; // persistent
+ public TopNonPersistH secondObj; // transactional
+ public TopNonPersistH thirdObj; // persistent
+
+ public TopNonPersistF() {
+ shortF = 1238;
+ }
+
+ public TopNonPersistF (int intA, double doubleB, int intB, char charC,
boolean booleanD, float floatE, short shortVal) {
+ super(intA, doubleB, intB, charC, booleanD, floatE);
+ shortF = shortVal;
+ }
+}
Propchange:
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/inheritance/TopNonPersistF.java
------------------------------------------------------------------------------
svn:executable = *
Added:
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/inheritance/TopNonPersistG.java
URL:
http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/inheritance/TopNonPersistG.java?view=auto&rev=160090
==============================================================================
---
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/inheritance/TopNonPersistG.java
(added)
+++
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/inheritance/TopNonPersistG.java
Mon Apr 4 12:41:23 2005
@@ -0,0 +1,35 @@
+/*
+ * Copyright 2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+package org.apache.jdo.tck.pc.inheritance;
+
+/** */
+public class TopNonPersistG extends TopNonPersistF { // not persistent
+
+ public short shortG;
+ public TopNonPersistH fourthObj;
+
+ public TopNonPersistG() {
+ shortG = -360;
+ }
+
+ public TopNonPersistG (int intA, double doubleB, int intB, char charC,
boolean booleanD,
+ float floatE, short shortF, short shortG) {
+ super(intA, doubleB, intB, charC, booleanD, floatE, shortF);
+ this.shortG = shortG;
+ }
+}
Propchange:
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/inheritance/TopNonPersistG.java
------------------------------------------------------------------------------
svn:executable = *
Added:
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/inheritance/TopNonPersistH.java
URL:
http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/inheritance/TopNonPersistH.java?view=auto&rev=160090
==============================================================================
---
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/inheritance/TopNonPersistH.java
(added)
+++
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/inheritance/TopNonPersistH.java
Mon Apr 4 12:41:23 2005
@@ -0,0 +1,35 @@
+/*
+ * Copyright 2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+package org.apache.jdo.tck.pc.inheritance;
+
+/** */
+public class TopNonPersistH extends TopNonPersistG { // persistent
+
+ public int intH; // persistent
+
+ public TopNonPersistH() {
+ intH = -6;
+ }
+
+ public TopNonPersistH (int intA, double doubleB, int intB, char charC,
boolean booleanD,
+ float floatE, short shortF, short shortG, int intVal) {
+ super(intA, doubleB, intB, charC, booleanD, floatE, shortF, shortG);
+ intH = intVal;
+ }
+
+}
Propchange:
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/inheritance/TopNonPersistH.java
------------------------------------------------------------------------------
svn:executable = *
Added:
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/inheritance/TopPersist.java
URL:
http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/inheritance/TopPersist.java?view=auto&rev=160090
==============================================================================
---
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/inheritance/TopPersist.java
(added)
+++
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/inheritance/TopPersist.java
Mon Apr 4 12:41:23 2005
@@ -0,0 +1,74 @@
+/*
+ * Copyright 2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+package org.apache.jdo.tck.pc.inheritance;
+
+import java.io.Serializable;
+
+/** */
+public class TopPersist { // persistent
+
+ public int intA; // not managed
+ public double doubleB; // persistent
+ public int intB; // persistent
+
+ private int keyValue; // persistent--used as key field in application
identity
+ static private int nextKeyValue = 1;
+
+ public TopPersist() {
+ intA = Constants.intA_V[0];
+ doubleB = Constants.doubleB_V[0];
+ intB = Constants.intB_V[0];
+ }
+
+ public TopPersist (int intA, double doubleVal, int intB) {
+ keyValue = nextKeyValue++;
+ this.intA = intA;
+ doubleB = doubleVal;
+ this.intB = intB;
+ }
+
+ public static class Id implements Serializable {
+ public int keyValue;
+
+ public Id() {
+ }
+
+ public Id(int keyValue) {
+ this.keyValue = keyValue;
+ }
+
+ public Id(String s) {
+ try{ keyValue = Integer.parseInt(s);}
+ catch(NumberFormatException e){
+ keyValue = 0;}
+ }
+
+ public boolean equals(Object obj) {
+ if( obj == null || !this.getClass().equals(obj.getClass()) )
return false;
+ else return keyValue == ((Id)obj).keyValue;
+ }
+
+ public int hashCode() {
+ return keyValue;
+ }
+
+ public String toString() {
+ return Integer.toString(keyValue);
+ }
+ }
+}
Propchange:
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/inheritance/TopPersist.java
------------------------------------------------------------------------------
svn:executable = *
Added:
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/inheritance/TopPersistC.java
URL:
http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/inheritance/TopPersistC.java?view=auto&rev=160090
==============================================================================
---
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/inheritance/TopPersistC.java
(added)
+++
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/inheritance/TopPersistC.java
Mon Apr 4 12:41:23 2005
@@ -0,0 +1,33 @@
+/*
+ * Copyright 2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+package org.apache.jdo.tck.pc.inheritance;
+
+/** */
+public class TopPersistC extends TopPersist { // not persistent
+
+ public char charC;
+
+ public TopPersistC() {
+ charC = Constants.charC_V[0];
+ }
+
+ public TopPersistC (int intA, double doubleB, int intB, char charC) {
+ super(intA, doubleB, intB);
+ this.charC = charC;
+ }
+}
Propchange:
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/inheritance/TopPersistC.java
------------------------------------------------------------------------------
svn:executable = *
Added:
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/inheritance/TopPersistD.java
URL:
http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/inheritance/TopPersistD.java?view=auto&rev=160090
==============================================================================
---
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/inheritance/TopPersistD.java
(added)
+++
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/inheritance/TopPersistD.java
Mon Apr 4 12:41:23 2005
@@ -0,0 +1,33 @@
+/*
+ * Copyright 2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+package org.apache.jdo.tck.pc.inheritance;
+
+/** */
+public class TopPersistD extends TopPersistC { // not persistent
+
+ public boolean booleanD;
+
+ public TopPersistD() {
+ booleanD = Constants.booleanD_V[0];
+ }
+
+ public TopPersistD (int int1, double doubleB, int intB, char charC,
boolean booleanVal) {
+ super(int1, doubleB, intB,charC);
+ booleanD = booleanVal;
+ }
+}
Propchange:
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/inheritance/TopPersistD.java
------------------------------------------------------------------------------
svn:executable = *
Added:
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/inheritance/TopPersistE.java
URL:
http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/inheritance/TopPersistE.java?view=auto&rev=160090
==============================================================================
---
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/inheritance/TopPersistE.java
(added)
+++
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/inheritance/TopPersistE.java
Mon Apr 4 12:41:23 2005
@@ -0,0 +1,33 @@
+/*
+ * Copyright 2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+package org.apache.jdo.tck.pc.inheritance;
+
+/** */
+public class TopPersistE extends TopPersistD { // persistent
+
+ public float floatE; // transactional
+
+ public TopPersistE () {
+ floatE = Constants.floatE_V[0];
+ }
+
+ public TopPersistE (int intA, double doubleB, int intB, char charC,
boolean booleanD, float floatE) {
+ super(intA, doubleB, intB, charC, booleanD);
+ this.floatE = floatE;
+ }
+}
Propchange:
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/inheritance/TopPersistE.java
------------------------------------------------------------------------------
svn:executable = *
Added:
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/inheritance/TopPersistF.java
URL:
http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/inheritance/TopPersistF.java?view=auto&rev=160090
==============================================================================
---
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/inheritance/TopPersistF.java
(added)
+++
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/inheritance/TopPersistF.java
Mon Apr 4 12:41:23 2005
@@ -0,0 +1,35 @@
+/*
+ * Copyright 2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+package org.apache.jdo.tck.pc.inheritance;
+
+/** */
+public class TopPersistF extends TopPersistE { // persistent
+
+ public short shortF; // persistent
+ public TopPersistH secondObj; // transactional
+ public TopPersistH thirdObj; // persistent
+
+ public TopPersistF() {
+ shortF = Constants.shortF_V[0];
+ }
+
+ public TopPersistF (int intA, double doubleB, int intB, char charC,
boolean booleanD, float floatE, short shortVal) {
+ super(intA, doubleB, intB, charC, booleanD, floatE);
+ shortF = shortVal;
+ }
+}
Propchange:
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/inheritance/TopPersistF.java
------------------------------------------------------------------------------
svn:executable = *
Added:
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/inheritance/TopPersistG.java
URL:
http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/inheritance/TopPersistG.java?view=auto&rev=160090
==============================================================================
---
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/inheritance/TopPersistG.java
(added)
+++
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/inheritance/TopPersistG.java
Mon Apr 4 12:41:23 2005
@@ -0,0 +1,35 @@
+/*
+ * Copyright 2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+package org.apache.jdo.tck.pc.inheritance;
+
+/** */
+public class TopPersistG extends TopPersistF { // not persistent
+
+ public short shortG;
+ public TopPersistH fourthObj;
+
+ public TopPersistG() {
+ shortG = Constants.shortG_V[0];
+ }
+
+ public TopPersistG (int intA, double doubleB, int intB, char charC,
boolean booleanD,
+ float floatE, short shortF, short shortG) {
+ super(intA, doubleB, intB, charC, booleanD, floatE, shortF);
+ this.shortG = shortG;
+ }
+}
Propchange:
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/inheritance/TopPersistG.java
------------------------------------------------------------------------------
svn:executable = *
Added:
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/inheritance/TopPersistH.java
URL:
http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/inheritance/TopPersistH.java?view=auto&rev=160090
==============================================================================
---
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/inheritance/TopPersistH.java
(added)
+++
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/inheritance/TopPersistH.java
Mon Apr 4 12:41:23 2005
@@ -0,0 +1,34 @@
+/*
+ * Copyright 2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+package org.apache.jdo.tck.pc.inheritance;
+
+/** */
+public class TopPersistH extends TopPersistG { // persistent
+
+ public int intH; // persistent
+
+ public TopPersistH() {
+ intH = Constants.intH_V[0];
+ }
+
+ public TopPersistH (int intA, double doubleB, int intB, char charC,
boolean booleanD,
+ float floatE, short shortF, short shortG, int intVal) {
+ super(intA, doubleB, intB, charC, booleanD, floatE, shortF, shortG);
+ intH = intVal;
+ }
+}
Propchange:
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/inheritance/TopPersistH.java
------------------------------------------------------------------------------
svn:executable = *
Added:
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/instancecallbacks/InstanceCallbackClass.java
URL:
http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/instancecallbacks/InstanceCallbackClass.java?view=auto&rev=160090
==============================================================================
---
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/instancecallbacks/InstanceCallbackClass.java
(added)
+++
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/instancecallbacks/InstanceCallbackClass.java
Mon Apr 4 12:41:23 2005
@@ -0,0 +1,238 @@
+/*
+ * Copyright 2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+package org.apache.jdo.tck.pc.instancecallbacks;
+
+import java.io.Serializable;
+import java.util.Date;
+import java.util.HashSet;
+import java.util.Iterator;
+
+import javax.jdo.Extent;
+import javax.jdo.InstanceCallbacks;
+import javax.jdo.JDOHelper;
+import javax.jdo.PersistenceManager;
+import javax.jdo.Transaction;
+
+import org.apache.jdo.tck.JDO_Test;
+
+public class InstanceCallbackClass implements InstanceCallbacks {
+ public static boolean performPreClearTests;
+ public static boolean performPreDeleteTests;
+ public static boolean performPreStoreTests;
+
+ // The following two variables used in CallingJdoPreDelete tests
+ public static boolean preDeleteCalled;
+ public static int objectState;
+
+ // The rest of these variables used in FieldsInPredelete tests, except to
set a variable to make object dirty.
+ public static int arraySize = 5;
+ public static String[] capturedName = new String[arraySize];
+ public static Date[] capturedTimeStamp = new Date[arraySize];
+ public static double[] capturedDoubleValue = new double[arraySize];
+ public static short[] capturedChildToDelete = new short[arraySize];
+ public static char[] capturedCharValue = new char[arraySize];
+ public static String[] capturedNextObjName = new String[arraySize];
+ public static int[] numberOfChildren = new int[arraySize];
+ public static int[] sumOfChildrenIntValue = new int[arraySize];
+ public static boolean[] processedIndex = new boolean[arraySize];
+
+ public static boolean[] transactionActive = new boolean[arraySize];
+
+ private static int nextKeyValue = 1;
+ private int keyValue; // persistent--used as key field in application
identity
+ public String name;
+ public Date timeStamp;
+ public InstanceCallbackClass nextObj;
+ public HashSet children;
+ public int intValue;
+ public double doubleValue;
+ public short childToDelete;
+ public char charValue;
+
+ public static void initializeStaticsForTest()
+ {
+ performPreClearTests = false;
+ performPreDeleteTests = false;
+ performPreStoreTests = false;
+ preDeleteCalled = false;
+ for( int i = 0; i < arraySize; ++i){
+ processedIndex[i] = false;
+ transactionActive[i] = false;
+ }
+ }
+
+ public static void removeAllInstances(PersistenceManager pm)
+ {
+ Extent e = pm.getExtent(InstanceCallbackClass.class, true);
+ Iterator i = e.iterator();
+ while( i.hasNext() ){
+ pm.deletePersistent(i.next());
+ }
+ }
+
+ public InstanceCallbackClass() { // not used by application
+ }
+
+ public InstanceCallbackClass(String label,Date createTime,int
intValue,double doubleValue,short childToDelete,char
charValue,InstanceCallbackClass obj) {
+ keyValue = nextKeyValue++;
+ name = label;
+ timeStamp = createTime;
+ nextObj = obj;
+ children = new HashSet();
+ this.intValue = intValue;
+ this.doubleValue = doubleValue;
+ this.childToDelete = childToDelete;
+ this.charValue = charValue;
+ }
+
+ public void addChild(InstanceCallbackClass child) {
+ children.add(child);
+ }
+
+ public void jdoPreStore() {
+ if(!performPreStoreTests) { return; }
+ captureValues();
+ PersistenceManager pm = JDOHelper.getPersistenceManager(this);
+ usePM(pm);
+ }
+
+ public void jdoPreDelete() {
+ if(!performPreDeleteTests) { return; }
+ // The following two variables set for CallingJdoPreDelete tests
+ preDeleteCalled = true;
+ objectState = JDO_Test.currentState(this);
+
+ captureValues();
+
+ // The rest of this routine used for Accessing FieldsInPredelete tests
+ // check that intValue is a valid index
+ if(intValue >= 0 & intValue < arraySize) {
+ PersistenceManager pm = JDOHelper.getPersistenceManager(this);
+ usePM(pm);
+ if(nextObj != null) {
+ pm.deletePersistent(nextObj); // delete referenced object
+
+ // delete designated child
+ for(Iterator i = children.iterator(); i.hasNext();) {
+ InstanceCallbackClass obj =
(InstanceCallbackClass)i.next();
+ if( obj.intValue == childToDelete) {
+ pm.deletePersistent(obj);
+ break;
+ }
+ }
+ }
+ }
+ }
+
+ public void jdoPostLoad() {
+ }
+
+ public void jdoPreClear() {
+ if(!performPreClearTests) { return; }
+ // the following code is copied from captureValues, because it must
+ // not be enhanced for execution during jdoPreClear.
+ // check that intValue is a valid index
+ if(intValue >= 0 & intValue < arraySize) {
+ processedIndex[intValue] = true;
+
+ // capture values of the attributes
+ capturedName[intValue] = name;
+ capturedTimeStamp[intValue] = timeStamp;
+ capturedDoubleValue[intValue] = doubleValue;
+ numberOfChildren[intValue] = children.size();
+ sumOfChildrenIntValue[intValue] = 0;
+ for(Iterator i = children.iterator(); i.hasNext();) {
+ InstanceCallbackClass o = (InstanceCallbackClass)i.next();
+ sumOfChildrenIntValue[intValue] += o.intValue;
+ }
+ capturedChildToDelete[intValue] = childToDelete;
+ capturedCharValue[intValue] = charValue;
+ if(nextObj != null) {
+ capturedNextObjName[intValue] = nextObj.name;
+ } else {
+ capturedNextObjName[intValue] = null;
+ }
+ }
+ }
+
+ void captureValues() {
+ // check that intValue is a valid index
+ if(intValue >= 0 & intValue < arraySize) {
+ processedIndex[intValue] = true;
+
+ // capture values of the attributes
+ capturedName[intValue] = name;
+ capturedTimeStamp[intValue] = timeStamp;
+ capturedDoubleValue[intValue] = doubleValue;
+ numberOfChildren[intValue] = children.size();
+ sumOfChildrenIntValue[intValue] = 0;
+ for(Iterator i = children.iterator(); i.hasNext();) {
+ InstanceCallbackClass o = (InstanceCallbackClass)i.next();
+ sumOfChildrenIntValue[intValue] += o.intValue;
+ }
+ capturedChildToDelete[intValue] = childToDelete;
+ capturedCharValue[intValue] = charValue;
+ if(nextObj != null) {
+ capturedNextObjName[intValue] = nextObj.name;
+ } else {
+ capturedNextObjName[intValue] = null;
+ }
+ }
+ }
+
+ void usePM(PersistenceManager pm) {
+ if(intValue >= 0 & intValue < arraySize) {
+ Transaction t = pm.currentTransaction();
+ if(t.isActive()) {
+ transactionActive[intValue] = true;
+ }
+ }
+ }
+
+public static class KeyClass implements Serializable, Comparable {
+ public int keyValue;
+
+ public KeyClass() {
+ }
+
+ public KeyClass(String s) {
+ try{ keyValue = Integer.parseInt(s);}
+ catch(NumberFormatException e){
+ keyValue = 0;}
+ }
+
+ public boolean equals(Object obj) {
+ if( obj == null || !this.getClass().equals(obj.getClass()) ) return
false;
+ else return keyValue == ((KeyClass)obj).keyValue;
+ }
+
+ public int hashCode() {
+ return keyValue;
+ }
+
+ public String toString() {
+ return Integer.toString(keyValue);
+ }
+
+ public int compareTo(Object obj) {
+ // may throw ClassCastException to be handled by user.
+ return keyValue - ((KeyClass)obj).keyValue;
+ }
+
+}
+}
Propchange:
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/instancecallbacks/InstanceCallbackClass.java
------------------------------------------------------------------------------
svn:executable = *
Added:
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/instancecallbacks/InstanceCallbackNonPersistFdsClass.java
URL:
http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/instancecallbacks/InstanceCallbackNonPersistFdsClass.java?view=auto&rev=160090
==============================================================================
---
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/instancecallbacks/InstanceCallbackNonPersistFdsClass.java
(added)
+++
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/instancecallbacks/InstanceCallbackNonPersistFdsClass.java
Mon Apr 4 12:41:23 2005
@@ -0,0 +1,307 @@
+/*
+ * Copyright 2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+package org.apache.jdo.tck.pc.instancecallbacks;
+
+import java.io.*;
+import java.util.*;
+import javax.jdo.*;
+
+public class InstanceCallbackNonPersistFdsClass implements InstanceCallbacks {
+ public int i; // non-managed
+ public char c; // non-managed
+ public double d; // transactional
+ public short s; // transactional
+ public HashSet children; // non-managed
+ public Date loadTime; // non-managed
+
+ private int keyValue; // persistent--used as key field in application
identity
+ public float floatValue; // persistent
+ public int intValue; // persistent --primary key field
+
+ private static int nextKeyValue = 1;
+
+ public static int savedIntValue;
+ public static float savedFloatValue;
+
+ public static Date savedLoadTime;
+ public static String member1 = "one";
+ public static String member2 = "two";
+ public static String member3 = "three";
+
+ public static boolean preClearCalled = false;
+ public static boolean preStoreCalled = false;
+ public static boolean preDeleteCalled = false;
+ public static boolean postloadCalled = false;
+ public static boolean postloadCalledMultipleTimes = false;
+
+ // used in CallingJdoPostload test
+ public static int beforeGetObjectById = 1;
+ public static int afterGetObjectById = 2;
+ public static int savedApplicationStep;
+ public static int applicationStep; // values are 0, beforeGetObjectById
and afterGetObjectById
+
+ // used in ModificationOfNontransactionalNonpersistentFields test
+ public static ArrayList exceptions = new ArrayList();
+ public static ArrayList callbackCalled = new ArrayList();
+ public static ArrayList attributeOpCausingExceptions = new ArrayList();
+
+ public static void initializeStaticsForTest()
+ {
+ savedIntValue = 0;
+ savedFloatValue = 0.0f;
+ savedLoadTime = null;
+ preClearCalled = false;
+ preStoreCalled = false;
+ preDeleteCalled = false;
+ postloadCalled = false;
+ postloadCalledMultipleTimes = false;
+ savedApplicationStep = 0;
+ applicationStep = 0;
+
+ exceptions = new ArrayList();
+ callbackCalled = new ArrayList();
+ attributeOpCausingExceptions = new ArrayList();
+ }
+
+ public static void removeAllInstances(PersistenceManager pm)
+ {
+ Extent e =
pm.getExtent(org.apache.jdo.tck.pc.instancecallbacks.InstanceCallbackNonPersistFdsClass.class,
true);
+ Iterator i = e.iterator();
+ while( i.hasNext() ){
+ pm.deletePersistent(i.next());
+ }
+ }
+
+ public InstanceCallbackNonPersistFdsClass()
+ {
+ }
+
+ public InstanceCallbackNonPersistFdsClass(float floatValue,int intValue) {
+ keyValue = nextKeyValue++;
+ this.floatValue = floatValue;
+ this.intValue = intValue;
+ }
+
+ public void setNonPersist(int i, char c, double d, short s) {
+ this.i = i;
+ this.c = c;
+ this.d = d;
+ this.s = s;
+ }
+
+ public void setNonManaged(int i, char c) {
+ this.i = i;
+ this.c = c;
+ }
+
+ public int calcIntValue() {
+ return i * c;
+ }
+
+ public float calcFloatValue () {
+ return (float)(d * s);
+ }
+
+ public void incrementIntValue() {
+ intValue++;
+ }
+
+ public void jdoPreStore() {
+ preStoreCalled = true;
+ intValue = calcIntValue();
+ floatValue = calcFloatValue();
+
+ try {
+ i = -30;
+ }catch(Exception e) {
+ callbackCalled.add("jdoPreStore ");
+ exceptions.add(e);
+ attributeOpCausingExceptions.add("i = -30;");
+ }
+ try {
+ c = '\u0000';
+ }catch(Exception e) {
+ callbackCalled.add("jdoPreStore ");
+ exceptions.add(e);
+ attributeOpCausingExceptions.add("c = '\u0000';");
+ }
+ try {
+ d = 362.5;
+ }catch(Exception e) {
+ callbackCalled.add("jdoPreStore ");
+ exceptions.add(e);
+ attributeOpCausingExceptions.add("d = 362.5;");
+ }
+ try {
+ s = 0;
+ }catch(Exception e) {
+ callbackCalled.add("jdoPreStore ");
+ exceptions.add(e);
+ attributeOpCausingExceptions.add("s = 0;");
+ }
+ try {
+ loadTime = null;
+ }catch(Exception e) {
+ callbackCalled.add("jdoPreStore ");
+ exceptions.add(e);
+ attributeOpCausingExceptions.add("loadTime = null;");
+ }
+ try {
+ children = null;
+ }catch(Exception e) {
+ callbackCalled.add("jdoPreStore ");
+ exceptions.add(e);
+ attributeOpCausingExceptions.add("children = null;");
+ }
+ }
+
+ public void jdoPreDelete() {
+ preDeleteCalled = true;
+ try {
+ i = 0;
+ }catch(Exception e) {
+ callbackCalled.add("jdoPreDelete ");
+ exceptions.add(e);
+ attributeOpCausingExceptions.add("i = 0;");
+ }
+ try {
+ c = 'x';
+ }catch(Exception e) {
+ callbackCalled.add("jdoPreDelete ");
+ exceptions.add(e);
+ attributeOpCausingExceptions.add("c = 'x';");
+ }
+ try {
+ d = 0.0;
+ }catch(Exception e) {
+ callbackCalled.add("jdoPreDelete ");
+ exceptions.add(e);
+ attributeOpCausingExceptions.add("d = 0.0;");
+ }
+ try {
+ s = -5;
+ }catch(Exception e) {
+ callbackCalled.add("jdoPreDelete ");
+ exceptions.add(e);
+ attributeOpCausingExceptions.add("s = -5;");
+ }
+ try {
+ loadTime = null;
+ }catch(Exception e) {
+ callbackCalled.add("jdoPreDelete ");
+ exceptions.add(e);
+ attributeOpCausingExceptions.add("loadTime = null;");
+ }
+ try {
+ children = null;
+ }catch(Exception e) {
+ callbackCalled.add("jdoPreDelete ");
+ exceptions.add(e);
+ attributeOpCausingExceptions.add("children = null;");
+ }
+ }
+
+ public void jdoPostLoad() {
+ postloadCalled = true;
+ savedApplicationStep = applicationStep;
+ i = -10;
+ c = '2';
+ d = 30.0;
+ s = 40;
+ savedIntValue = intValue;
+ savedFloatValue = floatValue;
+ loadTime = new Date();
+ savedLoadTime = loadTime;
+ children = new HashSet();
+ children.add(member1);
+ children.add(member2);
+ children.add(member3);
+ }
+
+ public void jdoPreClear() {
+ preClearCalled = true;
+ try {
+ i = 1;
+ }catch(Exception e) {
+ callbackCalled.add("jdoPreClear ");
+ exceptions.add(e);
+ attributeOpCausingExceptions.add("i = 1;");
+ }
+ try {
+ c = '2';
+ }catch(Exception e) {
+ callbackCalled.add("jdoPreClear ");
+ exceptions.add(e);
+ attributeOpCausingExceptions.add("c = '2';");
+ }
+ try {
+ d = 3.0;
+ }catch(Exception e) {
+ callbackCalled.add("jdoPreClear ");
+ exceptions.add(e);
+ attributeOpCausingExceptions.add("d = 3.0;");
+ }
+ try {
+ s = 4;
+ }catch(Exception e) {
+ callbackCalled.add("jdoPreClear ");
+ exceptions.add(e);
+ attributeOpCausingExceptions.add("s = 4;");
+ }
+ try {
+ loadTime = null;
+ }catch(Exception e) {
+ callbackCalled.add("jdoPreClear ");
+ exceptions.add(e);
+ attributeOpCausingExceptions.add("loadTime = null;");
+ }
+ try {
+ children = null;
+ }catch(Exception e) {
+ callbackCalled.add("jdoPreClear ");
+ exceptions.add(e);
+ attributeOpCausingExceptions.add("children = null;");
+ }
+ }
+
+public static class KeyClass implements Serializable {
+ public int keyValue;
+
+ public KeyClass() {
+ }
+
+ public KeyClass(String s) {
+ try{ keyValue = Integer.parseInt(s);}
+ catch(NumberFormatException e){
+ keyValue = 0;}
+ }
+
+ public boolean equals(Object obj) {
+ if( obj == null || !this.getClass().equals(obj.getClass()) ) return
false;
+ else return keyValue == ((KeyClass)obj).keyValue;
+ }
+
+ public int hashCode() {
+ return keyValue;
+ }
+
+ public String toString() {
+ return Integer.toString(keyValue);
+ }
+}
+}
Propchange:
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/instancecallbacks/InstanceCallbackNonPersistFdsClass.java
------------------------------------------------------------------------------
svn:executable = *
Added:
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/lifecycle/StateTransitionObj.java
URL:
http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/lifecycle/StateTransitionObj.java?view=auto&rev=160090
==============================================================================
---
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/lifecycle/StateTransitionObj.java
(added)
+++
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/lifecycle/StateTransitionObj.java
Mon Apr 4 12:41:23 2005
@@ -0,0 +1,49 @@
+/*
+ * Copyright 2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+package org.apache.jdo.tck.pc.lifecycle;
+
+public class StateTransitionObj {
+ private int int_field;
+ private transient int nonmanaged_field;
+
+ public StateTransitionObj()
+ {
+ int_field = 0;
+ }
+ public StateTransitionObj(int v)
+ {
+ int_field = v;
+ }
+ public int readField()
+ {
+ int value = int_field;
+ return value;
+ }
+ public void writeField(int value)
+ {
+ int_field = value;
+ }
+ public int readNonmanagedField()
+ {
+ return nonmanaged_field;
+ }
+ public void writeNonmanagedField(int value)
+ {
+ nonmanaged_field = value;
+ }
+}
Propchange:
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/lifecycle/StateTransitionObj.java
------------------------------------------------------------------------------
svn:executable = *
Added:
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/mylib/PCPoint.java
URL:
http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/mylib/PCPoint.java?view=auto&rev=160090
==============================================================================
---
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/mylib/PCPoint.java
(added)
+++
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/mylib/PCPoint.java
Mon Apr 4 12:41:23 2005
@@ -0,0 +1,110 @@
+/*
+ * Copyright 2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.jdo.tck.pc.mylib;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+* A simple class with two fields for application identity
+*
+* @author Marina Vatkina
+*/
+public class PCPoint implements Serializable {
+
+
+ private static long counter = new Date().getTime();
+ private static long newId() {
+ synchronized (PCPoint.class) {
+ return counter++;
+ }
+ }
+ private long id = newId();
+ public int x;
+ public Integer y;
+
+ public PCPoint() {
+ }
+
+ public PCPoint(int x, int y) {
+ this.x = x;
+ this.y = new Integer(y);
+ }
+
+ public PCPoint(int x, Integer y) {
+ this.x = x;
+ this.y = y;
+ }
+
+ public String toString() {
+ String rc = null;
+ Object obj = this;
+ try {
+ rc = obj.getClass().getName();
+ //rc = Util.getClassName(this) + name();
+ } catch (NullPointerException ex) {
+ rc = "NPE getting PCPoint's values";
+ }
+ return rc;
+ }
+
+ public void setX(int x) {
+ this.x = x;
+ }
+
+ public int getX() {
+ return x;
+ }
+
+ public void setY(Integer y) {
+ this.y = y;
+ }
+
+ public Integer getY() {
+ return y;
+ }
+
+ public String name() {
+ return " x: " + getX() + ", y: " + getY().intValue();
+ }
+
+ public static class Oid implements Serializable {
+ public long id;
+
+ public Oid() {
+ }
+
+ public Oid(String s) { id = Long.parseLong(justTheId(s)); }
+
+ public String toString() { return this.getClass().getName() + ": " +
id;}
+
+ public int hashCode() { return (int)id ; }
+
+ public boolean equals(Object other) {
+ if (other != null && (other instanceof Oid)) {
+ Oid k = (Oid)other;
+ return k.id == this.id;
+ }
+ return false;
+ }
+
+ protected static String justTheId(String str) {
+ return str.substring(str.indexOf(':') + 1);
+ }
+
+ }
+}
Propchange:
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/mylib/PCPoint.java
------------------------------------------------------------------------------
svn:executable = *