Index: project.properties
===================================================================
--- project.properties (revision 599206)
+++ project.properties (working copy)
@@ -231,6 +231,9 @@
org/apache/jdo/tck/pc/newInstance/Address.java \
org/apache/jdo/tck/pc/newInstance/AAddress.java \
org/apache/jdo/tck/pc/newInstance/IAddress.java \
+ org/apache/jdo/tck/pc/newInstance/Address_bad.java \
+ org/apache/jdo/tck/pc/newInstance/AAddress_bad.java \
+ org/apache/jdo/tck/pc/newInstance/IAddress_bad.java \
org/apache/jdo/tck/pc/order/Order.java \
org/apache/jdo/tck/pc/order/OrderItem.java \
org/apache/jdo/tck/pc/fieldtypes/AllTypes.java \
@@ -457,6 +460,9 @@
org/apache/jdo/tck/pc/newInstance/Address.class \
org/apache/jdo/tck/pc/newInstance/AAddress.class \
org/apache/jdo/tck/pc/newInstance/IAddress.class \
+ org/apache/jdo/tck/pc/newInstance/Address_bad.class \
+ org/apache/jdo/tck/pc/newInstance/AAddress_bad.class \
+ org/apache/jdo/tck/pc/newInstance/IAddress_bad.class \
org/apache/jdo/tck/pc/order/Order.class \
org/apache/jdo/tck/pc/order/OrderItem.class \
org/apache/jdo/tck/pc/fieldtypes/AllTypes.class \
@@ -643,6 +649,9 @@
org/apache/jdo/tck/pc/newInstance/Address.jdo \
org/apache/jdo/tck/pc/newInstance/AAddress.jdo \
org/apache/jdo/tck/pc/newInstance/IAddress.jdo \
+ org/apache/jdo/tck/pc/newInstance/Address_bad.jdo \
+ org/apache/jdo/tck/pc/newInstance/AAddress_bad.jdo \
+ org/apache/jdo/tck/pc/newInstance/IAddress_bad.jdo \
org/apache/jdo/tck/pc/query/package.jdo \
org/apache/jdo/tck/pc/singlefieldidentity/package.jdo \
org/apache/jdo/tck/pc/shoppingcart/package.jdo \
Index: src/conf/configurations.list
===================================================================
--- src/conf/configurations.list (revision 599206)
+++ src/conf/configurations.list (working copy)
@@ -18,6 +18,7 @@
instancecallbacks.conf \
jdohelper.conf \
pm.conf \
+ newInstanceBadMapping.conf \
pmf.conf \
detach.conf \
enhancement.conf \
Index: src/conf/newInstanceBadMapping.conf
===================================================================
--- src/conf/newInstanceBadMapping.conf (revision 0)
+++ src/conf/newInstanceBadMapping.conf (revision 0)
@@ -0,0 +1,24 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You 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.
+
+jdo.tck.description = All pm tests with standard mapping, no testdata.
+jdo.tck.mapping.companyfactory =
+jdo.tck.testdata =
+jdo.tck.standarddata =
+jdo.tck.mapping = 1
+jdo.tck.requiredOptions =
+jdo.tck.classes = \
+org.apache.jdo.tck.api.persistencemanager.NewInstanceBadMapping
+
Index: src/java/org/apache/jdo/tck/api/persistencemanager/NewInstance.java
===================================================================
--- src/java/org/apache/jdo/tck/api/persistencemanager/NewInstance.java (revision 599206)
+++ src/java/org/apache/jdo/tck/api/persistencemanager/NewInstance.java (working copy)
@@ -23,6 +23,9 @@
import org.apache.jdo.tck.pc.newInstance.AAddress;
import org.apache.jdo.tck.pc.newInstance.Address;
import org.apache.jdo.tck.pc.newInstance.IAddress;
+import org.apache.jdo.tck.pc.newInstance.AAddress_bad;
+import org.apache.jdo.tck.pc.newInstance.Address_bad;
+import org.apache.jdo.tck.pc.newInstance.IAddress_bad;
import org.apache.jdo.tck.util.BatchTestRunner;
/**
@@ -55,68 +58,84 @@
BatchTestRunner.run(NewInstance.class);
}
- /** */
- public void testNewInstance() {
+ /** test newInstance (Class pcInterface) */
+ public void testNewInstanceInterface() {
pm = getPM();
+ try {
+ pm.newInstance(IAddress.class);
+ } catch (Exception e) {
+ fail("Unexpected exception thrown. "
+ + e.getMessage());
+ }
+ }
- /* positive tests */
- runTestNewInstanceInterface(pm);
- runTestNewInstanceAbstractClass(pm);
- runTestNewInstanceClass(pm);
+ /** test newInstance (Class pcAbstractClass) */
+ public void testNewInstanceAbstractClass() {
+ pm = getPM();
+ try {
+ pm.newInstance(AAddress.class);
+ } catch (Exception e) {
+ fail("Unexpected exception thrown. "
+ + e.getMessage());
+ }
+ }
- /* negative tests */
-
- pm.close();
- pm = null;
+ /** test newInstance (Class pcClass) */
+ public void testNewInstanceClass() {
+ pm = getPM();
+ try {
+ pm.newInstance(Address.class);
+ } catch (Exception e) {
+ fail("Unexpected exception thrown. "
+ + e.getMessage());
+ }
}
/** test newInstance (Class pcInterface) */
- private void runTestNewInstanceInterface(PersistenceManager pm) {
- IAddress iaddress = (IAddress)pm.newInstance(IAddress.class);
-// Transaction tx = pm.currentTransaction();
-// try {
-// tx = pm.currentTransaction();
-// tx.begin();
-// tx.commit();
- if (debug) logger.debug(" \nPASSED in testNewInstance()");
-// }
-// finally {
-// if (tx.isActive())
-// tx.rollback();
-// }
+ public void testNewInstanceInterfaceBad() {
+ pm = getPM();
+ try {
+ pm.newInstance(IAddress_bad.class);
+ fail("Expected JDOUserException but no exception thrown. "
+ + "Interface contains method "
+ + "not declared as persistent property.");
+ } catch (javax.jdo.JDOUserException jdoe) {
+ // Expected exception
+ } catch (Exception e) {
+ fail("Expected JDOUserException but " + e.getMessage()
+ + " thrown instead.");
+ }
}
/** test newInstance (Class pcAbstractClass) */
- private void runTestNewInstanceAbstractClass(PersistenceManager pm) {
- pm.newInstance(AAddress.class);
- Transaction tx = pm.currentTransaction();
- // try {
- // tx.begin();
-//
-//
-// tx.commit();
-// if (debug) logger.debug(" \nPASSED in testNewInstance()");
-// }
-// finally {
-// if (tx.isActive())
-// tx.rollback();
-// }
+ public void testNewInstanceAbstractClassBad() {
+ pm = getPM();
+ try {
+ pm.newInstance(AAddress_bad.class);
+ fail("Expected JDOUserException but no exception thrown. "
+ + "Abstract class contains abstract method "
+ + "not declared as persistent property.");
+ } catch (javax.jdo.JDOUserException jdoe) {
+ // Expected exception
+ } catch (Exception e) {
+ fail("Expected JDOUserException but " + e.getMessage()
+ + "t hrown instead.");
+ }
}
/** test newInstance (Class pcClass) */
- private void runTestNewInstanceClass(PersistenceManager pm) {
- pm.newInstance(Address.class);
- Transaction tx = pm.currentTransaction();
-// try {
-// tx.begin();
-//
-// tx.commit();
-// if (debug) logger.debug(" \nPASSED in testNewInstance()");
-// }
-// finally {
-// if (tx.isActive())
-// tx.rollback();
-// }
+ public void testNewInstanceClassBad() {
+ pm = getPM();
+ try {
+ pm.newInstance(Address_bad.class);
+ fail("Expected JDOUserException but no exception thrown. "
+ + "Class contains non-public no-args constructor.");
+ } catch (javax.jdo.JDOUserException jdoe) {
+ // Expected exception
+ } catch (Exception e) {
+ fail("Expected JDOUserException but " + e.getMessage()
+ + " thrown instead.");
+ }
}
}
Index: src/java/org/apache/jdo/tck/api/persistencemanager/NewInstanceBadMapping.java
===================================================================
--- src/java/org/apache/jdo/tck/api/persistencemanager/NewInstanceBadMapping.java (revision 0)
+++ src/java/org/apache/jdo/tck/api/persistencemanager/NewInstanceBadMapping.java (revision 0)
@@ -0,0 +1,106 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.api.persistencemanager;
+
+import javax.jdo.PersistenceManager;
+import javax.jdo.Transaction;
+import org.apache.jdo.tck.pc.newInstance.AAddress;
+import org.apache.jdo.tck.pc.newInstance.Address;
+import org.apache.jdo.tck.pc.newInstance.IAddress;
+import org.apache.jdo.tck.util.BatchTestRunner;
+
+/**
+ *Title: Delete Persistent
+ *
+ *Keywords:
+ *
+ *Assertion IDs: A12.6.6-1
+ *
+ *Assertion Description:
+[The parameter must be one of the following:
+- an abstract class that is declared in the metadata as persistence-capable, in which all abstract methods are declared as persistent properties, or
+- an interface that is declared in the metadata as persistence-capable, in which all methods are declared as persistent properties, or
+- a concrete class that is declared in the metadata as persistence-capable. In this case, the concrete class must declare a public no-args constructor.
+If the parameter does not satisfy the above requirements, JDOUserException is thrown.
+ *
+ *This test is intended to be run only with mapping 1, which fails to map
+ *a persistent field.
+ */
+
+public class NewInstanceBadMapping extends PersistenceManagerTest {
+
+ /** */
+ private static final String ASSERTION_FAILED =
+ "Assertion A12.5.7-9 (NewInstance) failed: ";
+
+ /**
+ * The main is called when the class
+ * is directly executed from the command line.
+ * @param args The arguments passed to the program.
+ */
+ public static void main(String[] args) {
+ BatchTestRunner.run(NewInstance.class);
+ }
+
+ /** test newInstance (Class pcInterface) */
+ public void testNewInstanceInterface() {
+ pm = getPM();
+ try {
+ IAddress iaddress = (IAddress)pm.newInstance(IAddress.class);
+ fail("Expected JDOUserException but no exception thrown. "
+ + "Persistent property is not mapped.");
+ } catch (javax.jdo.JDOUserException jdoe) {
+ // Expected exception
+ } catch (Exception e) {
+ fail("Expected JDOUserException for unmapped persistent property, "
+ + "but " + e.getMessage() + " thrown instead.");
+ }
+ }
+
+ /** test newInstance (Class pcAbstractClass) */
+ public void testNewInstanceAbstractClass() {
+ pm = getPM();
+ try {
+ pm.newInstance(AAddress.class);
+ fail("Expected JDOUserException but no exception thrown. "
+ + "Persistent property is not mapped.");
+ } catch (javax.jdo.JDOUserException jdoe) {
+ // Expected exception
+ } catch (Exception e) {
+ fail("Expected JDOUserException for unmapped persistent property, "
+ + "but " + e.getMessage() + " thrown instead.");
+ }
+ }
+
+ /** test newInstance (Class pcClass) */
+ public void testNewInstanceClass() {
+ pm = getPM();
+ try {
+ pm.newInstance(Address.class);
+ fail("Expected JDOUserException but no exception thrown. "
+ + "Persistent property is not mapped.");
+ } catch (javax.jdo.JDOUserException jdoe) {
+ // Expected exception
+ } catch (Exception e) {
+ fail("Expected JDOUserException for unmapped persistent property, "
+ + "but " + e.getMessage() + " thrown instead.");
+ }
+ }
+
+}
Property changes on: src\java\org\apache\jdo\tck\api\persistencemanager\NewInstanceBadMapping.java
___________________________________________________________________
Name: svn:eol-style
+ LF
Index: src/java/org/apache/jdo/tck/api/persistencemanager/PersistenceManagerTest.java
===================================================================
--- src/java/org/apache/jdo/tck/api/persistencemanager/PersistenceManagerTest.java (revision 599206)
+++ src/java/org/apache/jdo/tck/api/persistencemanager/PersistenceManagerTest.java (working copy)
@@ -46,9 +46,9 @@
addTearDownClass(PCPoint.class);
addTearDownClass(Department.class);
addTearDownClass(Company.class);
- addTearDownClass(Address.class);
- addTearDownClass(AAddress.class);
- addTearDownClass(IAddress.class);
+// addTearDownClass(Address.class);
+// addTearDownClass(AAddress.class);
+// addTearDownClass(IAddress.class);
}
/** */
Index: src/java/org/apache/jdo/tck/pc/newInstance/AAddress_bad.java
===================================================================
--- src/java/org/apache/jdo/tck/pc/newInstance/AAddress_bad.java (revision 0)
+++ src/java/org/apache/jdo/tck/pc/newInstance/AAddress_bad.java (revision 0)
@@ -0,0 +1,44 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.newInstance;
+
+/**
+ * This interface represents the persistent state of Address.
+ * Javadoc was deliberately omitted because it would distract from
+ * the purpose of the interface.
+ */
+public abstract class AAddress_bad implements IAddress {
+
+ public abstract long getAddrid();
+ public abstract String getStreet();
+ public abstract String getCity();
+ public abstract String getState();
+ public abstract String getZipcode();
+ public abstract String getCountry();
+
+ // Not declared as persistent property => JDOUserException on
+ // pm.newInstance(this
+ public abstract String getAString(); // not declared a persistent property
+
+ public abstract void setAddrid(long addrid);
+ public abstract void setStreet(String street);
+ public abstract void setCity(String city);
+ public abstract void setState(String state);
+ public abstract void setZipcode(String zipcode);
+ public abstract void setCountry(String country);
+}
Property changes on: src\java\org\apache\jdo\tck\pc\newInstance\AAddress_bad.java
___________________________________________________________________
Name: svn:eol-style
+ LF
Index: src/java/org/apache/jdo/tck/pc/newInstance/Address_bad.java
===================================================================
--- src/java/org/apache/jdo/tck/pc/newInstance/Address_bad.java (revision 0)
+++ src/java/org/apache/jdo/tck/pc/newInstance/Address_bad.java (revision 0)
@@ -0,0 +1,339 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.newInstance;
+
+import java.io.Serializable;
+
+
+/**
+ * This class represents a postal address.
+ */
+public class Address_bad
+ implements IAddress
+{
+
+ private long addrid;
+ private String street;
+ private String city;
+ private String state;
+ private String zipcode;
+ private String country;
+
+ // pm.newInstance(this) throws JDOUserException with non-public constructor
+ private Address_bad() {}
+
+ /**
+ * This constructor initializes the Address components.
+ * @param addrid The address ID.
+ * @param street The street address.
+ * @param city The city.
+ * @param state The state.
+ * @param zipcode The zip code.
+ * @param country The zip country.
+ */
+ public Address_bad(long addrid, String street, String city,
+ String state, String zipcode, String country)
+ {
+ this.addrid = addrid;
+ this.street = street;
+ this.city = city;
+ this.state = state;
+ this.zipcode = zipcode;
+ this.country = country;
+ }
+
+ public String getAString() {
+ return "A String";
+ }
+
+ /**
+ * Get the addrid associated with this object.
+ * @return the addrid.
+ */
+ public long getAddrid() {
+ return addrid;
+ }
+
+ /**
+ * Set the id associated with this object.
+ * @param id the id.
+ */
+ public void setAddrid(long id) {
+ if (this.addrid != 0)
+ throw new IllegalStateException("Id is already set.");
+ this.addrid = id;
+ }
+
+ /**
+ * Get the street component of the address.
+ * @return The street component of the address.
+ */
+ public String getStreet() {
+ return street;
+ }
+
+ /**
+ * Set the street component of the address.
+ * @param street The street component.
+ */
+ public void setStreet(String street) {
+ this.street = street;
+ }
+
+ /**
+ * Get the city.
+ * @return The city component of the address.
+ */
+ public String getCity() {
+ return city;
+ }
+
+ /**
+ * Set the city component of the address.
+ * @param city The city.
+ */
+ public void setCity(String city) {
+ this.city = city;
+ }
+
+ /**
+ * Get the state component of the address.
+ * @return The state.
+ */
+ public String getState() {
+ return state;
+ }
+
+ /**
+ * Set the state component of the address.
+ * @param state The state.
+ */
+ public void setState(String state) {
+ this.state = state;
+ }
+
+ /**
+ * Get the zipcode component of the address.
+ * @return The zipcode.
+ */
+ public String getZipcode() {
+ return zipcode;
+ }
+
+ /**
+ * Set the zip code component of the address.
+ * @param zipcode The zipcode.
+ */
+ public void setZipcode(String zipcode) {
+ this.zipcode = zipcode;
+ }
+
+ /**
+ * Get the country component of the address.
+ * @return The country.
+ */
+ public String getCountry() {
+ return country;
+ }
+
+ /**
+ * Set the country component of the address.
+ * @param country The country.
+ */
+ public void setCountry(String country) {
+ this.country = country;
+ }
+
+ /**
+ * Returns a String representation of a Address object.
+ * @return a String representation of a Address object.
+ */
+ public String toString() {
+ return "Address(" + getFieldRepr() + ")";
+ }
+
+ /**
+ * Returns a String representation of the non-relationship fields.
+ * @return a String representation of the non-relationship fields.
+ */
+ protected String getFieldRepr() {
+ StringBuffer rc = new StringBuffer();
+ rc.append(addrid);
+ rc.append(", street ").append(street);
+ rc.append(", city ").append(city);
+ rc.append(", state ").append(state);
+ rc.append(", zipcode ").append(zipcode);
+ rc.append(", country ").append(country);
+ return rc.toString();
+ }
+
+// /**
+// * Returns true if all the fields of this instance are
+// * deep equal to the coresponding fields of the specified Person.
+// * @param other the object with which to compare.
+// * @param helper EqualityHelper to keep track of instances that have
+// * already been processed.
+// * @return true if all the fields are deep equal;
+// * false otherwise.
+// * @throws ClassCastException if the specified instances' type prevents
+// * it from being compared to this instance.
+// */
+// public boolean deepCompareFields(Object other,
+// EqualityHelper helper) {
+// IAddress otherAddress = (IAddress)other;
+// String where = "Address<" + addrid + ">";
+// return
+// helper.equals(addrid, otherAddress.getAddrid(), where + ".addrid") &
+// helper.equals(street, otherAddress.getStreet(), where + ".street") &
+// helper.equals(city, otherAddress.getCity(), where + ".city") &
+// helper.equals(state, otherAddress.getState(), where + ".state") &
+// helper.equals(zipcode, otherAddress.getZipcode(), where + ".zipcode") &
+// helper.equals(country, otherAddress.getCountry(), where + ".country");
+// }
+//
+// /**
+// * Compares this object with the specified object for order. Returns a
+// * negative integer, zero, or a positive integer as this object is less
+// * than, equal to, or greater than the specified object.
+// * @param o The Object to be compared.
+// * @return a negative integer, zero, or a positive integer as this
+// * object is less than, equal to, or greater than the specified object.
+// * @throws ClassCastException - if the specified object's type prevents
+// * it from being compared to this Object.
+// */
+// public int compareTo(Object o) {
+// return compareTo((IAddress)o);
+// }
+//
+// /**
+// * Compare two instances. This is a method in Comparator.
+// */
+// public int compare(Object o1, Object o2) {
+// return compare((IAddress)o1, (IAddress)o2);
+// }
+//
+// /**
+// * Compares this object with the specified Address object for
+// * order. Returns a negative integer, zero, or a positive integer as
+// * this object is less than, equal to, or greater than the specified
+// * object.
+// * @param other The Address object to be compared.
+// * @return a negative integer, zero, or a positive integer as this
+// * object is less than, equal to, or greater than the specified Address
+// * object.
+// */
+// public int compareTo(IAddress other) {
+// return compare(this, other);
+// }
+//
+// /**
+// * Compares its two IAddress arguments for order. Returns a negative
+// * integer, zero, or a positive integer as the first argument is less
+// * than, equal to, or greater than the second.
+// * @param o1 the first IAddress object to be compared.
+// * @param o2 the second IAddress object to be compared.
+// * @return a negative integer, zero, or a positive integer as the first
+// * object is less than, equal to, or greater than the second object.
+// */
+// public static int compare(IAddress o1, IAddress o2) {
+// return EqualityHelper.compare(o1.getAddrid(), o2.getAddrid());
+// }
+//
+// /**
+// * Indicates whether some other object is "equal to" this one.
+// * @param obj the object with which to compare.
+// * @return true if this object is the same as the obj
+// * argument; false otherwise.
+// */
+// public boolean equals(Object obj) {
+// if (obj instanceof IAddress) {
+// return compareTo((IAddress)obj) == 0;
+// }
+// return false;
+// }
+
+ /**
+ * Returns a hash code value for the object.
+ * @return a hash code value for this object.
+ */
+ public int hashCode() {
+ return (int)addrid;
+ }
+
+ /**
+ * This class is used to represent the application identifier
+ * for the Address class.
+ */
+ public static class Oid implements Serializable, Comparable {
+
+ /**
+ * This is the identifier field for Address and must
+ * correspond in type and name to the field in
+ * Address.
+ */
+ public long addrid;
+
+ /** The required public, no-arg constructor. */
+ public Oid()
+ {
+ addrid = 0;
+ }
+
+ /**
+ * A constructor to initialize the identifier field.
+ * @param addrid the id of the Address.
+ */
+ public Oid(long addrid) {
+ this.addrid = addrid;
+ }
+
+ public Oid(String s) { addrid = Long.parseLong(justTheId(s)); }
+
+ public String toString() { return this.getClass().getName() + ": " + addrid;}
+
+
+ /** */
+ public boolean equals(java.lang.Object obj) {
+ if( obj==null || !this.getClass().equals(obj.getClass()) )
+ return( false );
+ Oid o = (Oid) obj;
+ if( this.addrid != o.addrid ) return( false );
+ return( true );
+ }
+
+ /** */
+ public int hashCode() {
+ return( (int) addrid );
+ }
+
+ protected static String justTheId(String str) {
+ return str.substring(str.indexOf(':') + 1);
+ }
+
+ /** */
+ public int compareTo(Object obj) {
+ // may throw ClassCastException which the user must handle
+ Oid other = (Oid) obj;
+ if( addrid < other.addrid ) return -1;
+ if( addrid > other.addrid ) return 1;
+ return 0;
+ }
+
+ }
+
+}
Property changes on: src\java\org\apache\jdo\tck\pc\newInstance\Address_bad.java
___________________________________________________________________
Name: svn:eol-style
+ LF
Index: src/java/org/apache/jdo/tck/pc/newInstance/IAddress_bad.java
===================================================================
--- src/java/org/apache/jdo/tck/pc/newInstance/IAddress_bad.java (revision 0)
+++ src/java/org/apache/jdo/tck/pc/newInstance/IAddress_bad.java (revision 0)
@@ -0,0 +1,44 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.newInstance;
+
+/**
+ * This interface represents the persistent state of Address.
+ * Javadoc was deliberately omitted because it would distract from
+ * the purpose of the interface.
+ */
+public interface IAddress_bad {
+
+ long getAddrid();
+ String getStreet();
+ String getCity();
+ String getState();
+ String getZipcode();
+ String getCountry();
+
+ // Not declared as persistent property => JDOUserException on
+ // pm.newInstance(this)
+ String getAString(); // not declared a persistent property in metadata
+
+ void setAddrid(long addrid);
+ void setStreet(String street);
+ void setCity(String city);
+ void setState(String state);
+ void setZipcode(String zipcode);
+ void setCountry(String country);
+}
Property changes on: src\java\org\apache\jdo\tck\pc\newInstance\IAddress_bad.java
___________________________________________________________________
Name: svn:eol-style
+ LF
Index: src/jdo/applicationidentity/org/apache/jdo/tck/pc/newInstance/AAddress_bad.jdo
===================================================================
--- src/jdo/applicationidentity/org/apache/jdo/tck/pc/newInstance/AAddress_bad.jdo (revision 0)
+++ src/jdo/applicationidentity/org/apache/jdo/tck/pc/newInstance/AAddress_bad.jdo (revision 0)
@@ -0,0 +1,40 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Property changes on: src\jdo\applicationidentity\org\apache\jdo\tck\pc\newInstance\AAddress_bad.jdo
___________________________________________________________________
Name: svn:eol-style
+ LF
Index: src/jdo/applicationidentity/org/apache/jdo/tck/pc/newInstance/Address_bad.jdo
===================================================================
--- src/jdo/applicationidentity/org/apache/jdo/tck/pc/newInstance/Address_bad.jdo (revision 0)
+++ src/jdo/applicationidentity/org/apache/jdo/tck/pc/newInstance/Address_bad.jdo (revision 0)
@@ -0,0 +1,35 @@
+
+
+
+
+
+
+
+
+
+
+
+
Property changes on: src\jdo\applicationidentity\org\apache\jdo\tck\pc\newInstance\Address_bad.jdo
___________________________________________________________________
Name: svn:eol-style
+ LF
Index: src/jdo/applicationidentity/org/apache/jdo/tck/pc/newInstance/IAddress_bad.jdo
===================================================================
--- src/jdo/applicationidentity/org/apache/jdo/tck/pc/newInstance/IAddress_bad.jdo (revision 0)
+++ src/jdo/applicationidentity/org/apache/jdo/tck/pc/newInstance/IAddress_bad.jdo (revision 0)
@@ -0,0 +1,40 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Property changes on: src\jdo\applicationidentity\org\apache\jdo\tck\pc\newInstance\IAddress_bad.jdo
___________________________________________________________________
Name: svn:eol-style
+ LF
Index: src/jdo/datastoreidentity/org/apache/jdo/tck/pc/newInstance/AAddress_bad.jdo
===================================================================
--- src/jdo/datastoreidentity/org/apache/jdo/tck/pc/newInstance/AAddress_bad.jdo (revision 0)
+++ src/jdo/datastoreidentity/org/apache/jdo/tck/pc/newInstance/AAddress_bad.jdo (revision 0)
@@ -0,0 +1,39 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Property changes on: src\jdo\datastoreidentity\org\apache\jdo\tck\pc\newInstance\AAddress_bad.jdo
___________________________________________________________________
Name: svn:eol-style
+ LF
Index: src/jdo/datastoreidentity/org/apache/jdo/tck/pc/newInstance/Address_bad.jdo
===================================================================
--- src/jdo/datastoreidentity/org/apache/jdo/tck/pc/newInstance/Address_bad.jdo (revision 0)
+++ src/jdo/datastoreidentity/org/apache/jdo/tck/pc/newInstance/Address_bad.jdo (revision 0)
@@ -0,0 +1,38 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Property changes on: src\jdo\datastoreidentity\org\apache\jdo\tck\pc\newInstance\Address_bad.jdo
___________________________________________________________________
Name: svn:eol-style
+ LF
Index: src/jdo/datastoreidentity/org/apache/jdo/tck/pc/newInstance/IAddress_bad.jdo
===================================================================
--- src/jdo/datastoreidentity/org/apache/jdo/tck/pc/newInstance/IAddress_bad.jdo (revision 0)
+++ src/jdo/datastoreidentity/org/apache/jdo/tck/pc/newInstance/IAddress_bad.jdo (revision 0)
@@ -0,0 +1,38 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Property changes on: src\jdo\datastoreidentity\org\apache\jdo\tck\pc\newInstance\IAddress_bad.jdo
___________________________________________________________________
Name: svn:eol-style
+ LF
Index: src/orm/applicationidentity/org/apache/jdo/tck/pc/newInstance/package-standard.orm
===================================================================
--- src/orm/applicationidentity/org/apache/jdo/tck/pc/newInstance/package-standard.orm (revision 599206)
+++ src/orm/applicationidentity/org/apache/jdo/tck/pc/newInstance/package-standard.orm (working copy)
@@ -87,6 +87,69 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Index: src/orm/applicationidentity/org/apache/jdo/tck/pc/newInstance/package-standard1.orm
===================================================================
--- src/orm/applicationidentity/org/apache/jdo/tck/pc/newInstance/package-standard1.orm (revision 0)
+++ src/orm/applicationidentity/org/apache/jdo/tck/pc/newInstance/package-standard1.orm (revision 0)
@@ -0,0 +1,88 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Property changes on: src\orm\applicationidentity\org\apache\jdo\tck\pc\newInstance\package-standard1.orm
___________________________________________________________________
Name: svn:eol-style
+ LF
Index: src/orm/datastoreidentity/org/apache/jdo/tck/pc/newInstance/package-standard.orm
===================================================================
--- src/orm/datastoreidentity/org/apache/jdo/tck/pc/newInstance/package-standard.orm (revision 599206)
+++ src/orm/datastoreidentity/org/apache/jdo/tck/pc/newInstance/package-standard.orm (working copy)
@@ -82,5 +82,62 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Index: src/orm/datastoreidentity/org/apache/jdo/tck/pc/newInstance/package-standard1.orm
===================================================================
--- src/orm/datastoreidentity/org/apache/jdo/tck/pc/newInstance/package-standard1.orm (revision 0)
+++ src/orm/datastoreidentity/org/apache/jdo/tck/pc/newInstance/package-standard1.orm (revision 0)
@@ -0,0 +1,94 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Property changes on: src\orm\datastoreidentity\org\apache\jdo\tck\pc\newInstance\package-standard1.orm
___________________________________________________________________
Name: svn:eol-style
+ LF