db-jdo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From m..@apache.org
Subject svn commit: r219225 [2/2] - in /incubator/jdo/trunk/tck20: ./ test/conf/ test/java/org/apache/jdo/tck/ test/java/org/apache/jdo/tck/api/persistencecapable/ test/java/org/apache/jdo/tck/pc/singlefieldidentity/ test/java/org/apache/jdo/tck/util/ test/jdo...
Date Fri, 15 Jul 2005 17:45:06 GMT
Added: incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/singlefieldidentity/PCPointSingleFieldByte.java
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/singlefieldidentity/PCPointSingleFieldByte.java?rev=219225&view=auto
==============================================================================
--- incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/singlefieldidentity/PCPointSingleFieldByte.java (added)
+++ incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/singlefieldidentity/PCPointSingleFieldByte.java Fri Jul 15 10:45:04 2005
@@ -0,0 +1,105 @@
+/*
+ * 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.singlefieldidentity;
+
+import javax.jdo.identity.ByteIdentity;
+import javax.jdo.identity.SingleFieldIdentity;
+
+/**
+ * The PC class for testing <code>ByteIdentity</code>.
+ * @author Michael Watzek
+ */
+public class PCPointSingleFieldByte extends AbstractPCPointSingleField {
+    
+    /**
+     * Returns a unique value, used for primary key field initialization.
+     * @return a unique value
+     */
+    private static byte newId() {
+        synchronized (PCPointSingleFieldByte.class) {
+            return (byte) ((counter++) % Byte.MAX_VALUE);
+        }
+    }
+
+    /**
+     * The primary key field.
+     */
+    private Byte id = new Byte(newId());
+
+    public int x;
+    public Integer y;
+
+    /**
+     * This constructor is used by test cases checking assertion A7.12-38:<br>
+     * For classes using single field identity method 
+     * <code>PersistenceCapable.newObjectIdInstance()</code> must be called 
+     * on a persistent instance with its primary key field initialized, 
+     * or a JDOFatalInternalException is thrown.
+     */
+    public PCPointSingleFieldByte() {
+        this.id = null;
+    }
+
+    /**
+     * This constructor is used by test cases checking assertion A7.12-39:<br>
+     * The instance returned is initialized with the value of the primary key 
+     * field of the instance on which the method is called.
+     * @param x
+     * @param y
+     */
+    public PCPointSingleFieldByte(int x, int y) {
+        this.x = x;
+        this.y = new Integer(y);
+    }
+
+    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();
+    }
+
+    /**
+     * Returns <code>true</code> if the given the key of the given 
+     * <code>SingleFieldIdentity</code> instance equals the key in the subclass
+     * of this class.
+     * @param singleFieldIdentity the single field identity to check.
+     * @return returns <code>true</code> if the given the key of the given 
+     * <code>SingleFieldIdentity</code> instance equals the key in the subclass
+     * of this class.
+     */
+    public boolean equalsPKField(SingleFieldIdentity singleFieldIdentity) {
+        return this.id.byteValue()==((ByteIdentity)singleFieldIdentity).getKey();
+    }
+    
+    public String toString() {
+        return super.toString() + this.id;
+    }
+}

Added: incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/singlefieldidentity/PCPointSingleFieldCharacter.java
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/singlefieldidentity/PCPointSingleFieldCharacter.java?rev=219225&view=auto
==============================================================================
--- incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/singlefieldidentity/PCPointSingleFieldCharacter.java (added)
+++ incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/singlefieldidentity/PCPointSingleFieldCharacter.java Fri Jul 15 10:45:04 2005
@@ -0,0 +1,105 @@
+/*
+ * 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.singlefieldidentity;
+
+import javax.jdo.identity.CharIdentity;
+import javax.jdo.identity.SingleFieldIdentity;
+
+/**
+ * The PC class for testing <code>CharIdentity</code>.
+ * @author Michael Watzek
+ */
+public class PCPointSingleFieldCharacter extends AbstractPCPointSingleField {
+    
+    /**
+     * Returns a unique value, used for primary key field initialization.
+     * @return a unique value
+     */
+    private static char newId() {
+        synchronized (PCPointSingleFieldCharacter.class) {
+            return (char) ((counter++) % Character.MAX_VALUE);
+        }
+    }
+
+    /**
+     * The primary key field.
+     */
+    private Character id = new Character(newId());
+
+    public int x;
+    public Integer y;
+
+    /**
+     * This constructor is used by test cases checking assertion A7.12-38:<br>
+     * For classes using single field identity method 
+     * <code>PersistenceCapable.newObjectIdInstance()</code> must be called 
+     * on a persistent instance with its primary key field initialized, 
+     * or a JDOFatalInternalException is thrown.
+     */
+    public PCPointSingleFieldCharacter() {
+        this.id = null;
+    }
+
+    /**
+     * This constructor is used by test cases checking assertion A7.12-39:<br>
+     * The instance returned is initialized with the value of the primary key 
+     * field of the instance on which the method is called.
+     * @param x
+     * @param y
+     */
+    public PCPointSingleFieldCharacter(int x, int y) {
+        this.x = x;
+        this.y = new Integer(y);
+    }
+
+    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();
+    }
+
+    /**
+     * Returns <code>true</code> if the given the key of the given 
+     * <code>SingleFieldIdentity</code> instance equals the key in the subclass
+     * of this class.
+     * @param singleFieldIdentity the single field identity to check.
+     * @return returns <code>true</code> if the given the key of the given 
+     * <code>SingleFieldIdentity</code> instance equals the key in the subclass
+     * of this class.
+     */
+    public boolean equalsPKField(SingleFieldIdentity singleFieldIdentity) {
+        return this.id.charValue()==((CharIdentity)singleFieldIdentity).getKey();
+    }
+    
+    public String toString() {
+        return super.toString() + this.id;
+    }
+}

Added: incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/singlefieldidentity/PCPointSingleFieldDate.java
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/singlefieldidentity/PCPointSingleFieldDate.java?rev=219225&view=auto
==============================================================================
--- incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/singlefieldidentity/PCPointSingleFieldDate.java (added)
+++ incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/singlefieldidentity/PCPointSingleFieldDate.java Fri Jul 15 10:45:04 2005
@@ -0,0 +1,107 @@
+/*
+ * 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.singlefieldidentity;
+
+import java.util.Date;
+
+import javax.jdo.identity.SingleFieldIdentity;
+import javax.jdo.identity.StringIdentity;
+
+/**
+ * The PC class for testing <code>ObjectIdentity</code>.
+ * @author Michael Watzek
+ */
+public class PCPointSingleFieldDate extends AbstractPCPointSingleField {
+    
+    /**
+     * Returns a unique value, used for primary key field initialization.
+     * @return a unique value
+     */
+    private static long newId() {
+        synchronized (PCPointSingleFieldDate.class) {
+            return counter++;
+        }
+    }
+
+    /**
+     * The primary key field.
+     */
+    private Date id = new Date(newId());
+
+    public int x;
+    public Integer y;
+
+    /**
+     * This constructor is used by test cases checking assertion A7.12-38:<br>
+     * For classes using single field identity method 
+     * <code>PersistenceCapable.newObjectIdInstance()</code> must be called 
+     * on a persistent instance with its primary key field initialized, 
+     * or a JDOFatalInternalException is thrown.
+     */
+    public PCPointSingleFieldDate() {
+        this.id = null;
+    }
+
+    /**
+     * This constructor is used by test cases checking assertion A7.12-39:<br>
+     * The instance returned is initialized with the value of the primary key 
+     * field of the instance on which the method is called.
+     * @param x
+     * @param y
+     */
+    public PCPointSingleFieldDate(int x, int y) {
+        this.x = x;
+        this.y = new Integer(y);
+    }
+
+    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();
+    }
+
+    /**
+     * Returns <code>true</code> if the given the key of the given 
+     * <code>SingleFieldIdentity</code> instance equals the key in the subclass
+     * of this class.
+     * @param singleFieldIdentity the single field identity to check.
+     * @return returns <code>true</code> if the given the key of the given 
+     * <code>SingleFieldIdentity</code> instance equals the key in the subclass
+     * of this class.
+     */
+    public boolean equalsPKField(SingleFieldIdentity singleFieldIdentity) {
+        return this.id.equals(((StringIdentity)singleFieldIdentity).getKey());
+    }
+    
+    public String toString() {
+        return super.toString() + this.id;
+    }
+}

Added: incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/singlefieldidentity/PCPointSingleFieldInteger.java
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/singlefieldidentity/PCPointSingleFieldInteger.java?rev=219225&view=auto
==============================================================================
--- incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/singlefieldidentity/PCPointSingleFieldInteger.java (added)
+++ incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/singlefieldidentity/PCPointSingleFieldInteger.java Fri Jul 15 10:45:04 2005
@@ -0,0 +1,105 @@
+/*
+ * 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.singlefieldidentity;
+
+import javax.jdo.identity.IntIdentity;
+import javax.jdo.identity.SingleFieldIdentity;
+
+/**
+ * The PC class for testing <code>IntIdentity</code>.
+ * @author Michael Watzek
+ */
+public class PCPointSingleFieldInteger extends AbstractPCPointSingleField {
+    
+    /**
+     * Returns a unique value, used for primary key field initialization.
+     * @return a unique value
+     */
+    private static int newId() {
+        synchronized (PCPointSingleFieldInteger.class) {
+            return (int) ((counter++) % Integer.MAX_VALUE);
+        }
+    }
+
+    /**
+     * The primary key field.
+     */
+    private Integer id = new Integer(newId());
+
+    public int x;
+    public Integer y;
+
+    /**
+     * This constructor is used by test cases checking assertion A7.12-38:<br>
+     * For classes using single field identity method 
+     * <code>PersistenceCapable.newObjectIdInstance()</code> must be called 
+     * on a persistent instance with its primary key field initialized, 
+     * or a JDOFatalInternalException is thrown.
+     */
+    public PCPointSingleFieldInteger() {
+        this.id = null;
+    }
+
+    /**
+     * This constructor is used by test cases checking assertion A7.12-39:<br>
+     * The instance returned is initialized with the value of the primary key 
+     * field of the instance on which the method is called.
+     * @param x
+     * @param y
+     */
+    public PCPointSingleFieldInteger(int x, int y) {
+        this.x = x;
+        this.y = new Integer(y);
+    }
+
+    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();
+    }
+
+    /**
+     * Returns <code>true</code> if the given the key of the given 
+     * <code>SingleFieldIdentity</code> instance equals the key in the subclass
+     * of this class.
+     * @param singleFieldIdentity the single field identity to check.
+     * @return returns <code>true</code> if the given the key of the given 
+     * <code>SingleFieldIdentity</code> instance equals the key in the subclass
+     * of this class.
+     */
+    public boolean equalsPKField(SingleFieldIdentity singleFieldIdentity) {
+        return this.id.intValue()==((IntIdentity)singleFieldIdentity).getKey();
+    }
+    
+    public String toString() {
+        return super.toString() + this.id;
+    }
+}

Added: incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/singlefieldidentity/PCPointSingleFieldLong.java
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/singlefieldidentity/PCPointSingleFieldLong.java?rev=219225&view=auto
==============================================================================
--- incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/singlefieldidentity/PCPointSingleFieldLong.java (added)
+++ incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/singlefieldidentity/PCPointSingleFieldLong.java Fri Jul 15 10:45:04 2005
@@ -0,0 +1,105 @@
+/*
+ * 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.singlefieldidentity;
+
+import javax.jdo.identity.LongIdentity;
+import javax.jdo.identity.SingleFieldIdentity;
+
+/**
+ * The PC class for testing <code>LongIdentity</code>.
+ * @author Michael Watzek
+ */
+public class PCPointSingleFieldLong extends AbstractPCPointSingleField {
+    
+    /**
+     * Returns a unique value, used for primary key field initialization.
+     * @return a unique value
+     */
+    private static long newId() {
+        synchronized (PCPointSingleFieldLong.class) {
+            return counter++;
+        }
+    }
+
+    /**
+     * The primary key field.
+     */
+    private Long id = new Long(newId());
+
+    public int x;
+    public Integer y;
+
+    /**
+     * This constructor is used by test cases checking assertion A7.12-38:<br>
+     * For classes using single field identity method 
+     * <code>PersistenceCapable.newObjectIdInstance()</code> must be called 
+     * on a persistent instance with its primary key field initialized, 
+     * or a JDOFatalInternalException is thrown.
+     */
+    public PCPointSingleFieldLong() {
+        this.id = null;
+    }
+
+    /**
+     * This constructor is used by test cases checking assertion A7.12-39:<br>
+     * The instance returned is initialized with the value of the primary key 
+     * field of the instance on which the method is called.
+     * @param x
+     * @param y
+     */
+    public PCPointSingleFieldLong(int x, int y) {
+        this.x = x;
+        this.y = new Integer(y);
+    }
+
+    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();
+    }
+
+    /**
+     * Returns <code>true</code> if the given the key of the given 
+     * <code>SingleFieldIdentity</code> instance equals the key in the subclass
+     * of this class.
+     * @param singleFieldIdentity the single field identity to check.
+     * @return returns <code>true</code> if the given the key of the given 
+     * <code>SingleFieldIdentity</code> instance equals the key in the subclass
+     * of this class.
+     */
+    public boolean equalsPKField(SingleFieldIdentity singleFieldIdentity) {
+        return this.id.longValue()==((LongIdentity)singleFieldIdentity).getKey();
+    }
+    
+    public String toString() {
+        return super.toString() + this.id;
+    }
+}

Added: incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/singlefieldidentity/PCPointSingleFieldPrimitivebyte.java
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/singlefieldidentity/PCPointSingleFieldPrimitivebyte.java?rev=219225&view=auto
==============================================================================
--- incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/singlefieldidentity/PCPointSingleFieldPrimitivebyte.java (added)
+++ incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/singlefieldidentity/PCPointSingleFieldPrimitivebyte.java Fri Jul 15 10:45:04 2005
@@ -0,0 +1,94 @@
+/*
+ * 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.singlefieldidentity;
+
+import javax.jdo.identity.ByteIdentity;
+import javax.jdo.identity.SingleFieldIdentity;
+
+/**
+ * The PC class for testing <code>ByteIdentity</code>.
+ * @author Michael Watzek
+ */
+public class PCPointSingleFieldPrimitivebyte extends AbstractPCPointSingleField {
+    
+    /**
+     * Returns a unique value, used for primary key field initialization.
+     * @return a unique value
+     */
+    private static byte newId() {
+        synchronized (PCPointSingleFieldPrimitivebyte.class) {
+            return (byte) ((counter++) % Byte.MAX_VALUE);
+        }
+    }
+
+    /**
+     * The primary key field.
+     */
+    private byte id = newId();
+
+    public int x;
+    public Integer y;
+
+    /**
+     * This constructor is used by test cases checking assertion A7.12-39:<br>
+     * The instance returned is initialized with the value of the primary key 
+     * field of the instance on which the method is called.
+     * @param x
+     * @param y
+     */
+    public PCPointSingleFieldPrimitivebyte(int x, int y) {
+        this.x = x;
+        this.y = new Integer(y);
+    }
+
+    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();
+    }
+
+    /**
+     * Returns <code>true</code> if the given the key of the given 
+     * <code>SingleFieldIdentity</code> instance equals the key in the subclass
+     * of this class.
+     * @param singleFieldIdentity the single field identity to check.
+     * @return returns <code>true</code> if the given the key of the given 
+     * <code>SingleFieldIdentity</code> instance equals the key in the subclass
+     * of this class.
+     */
+    public boolean equalsPKField(SingleFieldIdentity singleFieldIdentity) {
+        return this.id==((ByteIdentity)singleFieldIdentity).getKey();
+    }
+    
+    public String toString() {
+        return super.toString() + this.id;
+    }
+}

Added: incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/singlefieldidentity/PCPointSingleFieldPrimitivechar.java
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/singlefieldidentity/PCPointSingleFieldPrimitivechar.java?rev=219225&view=auto
==============================================================================
--- incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/singlefieldidentity/PCPointSingleFieldPrimitivechar.java (added)
+++ incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/singlefieldidentity/PCPointSingleFieldPrimitivechar.java Fri Jul 15 10:45:04 2005
@@ -0,0 +1,94 @@
+/*
+ * 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.singlefieldidentity;
+
+import javax.jdo.identity.CharIdentity;
+import javax.jdo.identity.SingleFieldIdentity;
+
+/**
+ * The PC class for testing <code>CharIdentity</code>.
+ * @author Michael Watzek
+ */
+public class PCPointSingleFieldPrimitivechar extends AbstractPCPointSingleField {
+    
+    /**
+     * Returns a unique value, used for primary key field initialization.
+     * @return a unique value
+     */
+    private static char newId() {
+        synchronized (PCPointSingleFieldPrimitivechar.class) {
+            return (char) ((counter++) % Character.MAX_VALUE);
+        }
+    }
+
+    /**
+     * The primary key field.
+     */
+    private char id = newId();
+
+    public int x;
+    public Integer y;
+
+    /**
+     * This constructor is used by test cases checking assertion A7.12-39:<br>
+     * The instance returned is initialized with the value of the primary key 
+     * field of the instance on which the method is called.
+     * @param x
+     * @param y
+     */
+    public PCPointSingleFieldPrimitivechar(int x, int y) {
+        this.x = x;
+        this.y = new Integer(y);
+    }
+
+    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();
+    }
+
+    /**
+     * Returns <code>true</code> if the given the key of the given 
+     * <code>SingleFieldIdentity</code> instance equals the key in the subclass
+     * of this class.
+     * @param singleFieldIdentity the single field identity to check.
+     * @return returns <code>true</code> if the given the key of the given 
+     * <code>SingleFieldIdentity</code> instance equals the key in the subclass
+     * of this class.
+     */
+    public boolean equalsPKField(SingleFieldIdentity singleFieldIdentity) {
+        return this.id==((CharIdentity)singleFieldIdentity).getKey();
+    }
+    
+    public String toString() {
+        return super.toString() + this.id;
+    }
+}

Added: incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/singlefieldidentity/PCPointSingleFieldPrimitiveint.java
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/singlefieldidentity/PCPointSingleFieldPrimitiveint.java?rev=219225&view=auto
==============================================================================
--- incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/singlefieldidentity/PCPointSingleFieldPrimitiveint.java (added)
+++ incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/singlefieldidentity/PCPointSingleFieldPrimitiveint.java Fri Jul 15 10:45:04 2005
@@ -0,0 +1,94 @@
+/*
+ * 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.singlefieldidentity;
+
+import javax.jdo.identity.IntIdentity;
+import javax.jdo.identity.SingleFieldIdentity;
+
+/**
+ * The PC class for testing <code>IntIdentity</code>.
+ * @author Michael Watzek
+ */
+public class PCPointSingleFieldPrimitiveint extends AbstractPCPointSingleField {
+    
+    /**
+     * Returns a unique value, used for primary key field initialization.
+     * @return a unique value
+     */
+    private static int newId() {
+        synchronized (PCPointSingleFieldPrimitiveint.class) {
+            return (int) ((counter++) % Integer.MAX_VALUE);
+        }
+    }
+
+    /**
+     * The primary key field.
+     */
+    private int id = newId();
+
+    public int x;
+    public Integer y;
+
+    /**
+     * This constructor is used by test cases checking assertion A7.12-39:<br>
+     * The instance returned is initialized with the value of the primary key 
+     * field of the instance on which the method is called.
+     * @param x
+     * @param y
+     */
+    public PCPointSingleFieldPrimitiveint(int x, int y) {
+        this.x = x;
+        this.y = new Integer(y);
+    }
+
+    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();
+    }
+
+    /**
+     * Returns <code>true</code> if the given the key of the given 
+     * <code>SingleFieldIdentity</code> instance equals the key in the subclass
+     * of this class.
+     * @param singleFieldIdentity the single field identity to check.
+     * @return returns <code>true</code> if the given the key of the given 
+     * <code>SingleFieldIdentity</code> instance equals the key in the subclass
+     * of this class.
+     */
+    public boolean equalsPKField(SingleFieldIdentity singleFieldIdentity) {
+        return this.id==((IntIdentity)singleFieldIdentity).getKey();
+    }
+    
+    public String toString() {
+        return super.toString() + this.id;
+    }
+}

Added: incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/singlefieldidentity/PCPointSingleFieldPrimitivelong.java
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/singlefieldidentity/PCPointSingleFieldPrimitivelong.java?rev=219225&view=auto
==============================================================================
--- incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/singlefieldidentity/PCPointSingleFieldPrimitivelong.java (added)
+++ incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/singlefieldidentity/PCPointSingleFieldPrimitivelong.java Fri Jul 15 10:45:04 2005
@@ -0,0 +1,94 @@
+/*
+ * 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.singlefieldidentity;
+
+import javax.jdo.identity.LongIdentity;
+import javax.jdo.identity.SingleFieldIdentity;
+
+/**
+ * The PC class for testing <code>LongIdentity</code>.
+ * @author Michael Watzek
+ */
+public class PCPointSingleFieldPrimitivelong extends AbstractPCPointSingleField {
+    
+    /**
+     * Returns a unique value, used for primary key field initialization.
+     * @return a unique value
+     */
+    private static long newId() {
+        synchronized (PCPointSingleFieldPrimitivelong.class) {
+            return counter++;
+        }
+    }
+
+    /**
+     * The primary key field.
+     */
+    private long id = newId();
+
+    public int x;
+    public Integer y;
+
+    /**
+     * This constructor is used by test cases checking assertion A7.12-39:<br>
+     * The instance returned is initialized with the value of the primary key 
+     * field of the instance on which the method is called.
+     * @param x
+     * @param y
+     */
+    public PCPointSingleFieldPrimitivelong(int x, int y) {
+        this.x = x;
+        this.y = new Integer(y);
+    }
+
+    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();
+    }
+
+    /**
+     * Returns <code>true</code> if the given the key of the given 
+     * <code>SingleFieldIdentity</code> instance equals the key in the subclass
+     * of this class.
+     * @param singleFieldIdentity the single field identity to check.
+     * @return returns <code>true</code> if the given the key of the given 
+     * <code>SingleFieldIdentity</code> instance equals the key in the subclass
+     * of this class.
+     */
+    public boolean equalsPKField(SingleFieldIdentity singleFieldIdentity) {
+        return this.id==((LongIdentity)singleFieldIdentity).getKey();
+    }
+    
+    public String toString() {
+        return super.toString() + this.id;
+    }
+}

Added: incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/singlefieldidentity/PCPointSingleFieldPrimitiveshort.java
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/singlefieldidentity/PCPointSingleFieldPrimitiveshort.java?rev=219225&view=auto
==============================================================================
--- incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/singlefieldidentity/PCPointSingleFieldPrimitiveshort.java (added)
+++ incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/singlefieldidentity/PCPointSingleFieldPrimitiveshort.java Fri Jul 15 10:45:04 2005
@@ -0,0 +1,94 @@
+/*
+ * 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.singlefieldidentity;
+
+import javax.jdo.identity.ShortIdentity;
+import javax.jdo.identity.SingleFieldIdentity;
+
+/**
+ * The PC class for testing <code>ShortIdentity</code>.
+ * @author Michael Watzek
+ */
+public class PCPointSingleFieldPrimitiveshort extends AbstractPCPointSingleField {
+    
+    /**
+     * Returns a unique value, used for primary key field initialization.
+     * @return a unique value
+     */
+    private static short newId() {
+        synchronized (PCPointSingleFieldPrimitiveshort.class) {
+            return (short) ((counter++) % Short.MAX_VALUE);
+        }
+    }
+
+    /**
+     * The primary key field.
+     */
+    private short id = newId();
+
+    public int x;
+    public Integer y;
+
+    /**
+     * This constructor is used by test cases checking assertion A7.12-39:<br>
+     * The instance returned is initialized with the value of the primary key 
+     * field of the instance on which the method is called.
+     * @param x
+     * @param y
+     */
+    public PCPointSingleFieldPrimitiveshort(int x, int y) {
+        this.x = x;
+        this.y = new Integer(y);
+    }
+
+    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();
+    }
+
+    /**
+     * Returns <code>true</code> if the given the key of the given 
+     * <code>SingleFieldIdentity</code> instance equals the key in the subclass
+     * of this class.
+     * @param singleFieldIdentity the single field identity to check.
+     * @return returns <code>true</code> if the given the key of the given 
+     * <code>SingleFieldIdentity</code> instance equals the key in the subclass
+     * of this class.
+     */
+    public boolean equalsPKField(SingleFieldIdentity singleFieldIdentity) {
+        return this.id==((ShortIdentity)singleFieldIdentity).getKey();
+    }
+    
+    public String toString() {
+        return super.toString() + this.id;
+    }
+}

Added: incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/singlefieldidentity/PCPointSingleFieldShort.java
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/singlefieldidentity/PCPointSingleFieldShort.java?rev=219225&view=auto
==============================================================================
--- incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/singlefieldidentity/PCPointSingleFieldShort.java (added)
+++ incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/singlefieldidentity/PCPointSingleFieldShort.java Fri Jul 15 10:45:04 2005
@@ -0,0 +1,105 @@
+/*
+ * 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.singlefieldidentity;
+
+import javax.jdo.identity.ShortIdentity;
+import javax.jdo.identity.SingleFieldIdentity;
+
+/**
+ * The PC class for testing <code>ShortIdentity</code>.
+ * @author Michael Watzek
+ */
+public class PCPointSingleFieldShort extends AbstractPCPointSingleField {
+    
+    /**
+     * Returns a unique value, used for primary key field initialization.
+     * @return a unique value
+     */
+    private static short newId() {
+        synchronized (PCPointSingleFieldShort.class) {
+            return (short) ((counter++) % Short.MAX_VALUE);
+        }
+    }
+
+    /**
+     * The primary key field.
+     */
+    private Short id = new Short(newId());
+
+    public int x;
+    public Integer y;
+
+    /**
+     * This constructor is used by test cases checking assertion A7.12-38:<br>
+     * For classes using single field identity method 
+     * <code>PersistenceCapable.newObjectIdInstance()</code> must be called 
+     * on a persistent instance with its primary key field initialized, 
+     * or a JDOFatalInternalException is thrown.
+     */
+    public PCPointSingleFieldShort() {
+        this.id = null;
+    }
+
+    /**
+     * This constructor is used by test cases checking assertion A7.12-39:<br>
+     * The instance returned is initialized with the value of the primary key 
+     * field of the instance on which the method is called.
+     * @param x
+     * @param y
+     */
+    public PCPointSingleFieldShort(int x, int y) {
+        this.x = x;
+        this.y = new Integer(y);
+    }
+
+    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();
+    }
+
+    /**
+     * Returns <code>true</code> if the given the key of the given 
+     * <code>SingleFieldIdentity</code> instance equals the key in the subclass
+     * of this class.
+     * @param singleFieldIdentity the single field identity to check.
+     * @return returns <code>true</code> if the given the key of the given 
+     * <code>SingleFieldIdentity</code> instance equals the key in the subclass
+     * of this class.
+     */
+    public boolean equalsPKField(SingleFieldIdentity singleFieldIdentity) {
+        return this.id.shortValue()==((ShortIdentity)singleFieldIdentity).getKey();
+    }
+    
+    public String toString() {
+        return super.toString() + this.id;
+    }
+}

Added: incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/singlefieldidentity/PCPointSingleFieldString.java
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/singlefieldidentity/PCPointSingleFieldString.java?rev=219225&view=auto
==============================================================================
--- incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/singlefieldidentity/PCPointSingleFieldString.java (added)
+++ incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/singlefieldidentity/PCPointSingleFieldString.java Fri Jul 15 10:45:04 2005
@@ -0,0 +1,105 @@
+/*
+ * 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.singlefieldidentity;
+
+import javax.jdo.identity.SingleFieldIdentity;
+import javax.jdo.identity.StringIdentity;
+
+/**
+ * The PC class for testing <code>StringIdentity</code>.
+ * @author Michael Watzek
+ */
+public class PCPointSingleFieldString extends AbstractPCPointSingleField {
+    
+    /**
+     * Returns a unique value, used for primary key field initialization.
+     * @return a unique value
+     */
+    private static long newId() {
+        synchronized (PCPointSingleFieldString.class) {
+            return counter++;
+        }
+    }
+
+    /**
+     * The primary key field.
+     */
+    private String id = Long.toString(newId());
+
+    public int x;
+    public Integer y;
+
+    /**
+     * This constructor is used by test cases checking assertion A7.12-38:<br>
+     * For classes using single field identity method 
+     * <code>PersistenceCapable.newObjectIdInstance()</code> must be called 
+     * on a persistent instance with its primary key field initialized, 
+     * or a JDOFatalInternalException is thrown.
+     */
+    public PCPointSingleFieldString() {
+        this.id = null;
+    }
+
+    /**
+     * This constructor is used by test cases checking assertion A7.12-39:<br>
+     * The instance returned is initialized with the value of the primary key 
+     * field of the instance on which the method is called.
+     * @param x
+     * @param y
+     */
+    public PCPointSingleFieldString(int x, int y) {
+        this.x = x;
+        this.y = new Integer(y);
+    }
+
+    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();
+    }
+
+    /**
+     * Returns <code>true</code> if the given the key of the given 
+     * <code>SingleFieldIdentity</code> instance equals the key in the subclass
+     * of this class.
+     * @param singleFieldIdentity the single field identity to check.
+     * @return returns <code>true</code> if the given the key of the given 
+     * <code>SingleFieldIdentity</code> instance equals the key in the subclass
+     * of this class.
+     */
+    public boolean equalsPKField(SingleFieldIdentity singleFieldIdentity) {
+        return this.id.equals(((StringIdentity)singleFieldIdentity).getKey());
+    }
+    
+    public String toString() {
+        return super.toString() + this.id;
+    }
+}

Modified: incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/util/BatchResultPrinter.java
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/util/BatchResultPrinter.java?rev=219225&r1=219224&r2=219225&view=diff
==============================================================================
--- incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/util/BatchResultPrinter.java (original)
+++ incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/util/BatchResultPrinter.java Fri Jul 15 10:45:04 2005
@@ -17,10 +17,16 @@
 package org.apache.jdo.tck.util;
 
 import java.io.PrintStream;
+import java.text.DecimalFormat;
+import java.util.Arrays;
+import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.Map;
 
 import junit.framework.AssertionFailedError;
 import junit.framework.Test;
 import junit.framework.TestCase;
+import junit.framework.TestFailure;
 import junit.framework.TestResult;
 import junit.textui.ResultPrinter;
 
@@ -33,6 +39,9 @@
     extends ResultPrinter
 {
     /** */
+    private long runtime;
+    
+    /** */
     public BatchResultPrinter(PrintStream writer) {
         super(writer);
     }
@@ -61,14 +70,15 @@
         else {
             testName = test.toString();
         }
-        getWriter().print("RUN " + testName);
+        getWriter().print("RUN " + testName + '\t');
+        getWriter().flush();
     }
         
     /** */
     protected void printHeader(long runTime) {
+        this.runtime = runTime;
+        getWriter().println("Description: " + System.getProperty("jdo.tck.description"));    
         getWriter().println("Time: "+elapsedTimeAsString(runTime));
-        getWriter().println("Description: " +
-                            System.getProperty("jdo.tck.description"));
     }
         
     /** */
@@ -79,9 +89,11 @@
                 
         } else {
             getWriter().println("FAILURES!!!");
+            printErrorSummery(result);
             getWriter().println("Tests run: "+result.runCount()+ 
                                 ",  Failures: "+result.failureCount()+
-                                ",  Errors: "+result.errorCount());
+                                ",  Errors: "+result.errorCount()+
+                                ", Time: "+elapsedTimeAsString(this.runtime)+" seconds.");
         }
     }
         
@@ -100,6 +112,85 @@
         return className;
     }
         
+    private void printErrorSummery(TestResult result) {
+        Object[] array = getSortedArrayOfErrorSummeryEntries(result);
+        if (array.length>0) {
+            getWriter().println("Error summery:");
+            for (int i=0; i<array.length; i++) {
+                getWriter().println(array[i]);
+            }
+        }
+    }
+    
+    private static Object[] getSortedArrayOfErrorSummeryEntries(TestResult result) {
+        Map map = new HashMap();
+        for (Enumeration e=result.errors(); e.hasMoreElements(); ) {
+            TestFailure testFailure = (TestFailure) e.nextElement();
+            Throwable t = testFailure.thrownException();
+            String message = getRootCause(t).toString();
+            ErrorSummeryEntry errorSummeryEntry = (ErrorSummeryEntry) map.get(message);
+            if (errorSummeryEntry==null ) {
+                errorSummeryEntry = new ErrorSummeryEntry(t);
+                map.put(message, errorSummeryEntry);
+            }
+            errorSummeryEntry.count++;   
+        }
+        
+        Object[] array = map.values().toArray();
+        Arrays.sort(array);
+        return array;
+    }
+    
+    private static Throwable getRootCause(Throwable t) {
+        while (t.getCause()!=null) {
+            t = t.getCause();
+        }
+        return t;
+    }
+    
+    private static class ErrorSummeryEntry implements Comparable {
+        private static DecimalFormat decimalFormat = new DecimalFormat("000");
+        private int count = 0;
+        private Throwable t;
+        
+        private ErrorSummeryEntry(Throwable t) {
+            this.t = t;
+        }
+        
+        public boolean equals(Object o) {
+            return compareTo(o)==0;
+        }
+        
+        public int hashCode() {
+            return this.count;
+        }
+        
+        public int compareTo(Object o) {
+            int result = this.count - ((ErrorSummeryEntry)o).count;
+            if (result==0) {
+                String message1 = getRootCause().toString();
+                String message2 = 
+                    ((ErrorSummeryEntry)o).getRootCause().toString();
+                result = message1.compareTo(message2);
+            }
+            return result;
+        }
+        
+        public String toString() {
+            StringBuffer buffer = 
+                new StringBuffer(decimalFormat.format(count));
+            buffer.append(" error" );
+            if (this.count!=1) {
+                buffer.append("s: ");
+            } else {
+                buffer.append(":  ");
+            }
+            buffer.append(getRootCause());
+            return buffer.toString();
+        }
+        
+        private Throwable getRootCause() {
+            return BatchResultPrinter.getRootCause(this.t);
+        }
+    }
 }
-
-

Added: incubator/jdo/trunk/tck20/test/jdo/applicationidentity/org/apache/jdo/tck/pc/singlefieldidentity/package.jdo
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck20/test/jdo/applicationidentity/org/apache/jdo/tck/pc/singlefieldidentity/package.jdo?rev=219225&view=auto
==============================================================================
--- incubator/jdo/trunk/tck20/test/jdo/applicationidentity/org/apache/jdo/tck/pc/singlefieldidentity/package.jdo (added)
+++ incubator/jdo/trunk/tck20/test/jdo/applicationidentity/org/apache/jdo/tck/pc/singlefieldidentity/package.jdo Fri Jul 15 10:45:04 2005
@@ -0,0 +1,64 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE jdo PUBLIC "-//Sun Microsystems, Inc.//DTD Java Data Objects Metadata 2.0//EN" "http://java.sun.com/dtd/jdo_2_0.dtd">
+
+<jdo>
+  <package name="org.apache.jdo.tck.pc.singlefieldidentity">
+
+    <class name="PCPointSingleFieldPrimitivebyte"
+           identity-type="application" objectid-class="javax.jdo.identity.ByteIdentity">
+      <field name="id" primary-key="true"/>
+    </class>
+
+    <class name="PCPointSingleFieldByte"
+           identity-type="application" objectid-class="javax.jdo.identity.ByteIdentity">
+      <field name="id" primary-key="true"/>
+    </class>
+
+    <class name="PCPointSingleFieldPrimitivechar"
+           identity-type="application" objectid-class="javax.jdo.identity.CharIdentity">
+      <field name="id" primary-key="true"/>
+    </class>
+
+    <class name="PCPointSingleFieldCharacter"
+           identity-type="application" objectid-class="javax.jdo.identity.CharIdentity">
+      <field name="id" primary-key="true"/>
+    </class>
+
+    <class name="PCPointSingleFieldPrimitiveint"
+           identity-type="application" objectid-class="javax.jdo.identity.IntIdentity">
+      <field name="id" primary-key="true"/>
+    </class>
+
+    <class name="PCPointSingleFieldInteger"
+           identity-type="application" objectid-class="javax.jdo.identity.IntIdentity">
+      <field name="id" primary-key="true"/>
+    </class>
+
+    <class name="PCPointSingleFieldPrimitivelong"
+           identity-type="application" objectid-class="javax.jdo.identity.LongIdentity">
+      <field name="id" primary-key="true"/>
+    </class>
+
+    <class name="PCPointSingleFieldLong"
+           identity-type="application" objectid-class="javax.jdo.identity.LongIdentity">
+      <field name="id" primary-key="true"/>
+    </class>
+
+    <class name="PCPointSingleFieldPrimitiveshort"
+           identity-type="application" objectid-class="javax.jdo.identity.ShortIdentity">
+      <field name="id" primary-key="true"/>
+    </class>
+
+    <class name="PCPointSingleFieldShort"
+           identity-type="application" objectid-class="javax.jdo.identity.ShortIdentity">
+      <field name="id" primary-key="true"/>
+    </class>
+
+    <class name="PCPointSingleFieldString"
+           identity-type="application" objectid-class="javax.jdo.identity.StringIdentity">
+      <field name="id" primary-key="true"/>
+    </class>
+
+  </package>
+</jdo>
+

Added: incubator/jdo/trunk/tck20/test/orm/applicationidentity/org/apache/jdo/tck/pc/singlefieldidentity/package-derby.orm
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck20/test/orm/applicationidentity/org/apache/jdo/tck/pc/singlefieldidentity/package-derby.orm?rev=219225&view=auto
==============================================================================
--- incubator/jdo/trunk/tck20/test/orm/applicationidentity/org/apache/jdo/tck/pc/singlefieldidentity/package-derby.orm (added)
+++ incubator/jdo/trunk/tck20/test/orm/applicationidentity/org/apache/jdo/tck/pc/singlefieldidentity/package-derby.orm Fri Jul 15 10:45:04 2005
@@ -0,0 +1,80 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE orm PUBLIC "-//Sun Microsystems, Inc.//DTD Java Data Objects Mapping Metadata 2.0//EN" "http://java.sun.com/dtd/orm_2_0.dtd">
+<orm>
+  <package name="org.apache.jdo.tck.pc.singlefieldidentity">
+
+    <class name="PCPointSingleFieldPrimitivebyte" table="PCPointSingleFieldByte">
+      <field name="id" column="ID" primary-key="true"/>
+      <field name="x" column="X"/>
+      <field name="y" column="Y"/>
+    </class>
+
+    <class name="PCPointSingleFieldByte" table="PCPointSingleFieldByte">
+      <field name="id" column="ID" primary-key="true"/>
+      <field name="x" column="X"/>
+      <field name="y" column="Y"/>
+    </class>
+
+    <class name="PCPointSingleFieldPrimitivechar" table="PCPointSingleFieldChar">
+      <field name="id" column="ID" primary-key="true"/>
+      <field name="x" column="X"/>
+      <field name="y" column="Y"/>
+    </class>
+
+    <class name="PCPointSingleFieldCharacter" table="PCPointSingleFieldChar">
+      <field name="id" column="ID" primary-key="true"/>
+      <field name="x" column="X"/>
+      <field name="y" column="Y"/>
+    </class>
+
+    <class name="PCPointSingleFieldPrimitiveint" table="PCPointSingleFieldInteger">
+      <field name="id" column="ID" primary-key="true"/>
+      <field name="x" column="X"/>
+      <field name="y" column="Y"/>
+    </class>
+
+    <class name="PCPointSingleFieldInteger" table="PCPointSingleFieldInteger">
+      <field name="id" column="ID" primary-key="true"/>
+      <field name="x" column="X"/>
+      <field name="y" column="Y"/>
+    </class>
+
+    <class name="PCPointSingleFieldPrimitivelong" table="PCPointSingleFieldLong">
+      <field name="id" column="ID" primary-key="true"/>
+      <field name="x" column="X"/>
+      <field name="y" column="Y"/>
+    </class>
+
+    <class name="PCPointSingleFieldLong" table="PCPointSingleFieldLong">
+      <field name="id" column="ID" primary-key="true"/>
+      <field name="x" column="X"/>
+      <field name="y" column="Y"/>
+    </class>
+
+    <class name="PCPointSingleFieldPrimitiveshort" table="PCPointSingleFieldShort">
+      <field name="id" column="ID" primary-key="true"/>
+      <field name="x" column="X"/>
+      <field name="y" column="Y"/>
+    </class>
+
+    <class name="PCPointSingleFieldShort" table="PCPointSingleFieldShort">
+      <field name="id" column="ID" primary-key="true"/>
+      <field name="x" column="X"/>
+      <field name="y" column="Y"/>
+    </class>
+
+    <class name="PCPointSingleFieldString" table="PCPointSingleFieldString">
+      <field name="id" column="ID" primary-key="true"/>
+      <field name="x" column="X"/>
+      <field name="y" column="Y"/>
+    </class>
+
+    <class name="PCPointSingleFieldDate" table="PCPointSingleFieldDate">
+      <field name="id" column="ID" primary-key="true"/>
+      <field name="x" column="X"/>
+      <field name="y" column="Y"/>
+    </class>
+
+  </package>
+</orm>
+

Modified: incubator/jdo/trunk/tck20/test/sql/derby/applicationidentity/schema.sql
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck20/test/sql/derby/applicationidentity/schema.sql?rev=219225&r1=219224&r2=219225&view=diff
==============================================================================
--- incubator/jdo/trunk/tck20/test/sql/derby/applicationidentity/schema.sql (original)
+++ incubator/jdo/trunk/tck20/test/sql/derby/applicationidentity/schema.sql Fri Jul 15 10:45:04 2005
@@ -62,6 +62,67 @@
 );
 
 -------------------------
+-- singlefieldidentity
+-------------------------
+
+DROP TABLE PCPointSingleFieldByte;
+DROP TABLE PCPointSingleFieldChar;
+DROP TABLE PCPointSingleFieldInteger;
+DROP TABLE PCPointSingleFieldLong;
+DROP TABLE PCPointSingleFieldShort;
+DROP TABLE PCPointSingleFieldString;
+DROP TABLE PCPointSingleFieldDate;
+
+CREATE TABLE PCPointSingleFieldByte (
+    ID DECIMAL(3) NOT NULL,
+    X INTEGER NOT NULL,
+    Y INTEGER,
+    CONSTRAINT PCPNT_SFB_PK PRIMARY KEY (ID)
+);
+
+CREATE TABLE PCPointSingleFieldChar (
+    ID INTEGER NOT NULL,
+    X INTEGER NOT NULL,
+    Y INTEGER,
+    CONSTRAINT PCPNT_SFC_PK PRIMARY KEY (ID)
+);
+
+CREATE TABLE PCPointSingleFieldInteger (
+    ID INTEGER NOT NULL,
+    X INTEGER NOT NULL,
+    Y INTEGER,
+    CONSTRAINT PCPNT_SFI_PK PRIMARY KEY (ID)
+);
+
+CREATE TABLE PCPointSingleFieldLong (
+    ID BIGINT NOT NULL,
+    X INTEGER NOT NULL,
+    Y INTEGER,
+    CONSTRAINT PCPNT_SFL_PK PRIMARY KEY (ID)
+);
+
+CREATE TABLE PCPointSingleFieldShort (
+    ID SMALLINT NOT NULL,
+    X INTEGER NOT NULL,
+    Y INTEGER,
+    CONSTRAINT PCPNT_SFS_PK PRIMARY KEY (ID)
+);
+
+CREATE TABLE PCPointSingleFieldString (
+    ID VARCHAR(100) NOT NULL,
+    X INTEGER NOT NULL,
+    Y INTEGER,
+    CONSTRAINT PCPNT_SFSTR_PK PRIMARY KEY (ID)
+);
+
+CREATE TABLE PCPointSingleFieldDate (
+    ID DATE NOT NULL,
+    X INTEGER NOT NULL,
+    Y INTEGER,
+    CONSTRAINT PCPNT_SFSTR_PK PRIMARY KEY (ID)
+);
+
+-------------------------
 -- company
 -------------------------
 



Mime
View raw message