db-jdo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From m..@apache.org
Subject svn commit: r158179 [12/61] - in incubator/jdo/trunk/tck11: ./ assertions/ iut_jars/ test/ test/conf/ test/java/ test/java/org/ test/java/org/apache/ test/java/org/apache/jdo/ test/java/org/apache/jdo/tck/ test/java/org/apache/jdo/tck/api/ test/java/org/apache/jdo/tck/api/instancecallbacks/ test/java/org/apache/jdo/tck/api/jdohelper/ test/java/org/apache/jdo/tck/api/persistencemanager/ test/java/org/apache/jdo/tck/api/persistencemanagerfactory/ test/java/org/apache/jdo/tck/enhancement/ test/java/org/apache/jdo/tck/extents/ test/java/org/apache/jdo/tck/lifecycle/ test/java/org/apache/jdo/tck/lifecycle/nontransactional/ test/java/org/apache/jdo/tck/models/ test/java/org/apache/jdo/tck/models/embedded/ test/java/org/apache/jdo/tck/models/fieldtypes/ test/java/org/apache/jdo/tck/models/inheritance/ test/java/org/apache/jdo/tck/pc/ test/java/org/apache/jdo/tck/pc/company/ test/java/org/apache/jdo/tck/pc/fieldtypes/ test/java/org/apache/jdo/tck/pc/inheritance/ test/java/org/apache/jdo/tck/pc/instancecallbacks/ test/java/org/apache/jdo/tck/pc/lifecycle/ test/java/org/apache/jdo/tck/pc/mylib/ test/java/org/apache/jdo/tck/query/ test/java/org/apache/jdo/tck/query/operators/ test/java/org/apache/jdo/tck/transactions/ test/java/org/apache/jdo/tck/util/ test/jdo/ test/jdo/applicationidentity/ test/jdo/applicationidentity/org/ test/jdo/applicationidentity/org/apache/ test/jdo/applicationidentity/org/apache/jdo/ test/jdo/applicationidentity/org/apache/jdo/tck/ test/jdo/applicationidentity/org/apache/jdo/tck/pc/ test/jdo/applicationidentity/org/apache/jdo/tck/pc/company/ test/jdo/applicationidentity/org/apache/jdo/tck/pc/fieldtypes/ test/jdo/applicationidentity/org/apache/jdo/tck/pc/inheritance/ test/jdo/applicationidentity/org/apache/jdo/tck/pc/instancecallbacks/ test/jdo/applicationidentity/org/apache/jdo/tck/pc/lifecycle/ test/jdo/applicationidentity/org/apache/jdo/tck/pc/mylib/ test/jdo/datastoreidentity/ test/jdo/datastoreidentity/org/ test/jdo/datastoreidentity/org/apache/ test/jdo/datastoreidentity/org/apache/jdo/ test/jdo/datastoreidentity/org/apache/jdo/tck/ test/jdo/datastoreidentity/org/apache/jdo/tck/pc/ test/jdo/datastoreidentity/org/apache/jdo/tck/pc/company/ test/jdo/datastoreidentity/org/apache/jdo/tck/pc/fieldtypes/ test/jdo/datastoreidentity/org/apache/jdo/tck/pc/inheritance/ test/jdo/datastoreidentity/org/apache/jdo/tck/pc/instancecallbacks/ test/jdo/datastoreidentity/org/apache/jdo/tck/pc/lifecycle/ test/jdo/datastoreidentity/org/apache/jdo/tck/pc/mylib/
Date Sat, 19 Mar 2005 01:09:45 GMT
Added: incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/extents/ExtentTest.java
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/extents/ExtentTest.java?view=auto&rev=158179
==============================================================================
--- incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/extents/ExtentTest.java (added)
+++ incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/extents/ExtentTest.java Fri Mar 18 17:07:39 2005
@@ -0,0 +1,260 @@
+/*
+ * 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.extents;
+
+
+import java.lang.reflect.Constructor;
+import java.math.BigDecimal;
+import java.util.Date;
+import java.util.GregorianCalendar;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.TimeZone;
+
+import javax.jdo.Extent;
+import javax.jdo.JDOFatalInternalException;
+import javax.jdo.PersistenceManager;
+import javax.jdo.PersistenceManagerFactory;
+
+import org.apache.jdo.tck.JDO_Test;
+import org.apache.jdo.tck.pc.company.Address;
+import org.apache.jdo.tck.pc.company.Company;
+import org.apache.jdo.tck.pc.company.Department;
+import org.apache.jdo.tck.pc.company.Employee;
+import org.apache.jdo.tck.pc.company.FullTimeEmployee;
+import org.apache.jdo.tck.pc.company.DentalInsurance;
+import org.apache.jdo.tck.pc.company.MedicalInsurance;
+import org.apache.jdo.tck.pc.company.PartTimeEmployee;
+import org.apache.jdo.tck.pc.company.Project;
+
+/**
+ *
+ * @author  Craig Russell
+ * @version 1.0
+ */
+abstract class ExtentTest extends JDO_Test {
+
+    protected Class extentClass = Employee.class;
+    protected Company company;
+    protected Object companyOID;
+    
+    /** Creates new ExtentTest */
+    public ExtentTest() {
+        if (PMFProperties == null)
+        {
+            PMFProperties = System.getProperty("user.home") + "/.jdo/PMFProperties.properties";
+            if (PMFProperties == null)
+                System.out.println ("Please specify PMF properties in {user.home}/.jdo/PMFProperties.properties");
+        }
+    }
+     
+    /** */
+    protected void checkPM() {
+        try {
+            Extent ex = getPM().getExtent(Company.class, false);
+            int count = countIterator(ex.iterator());
+            if (count == 1) {
+                if (debug) logger.debug ("Found company");
+                return;
+            }
+        } catch (Exception e) {
+            e.printStackTrace(System.err);
+            System.err.println ("Failed to find Company; initializing DB");
+        }
+        initDB();
+    }
+    
+    /** */
+    protected void initDB() {
+        HashSet h;
+        Address addr1 = new Address (7001L, "18 Network Circle",
+                                     "Santa Clara", "CA", "94455", "USA");
+        company = new Company (1L, "Sun Microsystems", new Date(), addr1);
+        GregorianCalendar born =
+            new GregorianCalendar(TimeZone.getTimeZone("America/Los_Angeles"));
+        GregorianCalendar hired =
+            new GregorianCalendar(TimeZone.getTimeZone("America/Los_Angeles"));
+
+        born.set(1969, 7, 20);
+        hired.set(1982, 5, 5);
+        Address addr2 = new Address (7002L, "43 Sematery Drive",
+                                     "Woodside", "CA", "94320", "USA");
+        Employee scott = new FullTimeEmployee(3001L, "Scott", "McNealy", "G", 
+                                              born.getTime(), addr2, 
+                                              hired.getTime(), 200000.0);
+        born.set(1960, 4, 8);
+        hired.set(1985, 2, 3);
+        Address addr3 = new Address (7003L, "1298 Wanderlust Road",
+                                     "Pleasanton", "CA", "95560", "USA");
+        Employee ed =  new PartTimeEmployee(3002L, "Ed", "Zander", null, 
+                                            born.getTime(), addr3, 
+                                            hired.getTime(), 400000.0); 
+        scott.addToTeam(ed);
+
+        // Set up their departments.
+        Department board =
+            new Department(2001L, "board", company);
+        h = new HashSet();
+        h.add(scott);
+        board.setEmployees(h);
+        scott.setDepartment(board);
+        
+        company.addDepartment(board);
+
+        Department emg = new Department(2002L, "emg", company);
+        h = new HashSet();
+        h.add(ed);
+        emg.setEmployees(h);
+        ed.setDepartment(emg);
+        
+        company.addDepartment(emg);
+
+        // Insure these guys
+        DentalInsurance scottDentalIns = new DentalInsurance(
+            5001L, "Aetna", scott, new BigDecimal("12000"));
+        MedicalInsurance scottMedicalIns = new MedicalInsurance(
+            5002L, "Aetna", scott, "PPO");
+        DentalInsurance edDentalIns = new DentalInsurance(
+            5003L, "BlueCross", ed, new BigDecimal("10000"));
+        MedicalInsurance edMedicalIns = new MedicalInsurance(
+            5004L, "BlueCross", ed, "EPO");
+        scott.setDentalInsurance(scottDentalIns);
+        scott.setMedicalInsurance(scottMedicalIns);
+        ed.setDentalInsurance(edDentalIns);
+        ed.setMedicalInsurance(edMedicalIns);
+
+        // Give them some projects to work on.  Scott works on both; Ed only
+        // on one.
+        Project solaris = new Project(4001L, "Solaris", new BigDecimal(100.375));
+        Project sparc = new Project(4002L, "Sparc", new BigDecimal(200.500));
+        h = new HashSet();
+        h.add(scott);
+        h.add(ed);
+        solaris.setMembers(h); // Solaris is worked on by Scott and Ed
+
+        h = new HashSet();
+        h.add(scott);
+        sparc.setMembers(h); // Sparc is worked on by Scott
+        
+        h = new HashSet();
+        h.add(solaris);
+        h.add(sparc);
+        scott.setProjects(h); // Scott works on Solaris and Sparc
+
+        h = new HashSet();
+        h.add(solaris);
+        ed.setProjects(h); // Ed works on Solaris
+        
+        /* Now put all of these into the database
+         */
+        pm.currentTransaction().begin();
+        pm.makePersistent (company);
+        pm.currentTransaction().commit();
+        // System.out.println ("Company OID: " + pm.getObjectId(company));
+    }
+    
+    /** */
+    protected Employee addEmployee() {
+        Address addr1 = new Address (7004L, "456 Chelsey Lane", 
+                                     "Mountain View", "CA", "94040", "USA");
+        Employee emp1 = new FullTimeEmployee (3003L, "First3003", "Last3003", "Middle3003", 
+                                              new Date(), addr1, new Date(), 10000.0);
+        getPM().makePersistent (emp1);
+        return emp1;
+    }
+    
+    /** */
+    protected void deleteEmployee(Employee e) {
+        getPM().deletePersistent (e);
+    }
+
+    /** */
+    protected int countIterator(Iterator it) {
+        int count = 0;
+        for (;it.hasNext();count++, it.next());
+        return count;
+    }
+    
+    /** */
+    protected int printIterator(Iterator it) {
+        int count = 0;
+        for (;it.hasNext();count++) {
+            System.out.println (it.next().toString());
+        }
+        return count;
+    }
+    
+    /** */
+    protected Extent getExtent() {
+        return getPM().getExtent(extentClass, true);
+    }
+    
+    /** */
+    protected Object getCompanyOID () {
+        String companyOIDString = (String)
+            PMFPropertiesObject.get("org.apache.jdo.tck.extents.CompanyOID");
+        String companyOIDClassName = (String)
+            PMFPropertiesObject.get("org.apache.jdo.tck.extents.CompanyOIDClass");
+        if (companyOIDClassName == null) {
+            companyOIDClassName = "org.apache.jdo.impl.fostore.OID";
+        }
+        try {
+            Class companyOIDClass = Class.forName(companyOIDClassName);
+            Constructor companyOIDConstructor = companyOIDClass.getConstructor(new Class[] {String.class});
+            Object companyOID = companyOIDConstructor.newInstance (new Object[] {companyOIDString});
+            return companyOID;
+        } 
+        catch (Exception ex) {
+            throw new JDOFatalInternalException (
+                "PMFProperties must be configured with the following properties\n" +
+                "\torg.apache.jdo.tck.extents.CompanyOID = <string result of oid.toString()>\n" +
+                "\torg.apache.jdo.tck.extents.CompanyOIDClass = <name of companyOID class>\n", ex);
+        }
+    }
+    
+    /** */
+    protected PersistenceManager getPM() {
+        if (pm == null) {
+            pm = getPMF().getPersistenceManager();
+            checkPM();
+        }
+        return pm;
+    }
+    
+    /** */
+    public PersistenceManagerFactory getPMF() {
+        if (pmf == null) {
+            pmf = super.getPMF();
+        }
+        return pmf;
+    }
+    
+    /** */
+    protected void beginTransaction() {
+        getPM().currentTransaction().begin();
+    }
+    
+    /** */
+    protected void commitTransaction() {
+        getPM().currentTransaction().commit();
+    }
+    
+    /** */
+    protected void rollbackTransaction() {
+        getPM().currentTransaction().rollback();
+    }
+}

Added: incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/extents/GetCandidateClass.java
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/extents/GetCandidateClass.java?view=auto&rev=158179
==============================================================================
--- incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/extents/GetCandidateClass.java (added)
+++ incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/extents/GetCandidateClass.java Fri Mar 18 17:07:39 2005
@@ -0,0 +1,60 @@
+/*
+ * 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.extents;
+
+import javax.jdo.Extent;
+
+import org.apache.jdo.tck.util.BatchTestRunner;
+
+/**
+ *<B>Title:</B> Get Candidate Class
+ *<BR>
+ *<B>Keywords:</B> extent
+ *<BR>
+ *<B>Assertion ID:</B> A15.3-7.
+ *<BR>
+ *<B>Assertion Description: </B>
+<code>Extent.getCandidateClass()</code> returns the class of the instances
+contained in this <code>Extent</code>.
+
+ */
+
+public class GetCandidateClass extends ExtentTest {
+
+    /** */
+    private static final String ASSERTION_FAILED = 
+        "Assertion A15.3-7 (GetCandidateClass) failed: ";
+    
+    /**
+     * The <code>main</code> 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(GetCandidateClass.class);
+    }
+
+    /** */
+    public void test() {
+        Extent ex = getExtent();
+        if (extentClass != ex.getCandidateClass()) {
+            fail(ASSERTION_FAILED,
+                 "Candidate class in extent should be: " + extentClass.getClass().getName());
+        }
+    }
+}

Added: incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/extents/GetPersistenceManager.java
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/extents/GetPersistenceManager.java?view=auto&rev=158179
==============================================================================
--- incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/extents/GetPersistenceManager.java (added)
+++ incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/extents/GetPersistenceManager.java Fri Mar 18 17:07:39 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.extents;
+
+import javax.jdo.Extent;
+
+import org.apache.jdo.tck.pc.company.Employee;
+import org.apache.jdo.tck.util.BatchTestRunner;
+
+/**
+ *<B>Title:</B> Get PersistenceManager
+ *<BR>
+ *<B>Keywords:</B> extent
+ *<BR>
+ *<B>Assertion ID:</B> A15.3-8.
+ *<BR>
+ *<B>Assertion Description: </B>
+<code>Extent.getPersistenceManager()</code> returns the
+<code>PersistenceManager</code> which created this <code>Extent</code>.
+
+ */
+
+public class GetPersistenceManager extends ExtentTest {
+
+    /** */
+    private static final String ASSERTION_FAILED = 
+        "Assertion A15.3-8 (GetPersistenceManager) failed: ";
+    
+    /**
+     * The <code>main</code> 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(GetPersistenceManager.class);
+    }
+
+    /** */
+    public void test() {
+        Extent ex = getPM().getExtent (Employee.class, true);
+        if (pm != ex.getPersistenceManager()) {
+            fail(ASSERTION_FAILED,
+                 "unexpected pm of extent, expected " + pm + 
+                 ", got " + ex.getPersistenceManager());
+        }
+    }
+}

Added: incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/extents/HasSubclassesFalse.java
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/extents/HasSubclassesFalse.java?view=auto&rev=158179
==============================================================================
--- incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/extents/HasSubclassesFalse.java (added)
+++ incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/extents/HasSubclassesFalse.java Fri Mar 18 17:07:39 2005
@@ -0,0 +1,61 @@
+/*
+ * 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.extents;
+
+import javax.jdo.Extent;
+
+import org.apache.jdo.tck.pc.company.Employee;
+import org.apache.jdo.tck.util.BatchTestRunner;
+
+/**
+ *<B>Title:</B> Has Subclasses is False
+ *<BR>
+ *<B>Keywords:</B> extent inheritance
+ *<BR>
+ *<B>Assertion ID:</B> A15.3-5.
+ *<BR>
+ *<B>Assertion Description: </B>
+<code>Extent.hasSubclasses()</code> returns <code>false</code>
+if the extent does not include subclasses.
+
+ */
+
+public class HasSubclassesFalse extends ExtentTest {
+
+    /** */
+    private static final String ASSERTION_FAILED = 
+        "Assertion A15.3-5 (HasSubclassesFalse) failed: ";
+    
+    /**
+     * The <code>main</code> 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(HasSubclassesFalse.class);
+    }
+
+    /** */
+    public void test() {
+        Extent ex = getPM().getExtent (Employee.class, false);
+        if (ex.hasSubclasses()) {
+            fail(ASSERTION_FAILED,
+                 "ex.hasSubclasses() returned true, but extent was created with subclasses=false.");
+        }
+    }
+}

Added: incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/extents/HasSubclassesTrue.java
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/extents/HasSubclassesTrue.java?view=auto&rev=158179
==============================================================================
--- incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/extents/HasSubclassesTrue.java (added)
+++ incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/extents/HasSubclassesTrue.java Fri Mar 18 17:07:39 2005
@@ -0,0 +1,61 @@
+/*
+ * 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.extents;
+
+import javax.jdo.Extent;
+
+import org.apache.jdo.tck.pc.company.Employee;
+import org.apache.jdo.tck.util.BatchTestRunner;
+
+/**
+ *<B>Title:</B> Has Subclasses is True
+ *<BR>
+ *<B>Keywords:</B> extent inheritance
+ *<BR>
+ *<B>Assertion ID:</B> A15.3-6.
+ *<BR>
+ *<B>Assertion Description: </B>
+<code>Extent.hasSubclasses()</code> returns <code>true</code>
+if the extent includes subclasses.
+
+ */
+
+public class HasSubclassesTrue extends ExtentTest {
+
+    /** */
+    private static final String ASSERTION_FAILED = 
+        "Assertion A15.3-6 (HasSubclassesTrue) failed: ";
+    
+    /**
+     * The <code>main</code> 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(HasSubclassesTrue.class);
+    }
+
+    /** */
+    public void test() {
+        Extent ex = getPM().getExtent (Employee.class, true);
+        if (!ex.hasSubclasses()) {
+            fail(ASSERTION_FAILED,
+                 "ex.hasSubclasses() returned false, but extent was created with subclasses=true.");
+        }
+    }
+}

Added: incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/extents/InstancesDeletedPriorToIterationNotReturned.java
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/extents/InstancesDeletedPriorToIterationNotReturned.java?view=auto&rev=158179
==============================================================================
--- incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/extents/InstancesDeletedPriorToIterationNotReturned.java (added)
+++ incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/extents/InstancesDeletedPriorToIterationNotReturned.java Fri Mar 18 17:07:39 2005
@@ -0,0 +1,84 @@
+/*
+ * 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.extents;
+
+import java.util.Iterator;
+
+import javax.jdo.Extent;
+
+import org.apache.jdo.tck.pc.company.Employee;
+import org.apache.jdo.tck.util.BatchTestRunner;
+
+/**
+ *<B>Title:</B> Instances Deleted Prior to Iteration not Returned
+ *<BR>
+ *<B>Keywords:</B> extent
+ *<BR>
+ *<B>Assertion ID:</B> A15.3-3.
+ *<BR>
+ *<B>Assertion Description: </B>
+If instances were deleted in the transaction prior to the execution of
+<code>Extent.iterator()</code>, the returned <code>Iterator</code>
+will not contain the instances.
+
+ */
+
+public class InstancesDeletedPriorToIterationNotReturned extends ExtentTest {
+
+    /** */
+    private static final String ASSERTION_FAILED = 
+        "Assertion A15.3-3 (InstancesDeletedPriorToIterationNotReturned) failed: ";
+    
+    /**
+     * The <code>main</code> 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(InstancesDeletedPriorToIterationNotReturned.class);
+    }
+
+    /** */
+    public void test() {
+        try {
+            beginTransaction();
+            getPM().setIgnoreCache(false);
+            Extent ex = getPM().getExtent (Employee.class, true);
+            Iterator it1 = ex.iterator();
+            deleteEmployee((Employee)it1.next());
+            Iterator it2 = ex.iterator();
+            int count = countIterator(it2);
+            rollbackTransaction();
+    
+            Iterator it3 = ex.iterator();
+            int count3 = countIterator(it3);
+    
+            if (count != 1) {
+                fail(ASSERTION_FAILED,
+                     "counted " + count + " after delete; should be 1");
+            }
+            if (count3 != 2) {
+                fail(ASSERTION_FAILED,
+                     "counted " + count3 + "after rollback; should be 2");
+            }
+        } 
+        finally {
+            cleanup();
+        }
+    }
+}

Added: incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/extents/InstancesPersistedPriorToIterationReturned.java
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/extents/InstancesPersistedPriorToIterationReturned.java?view=auto&rev=158179
==============================================================================
--- incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/extents/InstancesPersistedPriorToIterationReturned.java (added)
+++ incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/extents/InstancesPersistedPriorToIterationReturned.java Fri Mar 18 17:07:39 2005
@@ -0,0 +1,84 @@
+/*
+ * 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.extents;
+
+import java.util.Iterator;
+
+import javax.jdo.Extent;
+
+import org.apache.jdo.tck.pc.company.Employee;
+import org.apache.jdo.tck.util.BatchTestRunner;
+
+/**
+ *<B>Title:</B> Instances Persisted Prior to Iteration Returned
+ *<BR>
+ *<B>Keywords:</B> extent
+ *<BR>
+ *<B>Assertion ID:</B> A15.3-2.
+ *<BR>
+ *<B>Assertion Description: </B>
+If instances were made persistent in the transaction prior to the execution of
+<code>Extent.iterator()</code>, the returned <code>Iterator</code>
+will contain the instances.
+
+ */
+
+public class InstancesPersistedPriorToIterationReturned extends ExtentTest {
+
+    /** */
+    private static final String ASSERTION_FAILED = 
+        "Assertion A15.3-2 (InstancesPersistedPriorToIterationReturned) failed: ";
+    
+    /**
+     * The <code>main</code> 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(InstancesPersistedPriorToIterationReturned.class);
+    }
+
+    /** */
+    public void test() {
+
+        try {
+            beginTransaction();
+            getPM().setIgnoreCache(false);
+            Extent ex = getPM().getExtent (Employee.class, true);
+            addEmployee();
+            Iterator it = ex.iterator();
+            int count = countIterator(it);
+            rollbackTransaction();
+    
+            Iterator it2 = ex.iterator();
+            int count2 = countIterator(it2);
+    
+            if (count != 3) {
+                fail(ASSERTION_FAILED,
+                     "Iterator: " + count + " should be 3");
+            }
+            if (count2 != 2) {
+                fail(ASSERTION_FAILED,
+                     "Iterator2: " + count2 + "should be 2");
+            }
+        } 
+        finally {
+            cleanup();
+        }
+    }
+}

Added: incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/extents/IteratorHasNextFalseAfterExtentClose.java
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/extents/IteratorHasNextFalseAfterExtentClose.java?view=auto&rev=158179
==============================================================================
--- incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/extents/IteratorHasNextFalseAfterExtentClose.java (added)
+++ incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/extents/IteratorHasNextFalseAfterExtentClose.java Fri Mar 18 17:07:39 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.extents;
+
+import java.util.Iterator;
+
+import javax.jdo.Extent;
+
+import org.apache.jdo.tck.pc.company.Employee;
+import org.apache.jdo.tck.util.BatchTestRunner;
+
+/**
+ *<B>Title:</B> Iterator HasNext returns False after Extent.close
+ *<BR>
+ *<B>Keywords:</B> extent
+ *<BR>
+ *<B>Assertion ID:</B> A15.3-9.
+ *<BR>
+ *<B>Assertion Description: </B>
+After a call to <code>Extent.close(Iterator i)</code>,
+the parameter <code>Iterator</code> will return <code>false</code>
+to <code>hasNext()</code>.
+
+ */
+
+public class IteratorHasNextFalseAfterExtentClose extends ExtentTest {
+
+    /** */
+    private static final String ASSERTION_FAILED = 
+        "Assertion A15.3-9 (IteratorHasNextFalseAfterExtentClose) failed: ";
+    
+    /**
+     * The <code>main</code> 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(IteratorHasNextFalseAfterExtentClose.class);
+    }
+
+    /** */
+    public void test() {
+
+        try {
+            beginTransaction();
+            Extent ex = getPM().getExtent (Employee.class, true);
+            Iterator it1 = ex.iterator();
+            deleteEmployee((Employee)it1.next());
+            Iterator it2 = ex.iterator();
+            addEmployee();
+            Iterator it3 = ex.iterator();
+            ex.close(it1);
+            ex.close(it2);
+            ex.close(it3);
+            rollbackTransaction();
+    
+            Iterator it4 = ex.iterator();
+            int count4 = countIterator(it4);
+            if (debug) logger.debug ("Iterator4 after rollback: " + count4);
+    
+            if (it1.hasNext()) {
+                fail(ASSERTION_FAILED,
+                     "iterator1.hasNext(): " + it1.hasNext());
+            }
+            if (it2.hasNext()) {
+                fail(ASSERTION_FAILED,
+                     "iterator2.hasNext(): " + it2.hasNext());
+            }
+            if (it3.hasNext()) {
+                fail(ASSERTION_FAILED,
+                     "iterator3.hasNext(): " + it3.hasNext());
+            }
+            if (count4 != 2) {
+                fail(ASSERTION_FAILED,
+                     "Iterator " + count4 + " should be 2");
+            }
+        } 
+        finally {
+            cleanup();
+        }
+    }
+}

Added: incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/extents/IteratorMutatingMethods.java
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/extents/IteratorMutatingMethods.java?view=auto&rev=158179
==============================================================================
--- incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/extents/IteratorMutatingMethods.java (added)
+++ incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/extents/IteratorMutatingMethods.java Fri Mar 18 17:07:39 2005
@@ -0,0 +1,73 @@
+/*
+ * 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.extents;
+
+import java.util.Iterator;
+
+import javax.jdo.Extent;
+
+import org.apache.jdo.tck.util.BatchTestRunner;
+
+/**
+ *<B>Title:</B> Iterator Mutating Methods
+ *<BR>
+ *<B>Keywords:</B> extent exception
+ *<BR>
+ *<B>Assertion ID:</B> A15.3-4.
+ *<BR>
+ *<B>Assertion Description: </B>
+If any mutating method, including the <code>remove</code> method,
+is called on the <code>Iterator</code> returned by <code>Extent.iterator()</code>,
+an <code>UnsupportedOperationException</code> is thrown.
+
+ */
+
+public class IteratorMutatingMethods extends ExtentTest {
+
+    /** */
+    private static final String ASSERTION_FAILED = 
+        "Assertion A15.3-4 (IteratorMutatingMethods) failed: ";
+    
+    /**
+     * The <code>main</code> 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(IteratorMutatingMethods.class);
+    }
+
+    /** */
+    public void test() {
+        Extent ex = getExtent();
+        Iterator it = ex.iterator();
+        it.next();
+        try {
+            it.remove(); 
+            fail(ASSERTION_FAILED,
+                 "extent.iterator().remove() should throw UnsupportedOperationException");
+        }
+        catch (UnsupportedOperationException expected) {
+            // expected exception
+            if (debug) logger.debug("expected exception " + ex);
+        } 
+        finally {
+            cleanup();
+        }
+    }
+}

Added: incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/extents/IteratorNextAfterExtentClose.java
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/extents/IteratorNextAfterExtentClose.java?view=auto&rev=158179
==============================================================================
--- incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/extents/IteratorNextAfterExtentClose.java (added)
+++ incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/extents/IteratorNextAfterExtentClose.java Fri Mar 18 17:07:39 2005
@@ -0,0 +1,112 @@
+/*
+ * 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.extents;
+
+import java.util.Iterator;
+import java.util.NoSuchElementException;
+
+import javax.jdo.Extent;
+
+import org.apache.jdo.tck.pc.company.Employee;
+import org.apache.jdo.tck.util.BatchTestRunner;
+
+/**
+ *<B>Title:</B> Iterator Next After Extent Close
+ *<BR>
+ *<B>Keywords:</B> extent exception
+ *<BR>
+ *<B>Assertion ID:</B> A15.3-10.
+ *<BR>
+ *<B>Assertion Description: </B>
+After a call to <code>Extent.close(Iterator i)</code>,
+the parameter <code>Iterator</code>
+will throw a <code>NoSuchElementException</code> to <code>next()</code>. 
+
+ */
+
+public class IteratorNextAfterExtentClose extends ExtentTest {
+
+
+    /** */
+    private static final String ASSERTION_FAILED = 
+        "Assertion A15.3-10 (IteratorNextAfterExtentClose) failed: ";
+    
+    /**
+     * The <code>main</code> 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(IteratorNextAfterExtentClose.class);
+    }
+
+    /** */
+    public void test() {
+
+        try {
+            beginTransaction();
+            Extent ex = getPM().getExtent (Employee.class, true);
+            Iterator it1 = ex.iterator();
+            deleteEmployee((Employee)it1.next());
+            Iterator it2 = ex.iterator();
+            addEmployee();
+            Iterator it3 = ex.iterator();
+            ex.close(it1);
+            ex.close(it2);
+            ex.close(it3);
+
+            try {
+                tryNext(it1);
+                tryNext(it2);
+                tryNext(it3);
+                rollbackTransaction();
+    
+                Iterator it4 = ex.iterator();
+                int count4 = countIterator(it4);
+                if (count4 != 2) {
+                    fail(ASSERTION_FAILED,
+                         "Iterator4 after rollback: " + count4 + "; should be 2");
+                }
+            } 
+            catch (Exception unexpected) {
+                rollbackTransaction();
+                cleanup();
+                fail(ASSERTION_FAILED,
+                     "unexpected exception " + unexpected);
+            }
+        } 
+        catch (Exception unexpected) {
+            fail(ASSERTION_FAILED,
+                 "unexpected exception " + unexpected);
+        } 
+        finally  {
+            cleanup();
+        }
+    }
+
+    /** */
+    void tryNext (Iterator it) throws Exception {
+        try {
+            it.next();
+            fail(ASSERTION_FAILED,
+                 "expected NoSuchElementException thrown by iterator.next().");
+        } catch (NoSuchElementException expected) {
+            // expecteed exception
+        }
+    }
+}

Added: incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/extents/IteratorNextAfterExtentCloseAll.java
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/extents/IteratorNextAfterExtentCloseAll.java?view=auto&rev=158179
==============================================================================
--- incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/extents/IteratorNextAfterExtentCloseAll.java (added)
+++ incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/extents/IteratorNextAfterExtentCloseAll.java Fri Mar 18 17:07:39 2005
@@ -0,0 +1,101 @@
+/*
+ * 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.extents;
+
+import java.util.Iterator;
+import java.util.NoSuchElementException;
+
+import javax.jdo.Extent;
+
+import org.apache.jdo.tck.pc.company.Employee;
+import org.apache.jdo.tck.util.BatchTestRunner;
+
+/**
+ *<B>Title:</B> Iterator Next After Extent CloseAll
+ *<BR>
+ *<B>Keywords:</B> extent
+ *<BR>
+ *<B>Assertion ID:</B> A15.3-13.
+ *<BR>
+ *<B>Assertion Description: </B>
+After a call to <code>Extent.closeAll()</code>, all iterators acquired from this
+<code>Extent</code> will throw a <code>NoSuchElementException</code>
+to <code>next()</code>.
+
+ */
+
+public class IteratorNextAfterExtentCloseAll extends ExtentTest {
+
+
+    /** */
+    private static final String ASSERTION_FAILED = 
+        "Assertion A15.3-13 (IteratorNextAfterExtentCloseAll) failed: ";
+    
+    /**
+     * The <code>main</code> 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(IteratorNextAfterExtentCloseAll.class);
+    }
+
+    /** */
+    public void test() {
+
+        try {
+            beginTransaction();
+            Extent ex = getPM().getExtent (Employee.class, true);
+            Iterator it1 = ex.iterator();
+            deleteEmployee((Employee)it1.next());
+            Iterator it2 = ex.iterator();
+            addEmployee();
+            Iterator it3 = ex.iterator();
+            ex.closeAll();
+
+            if (!tryNext(it1)) {
+                fail(ASSERTION_FAILED,
+                     "iterator1.next() does not throw NoSuchElementException.");
+            }
+            if (!tryNext(it2)) {
+                fail(ASSERTION_FAILED,
+                     "iterator2.next() does not throw NoSuchElementException.");
+            }
+            if (!tryNext(it3)) {
+                fail(ASSERTION_FAILED,
+                     "iterator3.next() does not throw NoSuchElementException.");
+            }
+        } 
+        finally  {
+            rollbackTransaction();
+            cleanup();
+        }
+    }
+    
+    /** */
+    boolean tryNext (Iterator it) {
+        try {
+            it.next();
+        } catch (NoSuchElementException expected) {
+            return true;
+        }
+        return false;
+    }
+
+}
+

Added: incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/extents/Iterators.java
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/extents/Iterators.java?view=auto&rev=158179
==============================================================================
--- incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/extents/Iterators.java (added)
+++ incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/extents/Iterators.java Fri Mar 18 17:07:39 2005
@@ -0,0 +1,70 @@
+/*
+ * 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.extents;
+
+import java.util.Iterator;
+
+import javax.jdo.Extent;
+
+import org.apache.jdo.tck.util.BatchTestRunner;
+
+/**
+ *<B>Title:</B> Iterators
+ *<BR>
+ *<B>Keywords:</B> extent
+ *<BR>
+ *<B>Assertion ID:</B> A15.3-1.
+ *<BR>
+ *<B>Assertion Description: </B>
+<code>Extent.iterator()</code> returns an <code>Iterator</code>
+over all the instances in the <code>Extent</code>.
+
+ */
+
+public class Iterators extends ExtentTest {
+
+    /** */
+    private static final String ASSERTION_FAILED = 
+        "Assertion A15.3-1 (Iterators) failed: ";
+    
+    /**
+     * The <code>main</code> 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(Iterators.class);
+    }
+
+    /** */
+    public void test() {
+
+        Extent ex = getExtent();
+    
+        int count = 0;
+        for (Iterator it = ex.iterator(); it.hasNext();++count) {
+            Object emp = it.next();
+            if (debug) logger.debug(emp.toString());
+        }
+    
+        if (count != 2) {
+            fail(ASSERTION_FAILED,
+                 "Emplyoee extent should have 2 instances, got " + count);
+        }
+    }
+}

Added: incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/lifecycle/HollowInstanceMaintainsPK.java
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/lifecycle/HollowInstanceMaintainsPK.java?view=auto&rev=158179
==============================================================================
--- incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/lifecycle/HollowInstanceMaintainsPK.java (added)
+++ incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/lifecycle/HollowInstanceMaintainsPK.java Fri Mar 18 17:07:39 2005
@@ -0,0 +1,91 @@
+/*
+ * 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.lifecycle;
+
+import java.util.Iterator;
+
+import javax.jdo.Extent;
+import javax.jdo.PersistenceManager;
+import javax.jdo.PersistenceManagerFactory;
+import javax.jdo.Transaction;
+
+import org.apache.jdo.tck.JDO_Test;
+import org.apache.jdo.tck.pc.mylib.PCRect;
+import org.apache.jdo.tck.util.BatchTestRunner;
+
+/**
+ *<B>Title:</B> Test that Hollow Instances maintains PK
+ *<BR>
+ *<B>Keywords:</B> lifecycle hollow instance PK
+ *<BR>
+ *<B>Assertion IDs:</B> A5.5.4-3
+ *<BR>
+ *<B>Assertion Description: </B>
+ If the instance is of a class using application identity, the hollow instance maintains its primary key fields.
+ */
+
+public class HollowInstanceMaintainsPK extends JDO_Test {
+
+    /** */
+    private static final String ASSERTION_FAILED = 
+        "Assertion A5.5.4-3 (HollowInstanceMaintainsPK) failed: ";
+    
+    /**
+     * The <code>main</code> 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(HollowInstanceMaintainsPK.class);
+    }
+
+    /** */
+    public void test() {
+        if (!isApplicationIdentitySupported()) {
+            if (debug) logger.debug("Application Identity is not supported");
+        }
+        else {
+            pm = getPM();
+            pm.currentTransaction().begin();
+
+            PCRect obj = getPersistentNewInstance();
+
+            long beforeValue=obj.getId();
+            pm.currentTransaction().commit(); // obj should transition to HOLLOW
+            long afterValue=obj.getId();
+            if (beforeValue!=afterValue) {
+                fail(ASSERTION_FAILED,
+                     "Key field value incorrect after commit. Expected: " + 
+                     beforeValue + " Found: " + afterValue);
+            }
+        }
+    }
+
+    /** */
+    private PCRect getPersistentNewInstance() {
+        PCRect obj = new PCRect();
+        pm.makePersistent(obj); // obj should transition to persistent-new
+        int curr = currentState(obj);
+        if( curr != PERSISTENT_NEW ){
+            fail(ASSERTION_FAILED,
+                 "StateTransitions: Unable to create persistent-new instance " +
+                 "from transient instance via makePersistent(), state is " +
+                 states[curr]);
+        }
+        return obj;
+    }
+}

Added: incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/lifecycle/MultiplePMsReturnInstancesRepresentingSamePC.java
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/lifecycle/MultiplePMsReturnInstancesRepresentingSamePC.java?view=auto&rev=158179
==============================================================================
--- incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/lifecycle/MultiplePMsReturnInstancesRepresentingSamePC.java (added)
+++ incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/lifecycle/MultiplePMsReturnInstancesRepresentingSamePC.java Fri Mar 18 17:07:39 2005
@@ -0,0 +1,143 @@
+/*
+ * 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.lifecycle;
+
+import java.util.Iterator;
+
+import javax.jdo.Extent;
+import javax.jdo.PersistenceManager;
+import javax.jdo.PersistenceManagerFactory;
+import javax.jdo.Transaction;
+
+import org.apache.jdo.tck.JDO_Test;
+import org.apache.jdo.tck.pc.lifecycle.StateTransitionObj;
+import org.apache.jdo.tck.util.BatchTestRunner;
+
+/**
+ *<B>Title:</B> Test that Multiple PMs return different instances representing same PC object
+ *<BR>
+ *<B>Keywords:</B> lifecycle Multiple PMs getObjectById equal
+ *<BR>
+ *<B>Assertion IDs:</B> A5.4-7
+ *<BR>
+ *<B>Assertion Description: </B>
+ The instance returned by a call to getObjectById(Object) of different PersistenceManager 
+ instances returned by the same PersistenceManagerFactory represent the same persistent object, 
+ but with different Java object identity (specifically, all instances returned by getObjectId from the instances
+ must return true to equals comparisons with all others).
+ */
+
+public class MultiplePMsReturnInstancesRepresentingSamePC extends JDO_Test {
+
+    /** */
+    private static final String ASSERTION_FAILED = 
+        "Assertion A5.4-7 (MultiplePMsReturnInstancesRepresentingSamePC) failed: ";
+
+   	private static final int NUM_OBJECTS = 50;
+
+    /**
+     * The <code>main</code> 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(MultiplePMsReturnInstancesRepresentingSamePC.class);
+    }
+
+    public MultiplePMsReturnInstancesRepresentingSamePC()
+    {
+    }
+
+	public void test() {
+		PersistenceManager pm2 = null;
+		PersistenceManager pm3 = null;
+	
+	    try {
+			pm = getPM();
+			// Get two more PMs
+			pm2 = pmf.getPersistenceManager();
+			pm3 = pmf.getPersistenceManager();
+
+			Object[] obj = generatePersistentInstances();
+
+			Extent extent = pm.getExtent(StateTransitionObj.class, false);
+			Iterator iter = extent.iterator();
+			if( !iter.hasNext() ){
+				fail(ASSERTION_FAILED,
+					 "Extent for StateTransitionObj should not be empty");
+			}
+			extent.close(iter);
+
+
+			for (int i=0; i<NUM_OBJECTS; i++)
+			{
+				Object obj1 = obj[i];
+				Object objId1 = pm.getObjectId(obj1);
+				Object obj2 = pm2.getObjectById(objId1,false);
+				Object objId2 = pm2.getObjectId(obj2);
+				Object obj3 = pm3.getObjectById(objId1,false);
+				Object objId3 = pm3.getObjectId(obj3);
+				
+				//Verify that objects are different instances
+				if (!((obj1!=obj2) && (obj1!=obj3)))
+				{
+					fail(ASSERTION_FAILED,
+						 "Objects are not different instances. obj1=" + obj1 + " obj2= " + obj2 + " obj3= " + obj3);
+				}
+				
+				//Verify that object Ids are equal
+				if (!(objId1.equals(objId2) && objId1.equals(objId3)))
+				{
+					fail(ASSERTION_FAILED,
+						 "Object Ids are not equal. objId1=" + objId1 + " objId2= " + objId2 + " objId3= " + objId3);
+				}
+			}
+	    }
+	    finally {
+	    	if (pm2!=null && !pm2.isClosed())
+	    	{
+	    	    pm2.close();
+	    	}
+	    	if (pm3!=null && !pm3.isClosed())
+	    	{
+	    	    pm3.close();
+	    	}			
+	    }
+	}
+
+	private Object[] generatePersistentInstances()
+	{
+		StateTransitionObj[] objects = new StateTransitionObj[NUM_OBJECTS];
+		try {
+		    Transaction t = pm.currentTransaction();
+		    t.begin();
+		    for(int i = 0; i < NUM_OBJECTS; ++i ){
+				objects[i]=new StateTransitionObj(i);
+		        objects[i].writeField(i);
+		        pm.makePersistent(objects[i]);
+		    }
+		    t.commit();
+			return objects;
+		}
+		finally {
+	         Transaction tx = pm.currentTransaction();
+	         if (tx.isActive()) {
+	             tx.rollback();
+	         }
+		}
+	}
+}

Added: incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/lifecycle/ObjectIdNotModifiedWhenObjectIdInstanceModified.java
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/lifecycle/ObjectIdNotModifiedWhenObjectIdInstanceModified.java?view=auto&rev=158179
==============================================================================
--- incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/lifecycle/ObjectIdNotModifiedWhenObjectIdInstanceModified.java (added)
+++ incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/lifecycle/ObjectIdNotModifiedWhenObjectIdInstanceModified.java Fri Mar 18 17:07:39 2005
@@ -0,0 +1,108 @@
+/*
+ * 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.lifecycle;
+
+import java.util.Iterator;
+
+import javax.jdo.Extent;
+import javax.jdo.PersistenceManager;
+import javax.jdo.PersistenceManagerFactory;
+import javax.jdo.Transaction;
+
+import org.apache.jdo.tck.JDO_Test;
+import org.apache.jdo.tck.pc.lifecycle.StateTransitionObj;
+import org.apache.jdo.tck.util.BatchTestRunner;
+
+/**
+ *<B>Title:</B> Test that ObjectId is not modified even if ObjectId returned by GetObjectId() is modified
+ *<BR>
+ *<B>Keywords:</B> lifecycle GetObjectId
+ *<BR>
+ *<B>Assertion IDs:</B> A5.4-6
+ *<BR>
+ *<B>Assertion Description: </B>
+ The object returned by any call to getObjectId might be modified by the user, 
+ but that modification does not affect the identity of the object that was originally referred.
+ */
+
+public class ObjectIdNotModifiedWhenObjectIdInstanceModified extends JDO_Test {
+
+    /** */
+    private static final String ASSERTION_FAILED = 
+        "Assertion A5.4-6 (ObjectIdNotModifiedWhenObjectIdInstanceModified) failed: ";
+		
+	private static final int NUM_OBJECTS = 50;
+
+    /**
+     * The <code>main</code> 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(ObjectIdNotModifiedWhenObjectIdInstanceModified.class);
+    }
+
+    public ObjectIdNotModifiedWhenObjectIdInstanceModified()
+    {
+    }
+
+	public void test() throws Exception {
+		pm = getPM();
+		
+		Object[] obj = generatePersistentInstances();
+
+		Extent extent = pm.getExtent(StateTransitionObj.class, false);
+		Iterator iter = extent.iterator();
+		if( !iter.hasNext() ){
+			fail(ASSERTION_FAILED,
+				 "Extent for StateTransitionObj should not be empty");
+		}
+		extent.close(iter);
+
+		for (int i=0; i<NUM_OBJECTS; i++)
+		{
+			Object objId=pm.getObjectId(obj[i]);
+			mangleObject(objId);
+			Object objId2 = pm.getObjectId(obj[i]); // get another ObjectId copy
+			if (objId.equals(objId2))
+				fail(ASSERTION_FAILED,
+					 "object Id has been changed");
+		}
+	}
+
+	private Object[] generatePersistentInstances()
+	{
+		StateTransitionObj[] objects = new StateTransitionObj[NUM_OBJECTS];
+		try {
+		    Transaction t = pm.currentTransaction();
+		    t.begin();
+		    for(int i = 0; i < NUM_OBJECTS; ++i ){
+				objects[i]=new StateTransitionObj(i);
+		        objects[i].writeField(i);
+		        pm.makePersistent(objects[i]);
+		    }
+		    t.commit();
+			return objects;
+		}
+		finally {
+	         Transaction tx = pm.currentTransaction();
+	         if (tx.isActive()) {
+	             tx.rollback();
+	         }
+		}
+	}
+}

Added: incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/lifecycle/PMReturnsIdenticalInstancesForEqualObjIds.java
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/lifecycle/PMReturnsIdenticalInstancesForEqualObjIds.java?view=auto&rev=158179
==============================================================================
--- incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/lifecycle/PMReturnsIdenticalInstancesForEqualObjIds.java (added)
+++ incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/lifecycle/PMReturnsIdenticalInstancesForEqualObjIds.java Fri Mar 18 17:07:39 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.lifecycle;
+
+import java.util.Iterator;
+
+import javax.jdo.Extent;
+import javax.jdo.PersistenceManager;
+import javax.jdo.PersistenceManagerFactory;
+import javax.jdo.Transaction;
+
+import org.apache.jdo.tck.JDO_Test;
+import org.apache.jdo.tck.pc.lifecycle.StateTransitionObj;
+import org.apache.jdo.tck.util.BatchTestRunner;
+
+/**
+ *<B>Title:</B> Test that a PM returns the same JDO instance if getObjectById(ObjectId) is called multiple times with the same objectId instance
+ *<BR>
+ *<B>Keywords:</B> lifecycle getObjectById
+ *<BR>
+ *<B>Assertion IDs:</B> A5.4-2, A5.4-8, A5.4-10
+ *<BR>
+ *<B>Assertion Description: </B>
+ Any instances returned by any calls to getObjectById(Object) with the same object id instance to the same
+ PersistenceManager instance must be identical (assuming the instances were not garbage collected between calls).
+ */
+
+public class PMReturnsIdenticalInstancesForEqualObjIds extends JDO_Test {
+
+    /** */
+    private static final String ASSERTION_FAILED = 
+        "Assertions A5.4-2, A5.4-8, A5.4-10 (PMReturnsIdenticalInstancesForEqualObjIds) failed: ";
+    
+	private static final int NUM_OBJECTS = 50;
+
+    /**
+     * The <code>main</code> 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(PMReturnsIdenticalInstancesForEqualObjIds.class);
+    }
+
+    public PMReturnsIdenticalInstancesForEqualObjIds()
+    {
+    }
+
+	public void test() {
+	    pm = getPM();
+
+	    Object[] obj = generatePersistentInstances();
+
+    	Extent extent = pm.getExtent(StateTransitionObj.class, false);
+    	Iterator iter = extent.iterator();
+    	if( !iter.hasNext() ){
+    		fail(ASSERTION_FAILED,
+				 "Extent for StateTransitionObj should not be empty");
+    	}
+		extent.close(iter);
+
+		for (int i=0; i<NUM_OBJECTS; i++)
+		{
+			Object objId=pm.getObjectId(obj[i]);
+			// check that getObjectById returns identical instance
+			Object obj2 = pm.getObjectById(objId, true);
+			if (!(obj2==obj[i]))
+			{
+				fail(ASSERTION_FAILED,
+					 "objects with OId = " + objId + " are not identical");
+			}
+		}
+	}
+
+	private Object[] generatePersistentInstances()
+	{
+		StateTransitionObj[] objects = new StateTransitionObj[NUM_OBJECTS];
+		try {
+		    Transaction t = pm.currentTransaction();
+		    t.begin();
+		    for(int i = 0; i < NUM_OBJECTS; ++i ){
+				objects[i]=new StateTransitionObj(i);
+		        objects[i].writeField(i);
+		        pm.makePersistent(objects[i]);
+		    }
+		    t.commit();
+			return objects;
+		}
+		finally {
+	         Transaction tx = pm.currentTransaction();
+	         if (tx.isActive()) {
+	             tx.rollback();
+	         }
+		}
+	}
+}

Added: incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/lifecycle/PMsCanSharePCClassesButNotPCInstances.java
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/lifecycle/PMsCanSharePCClassesButNotPCInstances.java?view=auto&rev=158179
==============================================================================
--- incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/lifecycle/PMsCanSharePCClassesButNotPCInstances.java (added)
+++ incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/lifecycle/PMsCanSharePCClassesButNotPCInstances.java Fri Mar 18 17:07:39 2005
@@ -0,0 +1,230 @@
+/*
+ * 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.lifecycle;
+
+import java.util.*;
+import javax.jdo.*;
+
+import org.apache.jdo.tck.JDO_Test;
+import org.apache.jdo.tck.pc.lifecycle.StateTransitionObj;
+import org.apache.jdo.tck.util.BatchTestRunner;
+import org.apache.jdo.tck.util.ThreadExceptionHandler;
+
+/**
+ *<B>Title:</B> Test PM ability to share PC classes but not PC instances
+ *<BR>
+ *<B>Keywords:</B> PM share PC class
+ *<BR>
+ *<B>Assertion IDs:</B> A5.2-1,A5.2-2,A5.2-3
+ *<BR>
+ *<B>Assertion Description: </B>
+ Several JDO PersistenceManagers might be coresident and might
+ share the same persistence capable classes] (although a JDO instance can be
+ associated with only one PersistenceManager at a time)
+ */
+
+public class PMsCanSharePCClassesButNotPCInstances extends JDO_Test {
+
+    /** */
+    private static final String ASSERTION_FAILED = 
+        "Assertions A5.2-1,A5.2-2,A5.2-3 (PMsCanSharePCClassesButNotPCInstances) failed: ";
+
+    /** The number of active threads. Each thread has its own PM. */
+    private int threads = 0;
+
+    /** The total number of attempts to insert PC instances */
+    private int attempts = 0;
+
+    /** The number of inserters. Each inserter runs in its own thread. */
+    private int inserters = 5;
+
+    /** The number of objects inserted. */
+    protected int insertedCount = 0;
+
+    /** The number of objects that is expected to have been inserted. */
+    protected int insertedCountExpected = 0;
+
+    /**
+     * The <code>main</code> 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(PMsCanSharePCClassesButNotPCInstances.class);
+    }
+
+    public PMsCanSharePCClassesButNotPCInstances()
+    {
+    }
+
+    public void test() {
+        // test shared PC - only one PM should succeed to insert the shared PC
+        threads = 0;
+        attempts = 0;
+        insertedCount = 0;
+        insertedCountExpected = 1;
+        insertObjects(true);
+        
+        // test non-shared PCs - each PM should succeed to insert its own non-shared PC
+        threads = 0;
+        attempts = 0;
+        //insertedCount = 0; //Don't reset this value since we have not deleted the inserted object from the shared PC test above
+        insertedCountExpected += inserters;
+        insertObjects(false);
+    }
+
+    protected void insertObjects(boolean sharedPC) {
+        Object pc = null;
+
+        ThreadExceptionHandler threadGroup = new ThreadExceptionHandler();
+        for (int i = 0; i < inserters; i++) {
+            if (sharedPC) { // each thread shares one PC
+                if (pc==null)
+                    pc = new StateTransitionObj(i);
+            }
+            else { // each thread has its own PC
+                pc = new StateTransitionObj(i);
+            }
+            threads++;
+            Thread t = new Thread(threadGroup, new Inserter(pmf, pc, sharedPC));
+            t.setName("Inserter-" + i);
+            t.start();
+        }
+        
+        Thread.currentThread().yield();
+        
+        while (! attemptsComplete()) { 
+            try  {
+                Thread.currentThread().sleep(100);
+            } catch (InterruptedException ex) {
+                logger.debug("interrupted while waiting for threads to insert");
+            }
+        }
+
+        while (threads > 0) {
+            try {
+                Thread.currentThread().sleep(100);
+            } catch (InterruptedException ex) {
+                logger.debug("interrupted while waiting for threads to finish");
+            }
+        }
+    }
+
+    synchronized void signal() {
+        threads--;
+    }
+
+    protected synchronized void incrAttempts() {
+        attempts++;
+    }
+
+    protected synchronized boolean attemptsComplete() {
+        return attempts == inserters;
+    }
+
+    class Inserter implements Runnable {
+        private final PersistenceManager pm;
+        private final Object pc;
+        private final Class instanceClass;
+        private final boolean sharedPC;
+
+        Inserter(PersistenceManagerFactory pmf, Object pc, boolean sharedPC) {
+            this.pm = pmf.getPersistenceManager();
+            this.pc = pc;
+            this.instanceClass = pc.getClass();
+            this.sharedPC = sharedPC;
+        }
+
+        protected synchronized void announce(String msg, Object pc) {
+            insertedCount++;
+            Object oid = JDOHelper.getObjectId(pc);
+            if (debug)
+                logger.debug(msg + this.getClass().getName() + ": " + oid +
+                             ", " + pc);
+        }
+
+        public void run() {
+            Transaction tx = null;
+            try {
+                if (debug) logger.debug("running");
+                tx = pm.currentTransaction();
+                tx.begin();
+                try {
+                    pm.makePersistent(pc);
+                    announce("inserted ", pc);
+                    tx.commit();
+                }
+                catch (JDOException ex) {
+                    if (!sharedPC) //we expect an exception for all but one of the inserters in the case of a shared PC
+                        throw ex;
+                }
+                finally {
+                    if (tx != null && tx.isActive())
+                        tx.rollback();
+                }
+                incrAttempts();
+
+                while (!attemptsComplete()) {
+                    try {
+                        Thread.currentThread().sleep(100);
+                    } catch (InterruptedException ex) {
+                        if (debug) logger.debug(" interrupted");
+                    }
+                }
+
+                //Verify that the number of inserted objects matches the expected number
+                if (insertedCount!=insertedCountExpected)
+                {
+                    fail(ASSERTION_FAILED,
+                         "Wrong number of objects in extent. Inserted=" + 
+                         insertedCount + " Expected=" + insertedCountExpected);
+                }
+
+                if (debug) logger.debug("getting Extent");
+                int objCount = 0;
+                if (debug)
+                    logger.debug("getting Extent of " + instanceClass.getName());
+                Extent e = pm.getExtent(instanceClass, false);
+                for (Iterator i = e.iterator(); i.hasNext();) {
+                    Object instance = (Object)i.next();
+                    objCount++;
+                }
+
+                //Verify that the number of inserted objects matches the number of objects in the extent
+                if (insertedCount!=objCount)
+                {
+                    fail(ASSERTION_FAILED,
+                         "Wrong number of objects in extent. Inserted="+insertedCount+" Found="+objCount);
+                }
+            } finally {
+                if (tx != null && tx.isActive())
+                    tx.rollback();
+                if (pm != null && !pm.isClosed())
+                    pm.close();
+                PMsCanSharePCClassesButNotPCInstances.this.signal();
+            }
+        }
+
+        public String toString() {
+            String rc = "Inserter ";
+            if (debug) {
+                rc += Thread.currentThread().toString();
+            }
+            return rc;
+        }
+    }
+}



Mime
View raw message