svn commit: r160090 [5/63] - in incubator/jdo/trunk: ./ tck20/ tck20/assertions/ tck20/iut_jars/ tck20/test/ tck20/test/conf/ tck20/test/java/ tck20/test/java/org/ tck20/test/java/org/apache/ tck20/test/java/org/apache/jdo/ tck20/test/java/org/apache/jdo/tck/ tck20/test/java/org/apache/jdo/tck/api/ tck20/test/java/org/apache/jdo/tck/api/instancecallbacks/ tck20/test/java/org/apache/jdo/tck/api/jdohelper/ tck20/test/java/org/apache/jdo/tck/api/persistencemanager/ tck20/test/java/org/apache/jdo/tck/api/persistencemanager/cache/ tck20/test/java/org/apache/jdo/tck/api/persistencemanager/close/ tck20/test/java/org/apache/jdo/tck/api/persistencemanager/extent/ tck20/test/java/org/apache/jdo/tck/api/persistencemanager/flags/ tck20/test/java/org/apache/jdo/tck/api/persistencemanager/getobject/ tck20/test/java/org/apache/jdo/tck/api/persistencemanager/lifecycle/ tck20/test/java/org/apache/jdo/tck/api/persistencemanagerfactory/ tck20/test/java/org/apache/jdo/tck/enhancement/ tck20/test/java/org/apache/jdo/tck/extents/ tck20/test/java/org/apache/jdo/tck/lifecycle/ tck20/test/java/org/apache/jdo/tck/lifecycle/nontransactional/ tck20/test/java/org/apache/jdo/tck/models/ tck20/test/java/org/apache/jdo/tck/models/embedded/ tck20/test/java/org/apache/jdo/tck/models/fieldtypes/ tck20/test/java/org/apache/jdo/tck/models/inheritance/ tck20/test/java/org/apache/jdo/tck/pc/ tck20/test/java/org/apache/jdo/tck/pc/company/ tck20/test/java/org/apache/jdo/tck/pc/fieldtypes/ tck20/test/java/org/apache/jdo/tck/pc/inheritance/ tck20/test/java/org/apache/jdo/tck/pc/instancecallbacks/ tck20/test/java/org/apache/jdo/tck/pc/lifecycle/ tck20/test/java/org/apache/jdo/tck/pc/mylib/ tck20/test/java/org/apache/jdo/tck/query/ tck20/test/java/org/apache/jdo/tck/query/operators/ tck20/test/java/org/apache/jdo/tck/transactions/ tck20/test/java/org/apache/jdo/tck/util/ tck20/test/jdo/ tck20/test/jdo/applicationidentity/ tck20/test/jdo/applicationidentity/org/ tck20/test/jdo/applicationidentity/org/apache/ tck20/test/jdo/applicationidentity/org/apache/jdo/ tck20/test/jdo/applicationidentity/org/apache/jdo/tck/ tck20/test/jdo/applicationidentity/org/apache/jdo/tck/pc/ tck20/test/jdo/applicationidentity/org/apache/jdo/tck/pc/company/ tck20/test/jdo/applicationidentity/org/apache/jdo/tck/pc/fieldtypes/ tck20/test/jdo/applicationidentity/org/apache/jdo/tck/pc/inheritance/ tck20/test/jdo/applicationidentity/org/apache/jdo/tck/pc/instancecallbacks/ tck20/test/jdo/applicationidentity/org/apache/jdo/tck/pc/lifecycle/ tck20/test/jdo/applicationidentity/org/apache/jdo/tck/pc/mylib/ tck20/test/jdo/datastoreidentity/ tck20/test/jdo/datastoreidentity/org/ tck20/test/jdo/datastoreidentity/org/apache/ tck20/test/jdo/datastoreidentity/org/apache/jdo/ tck20/test/jdo/datastoreidentity/org/apache/jdo/tck/ tck20/test/jdo/datastoreidentity/org/apache/jdo/tck/pc/ tck20/test/jdo/datastoreidentity/org/apache/jdo/tck/pc/company/ tck20/test/jdo/datastoreidentity/org/apache/jdo/tck/pc/fieldtypes/ tck20/test/jdo/datastoreidentity/org/apache/jdo/tck/pc/inheritance/ tck20/test/jdo/datastoreidentity/org/apache/jdo/tck/pc/instancecallbacks/ tck20/test/jdo/datastoreidentity/org/apache/jdo/tck/pc/lifecycle/ tck20/test/jdo/datastoreidentity/org/apache/jdo/tck/pc/mylib/ tck20/test/orm/ tck20/test/orm/applicationidentity/ tck20/test/orm/applicationidentity/org/ tck20/test/orm/applicationidentity/org/apache/ tck20/test/orm/applicationidentity/org/apache/jdo/ tck20/test/orm/applicationidentity/org/apache/jdo/tck/ tck20/test/orm/applicationidentity/org/apache/jdo/tck/pc/ tck20/test/orm/applicationidentity/org/apache/jdo/tck/pc/company/ tck20/test/orm/applicationidentity/org/apache/jdo/tck/pc/fieldtypes/ tck20/test/orm/applicationidentity/org/apache/jdo/tck/pc/inheritance/ tck20/test/orm/applicationidentity/org/apache/jdo/tck/pc/instancecallbacks/ tck20/test/orm/applicationidentity/org/apache/jdo/tck/pc/lifecycle/ tck20/test/orm/applicationidentity/org/apache/jdo/tck/pc/mylib/ tck20/test/orm/datastoreidentity/ tck20/test/orm/datastoreidentity/org/ tck20/test/orm/datastoreidentity/org/apache/ tck20/test/orm/datastoreidentity/org/apache/jdo/ tck20/test/orm/datastoreidentity/org/apache/jdo/tck/ tck20/test/orm/datastoreidentity/org/apache/jdo/tck/pc/ tck20/test/orm/datastoreidentity/org/apache/jdo/tck/pc/company/ tck20/test/orm/datastoreidentity/org/apache/jdo/tck/pc/fieldtypes/ tck20/test/orm/datastoreidentity/org/apache/jdo/tck/pc/inheritance/ tck20/test/orm/datastoreidentity/org/apache/jdo/tck/pc/instancecallbacks/ tck20/test/orm/datastoreidentity/org/apache/jdo/tck/pc/lifecycle/ tck20/test/orm/datastoreidentity/org/apache/jdo/tck/pc/mylib/ tck20/test/sql/ tck20/test/sql/derby/

4 Apr 2005 19:50:35 -0000

Added: 
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/jdohelper/IsNewNotPersistenceCapable.java
URL: 
http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/jdohelper/IsNewNotPersistenceCapable.java?view=auto&rev=160090
==============================================================================
--- 
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/jdohelper/IsNewNotPersistenceCapable.java
 (added)
+++ 
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/jdohelper/IsNewNotPersistenceCapable.java
 Mon Apr  4 12:41:23 2005
@@ -0,0 +1,75 @@
+/*
+ * 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.api.jdohelper;
+
+import javax.jdo.JDOHelper;
+import javax.jdo.Transaction;
+
+import org.apache.jdo.tck.JDO_Test;
+import org.apache.jdo.tck.pc.mylib.Point;
+import org.apache.jdo.tck.util.BatchTestRunner;
+
+/**
+ *<B>Title:</B> Is New Not Persistence Capable
+ *<BR>
+ *<B>Keywords:</B> jdohelper 
+ *<BR>
+ *<B>Assertion ID:</B> A8.4.4-4
+ *<BR>
+ *<B>Assertion Description: </B>
+  The jdohelper.isNew method returns false If the instance does not implement 
PersistenceCapable
+  evaluating to true when == is used. 
+ */
+ /*
+ * Revision History
+ * ================
+ * Author         :    Date   :        Version  
+ * Azita Kamangar      10/2/01          1.0
+ */
+ 
+public class IsNewNotPersistenceCapable extends JDO_Test {
+
+    /** */
+    private static final String ASSERTION_FAILED = 
+        "Assertion A8.4.4-4 (IsNewNotPersistenceCapable) 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(IsNewNotPersistenceCapable.class);
+    }
+ 
+    /* test JDOHelper.isNew(Object pc)
+     *  
+     */
+    public void testIsNewNotPersistenceCapable() {
+        pm = getPM();
+        Transaction tx = pm.currentTransaction();
+        tx.begin();
+        Point p1 = new Point(1,3);
+        boolean isNew = JDOHelper.isNew(p1);
+        tx.commit();
+        if (isNew)
+               fail(ASSERTION_FAILED,
+                 "JDOHelper.isNew returns true for instance of non-pc class.");
+        pm.close();
+        pm = null;
+    }
+}

Propchange: 
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/jdohelper/IsNewNotPersistenceCapable.java
------------------------------------------------------------------------------
    svn:executable = *

Added: 
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/jdohelper/IsPersistent.java
URL: 
http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/jdohelper/IsPersistent.java?view=auto&rev=160090
==============================================================================
--- 
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/jdohelper/IsPersistent.java
 (added)
+++ 
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/jdohelper/IsPersistent.java
 Mon Apr  4 12:41:23 2005
@@ -0,0 +1,76 @@
+/*
+ * 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.api.jdohelper;
+
+import javax.jdo.JDOHelper;
+import javax.jdo.Transaction;
+
+import org.apache.jdo.tck.JDO_Test;
+import org.apache.jdo.tck.pc.mylib.PCPoint;
+import org.apache.jdo.tck.util.BatchTestRunner;
+
+/**
+ *<B>Title:</B> Is Persistent
+ *<BR>
+ *<B>Keywords:</B> jdohelper 
+ *<BR>
+ *<B>Assertion ID:</B> A8.4.3-1
+ *<BR>
+ *<B>Assertion Description: </B>
+  The JDOHelper.isPersistent method returns true if instances represent
+  persistent objects in the data store
+  true when == is used. 
+ */
+ /*
+ * Revision History
+ * ================
+ * Author         :    Date   :        Version  
+ * Azita Kamangar      10/2/01          1.0
+ */
+public class IsPersistent extends JDO_Test {
+
+    /** */
+    private static final String ASSERTION_FAILED = 
+        "Assertion A8.4.3-1 (IsPersistent) 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(IsPersistent.class);
+    }
+
+    /* test JDOHelper.isPersistent(Object pc)
+     *  
+     */
+    public void testIsPersistent() {
+       pm = getPM();
+        Transaction tx = pm.currentTransaction();
+        tx.begin();
+        PCPoint p1 = new PCPoint(1,3);
+        pm.makePersistent(p1);
+        boolean persistent = JDOHelper.isPersistent(p1);
+        tx.commit();
+        if (!persistent)
+            fail(ASSERTION_FAILED,
+                 "JDOHelper.isPersistent returns false for P-NEW instance.");
+        pm.close();
+        pm = null;
+    }
+}

Propchange: 
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/jdohelper/IsPersistent.java
------------------------------------------------------------------------------
    svn:executable = *

Added: 
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/jdohelper/IsPersistentFalse.java
URL: 
http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/jdohelper/IsPersistentFalse.java?view=auto&rev=160090
==============================================================================
--- 
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/jdohelper/IsPersistentFalse.java
 (added)
+++ 
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/jdohelper/IsPersistentFalse.java
 Mon Apr  4 12:41:23 2005
@@ -0,0 +1,75 @@
+/*
+ * 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.api.jdohelper;
+
+import javax.jdo.JDOHelper;
+import javax.jdo.Transaction;
+
+import org.apache.jdo.tck.JDO_Test;
+import org.apache.jdo.tck.pc.mylib.PCPoint;
+import org.apache.jdo.tck.util.BatchTestRunner;
+
+/**
+ *<B>Title:</B> Is Persistent False
+ *<BR>
+ *<B>Keywords:</B> jdohelper 
+ *<BR>
+ *<B>Assertion ID:</B> A8.4.3-2
+ *<BR>
+ *<B>Assertion Description: </B>
+  The jdohelper.isPersistent method returns false for instances which do not 
represent
+  persistent objects in the data store . 
+  evaluating to true when == is used. 
+ */
+ /*
+ * Revision History
+ * ================
+ * Author         :    Date   :        Version  
+ * Azita Kamangar      10/2/01          1.0
+ */
+public class IsPersistentFalse extends JDO_Test {
+
+    /** */
+    private static final String ASSERTION_FAILED = 
+        "Assertion A8.4.3-2 (IsPersistentFalse) 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(IsPersistentFalse.class);
+    }
+ 
+    /* test JDOHelper.isPersistent(Object pc)
+     *  
+     */
+    public void testIsPersistentFalse() {
+       pm = getPM();         
+       Transaction tx = pm.currentTransaction();
+       tx.begin();
+       PCPoint p1 = new PCPoint(1,3);
+       boolean persistent = JDOHelper.isPersistent(p1);
+       tx.commit();
+       if (persistent)
+              fail(ASSERTION_FAILED,
+                   "JDOHelper.isPersistent returns true for transient 
instance.");
+       pm.close();
+        pm = null;
+    }
+}

Propchange: 
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/jdohelper/IsPersistentFalse.java
------------------------------------------------------------------------------
    svn:executable = *

Added: 
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/jdohelper/IsPersistentForNull.java
URL: 
http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/jdohelper/IsPersistentForNull.java?view=auto&rev=160090
==============================================================================
--- 
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/jdohelper/IsPersistentForNull.java
 (added)
+++ 
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/jdohelper/IsPersistentForNull.java
 Mon Apr  4 12:41:23 2005
@@ -0,0 +1,74 @@
+/*
+ * Copyright 2005 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at 
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software 
+ * distributed under the License is distributed on an "AS IS" BASIS, 
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
+ * See the License for the specific language governing permissions and 
+ * limitations under the License.
+ */
+ 
+package org.apache.jdo.tck.api.jdohelper;
+
+import javax.jdo.JDOHelper;
+import javax.jdo.Transaction;
+
+import org.apache.jdo.tck.JDO_Test;
+import org.apache.jdo.tck.util.BatchTestRunner;
+
+/**
+ *<B>Title:</B> Is Persistent For Null
+ *<BR>
+ *<B>Keywords:</B> jdohelper 
+ *<BR>
+ *<B>Assertion ID:</B> A8.4.3-5
+ *<BR>
+ *<B>Assertion Description: </B>
+  The jdohelper.isPersistent method returns false for the instance which is 
null, 
+  evaluating to true when == is used. 
+ */
+
+/*
+ * Revision History
+ * ================
+ * Author         :    Date   :        Version  
+ * Azita Kamangar      10/2/01          1.0
+ */
+public class IsPersistentForNull extends JDO_Test {
+
+    /** */
+    private static final String ASSERTION_FAILED = 
+        "Assertion A8.4.3-5 (IsPersistentForNull) 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(IsPersistentForNull.class);
+    }
+
+    /* test JDOHelper.isPersistent(Object pc)
+     *  
+     */
+    public void testIsPersistentForNull() {
+       pm = getPM();
+       Transaction tx = pm.currentTransaction();
+       tx.begin();
+       Object p1 = null;
+       boolean persistent = JDOHelper.isPersistent(p1);
+       tx.commit();
+       if (persistent)
+               fail(ASSERTION_FAILED,
+                 "JDOHelper.isPersistent with argumnet null returns true.");
+        pm.close();
+        pm = null;
+    }
+}

Propchange: 
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/jdohelper/IsPersistentForNull.java
------------------------------------------------------------------------------
    svn:executable = *

Added: 
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/jdohelper/IsPersistentForTransient.java
URL: 
http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/jdohelper/IsPersistentForTransient.java?view=auto&rev=160090
==============================================================================
--- 
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/jdohelper/IsPersistentForTransient.java
 (added)
+++ 
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/jdohelper/IsPersistentForTransient.java
 Mon Apr  4 12:41:23 2005
@@ -0,0 +1,76 @@
+/*
+ * 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.api.jdohelper;
+
+import javax.jdo.JDOHelper;
+import javax.jdo.Transaction;
+
+import org.apache.jdo.tck.JDO_Test;
+import org.apache.jdo.tck.pc.mylib.PCPoint;
+import org.apache.jdo.tck.util.BatchTestRunner;
+
+/**
+ *<B>Title:</B> Is Persistent For Transient
+ *<BR>
+ *<B>Keywords:</B> jdohelper 
+ *<BR>
+ *<B>Assertion ID:</B> A8.4.3-3
+ *<BR>
+ *<B>Assertion Description: </B>
+  The jdohelper.isPersistent  method returns false If the instance is 
transient,  
+  evaluating to true when == is used. 
+ */
+  
+  /*
+ * Revision History
+ * ================
+ * Author         :    Date   :        Version  
+ * Azita Kamangar      10/2/01          1.0
+ */
+public class IsPersistentForTransient extends JDO_Test {
+
+    /** */
+    private static final String ASSERTION_FAILED = 
+        "Assertion A8.4.3-3 (IsPersistentForTransient) 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(IsPersistentForTransient.class);
+    }
+ 
+    /* test JDOHelper.isPersistent(Object pc)
+     *  
+     */
+    public void testIsPersistentForTransient() {
+       pm = getPM();
+       Transaction tx = pm.currentTransaction();
+       tx.begin();
+       PCPoint p1 = new PCPoint(1,3);
+       boolean persistent = JDOHelper.isPersistent(p1);
+       tx.commit();
+       if (persistent)
+               fail(ASSERTION_FAILED,
+                 "JDOHelper.isPersistent returns true for transient 
instance.");
+        pm.close();
+        pm = null;
+    }
+}
+ 

Propchange: 
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/jdohelper/IsPersistentForTransient.java
------------------------------------------------------------------------------
    svn:executable = *

Added: 
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/jdohelper/IsPersistentNotPersistenceCapable.java
URL: 
http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/jdohelper/IsPersistentNotPersistenceCapable.java?view=auto&rev=160090
==============================================================================
--- 
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/jdohelper/IsPersistentNotPersistenceCapable.java
 (added)
+++ 
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/jdohelper/IsPersistentNotPersistenceCapable.java
 Mon Apr  4 12:41:23 2005
@@ -0,0 +1,75 @@
+/*
+ * 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.api.jdohelper;
+
+import javax.jdo.JDOHelper;
+import javax.jdo.Transaction;
+
+import org.apache.jdo.tck.JDO_Test;
+import org.apache.jdo.tck.pc.mylib.Point;
+import org.apache.jdo.tck.util.BatchTestRunner;
+
+/**
+ *<B>Title:</B> Is Persistent Not Persistence Capable
+ *<BR>
+ *<B>Keywords:</B> jdohelper 
+ *<BR>
+ *<B>Assertion ID:</B> A8.4.3-4
+ *<BR>
+ *<B>Assertion Description: </B>
+  The jdohelper.isPersistent method returns false If the instance does not 
implement PersistenceCapable
+  evaluating to true when == is used. 
+ */
+ /*
+ * Revision History
+ * ================
+ * Author         :    Date   :        Version  
+ * Azita Kamangar      10/2/01          1.0
+ */
+ 
+public class IsPersistentNotPersistenceCapable extends JDO_Test {
+
+    /** */
+    private static final String ASSERTION_FAILED = 
+        "Assertion A8.4.3-4 (IsPersistentNotPersistenceCapable) 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(IsPersistentNotPersistenceCapable.class);
+    }
+
+    /* test JDOHelper.isPersistent(Object pc)
+     *  
+     */
+    public void testIsPersistentNotPersistenceCapable() {
+       pm = getPM();
+       Transaction tx = pm.currentTransaction();
+       tx.begin();
+       Point p1 = new Point(1,3);
+       boolean persistent = JDOHelper.isPersistent(p1);
+       tx.commit();
+       if (persistent)
+               fail(ASSERTION_FAILED,
+                 "JDOHelper.isPersistent returns false for instance of non-pc 
class.");
+        pm.close();
+        pm = null;
+    }
+}

Propchange: 
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/jdohelper/IsPersistentNotPersistenceCapable.java
------------------------------------------------------------------------------
    svn:executable = *

Added: 
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/jdohelper/IsTransactional.java
URL: 
http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/jdohelper/IsTransactional.java?view=auto&rev=160090
==============================================================================
--- 
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/jdohelper/IsTransactional.java
 (added)
+++ 
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/jdohelper/IsTransactional.java
 Mon Apr  4 12:41:23 2005
@@ -0,0 +1,83 @@
+/*
+ * 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.api.jdohelper;
+
+import javax.jdo.JDOHelper;
+import javax.jdo.Transaction;
+
+import org.apache.jdo.tck.JDO_Test;
+import org.apache.jdo.tck.pc.mylib.PCPoint;
+import org.apache.jdo.tck.util.BatchTestRunner;
+
+/**
+ *<B>Title:</B> Is Transactional
+ *<BR>
+ *<B>Keywords:</B> jdohelper 
+ *<BR>
+ *<B>Assertion ID:</B> A8.4.2-1
+ *<BR>
+ *<B>Assertion Description: </B>
+  The jdohelper.isTransactional method returns true and delegates to the 
parameter instance 
+  and instances whose state is associated with the current transaction .  
evaluating to true when == is used. 
+ */
+ /*
+ * Revision History
+ * ================
+ * Author         :    Date   :        Version  
+ * Azita Kamangar      10/4/01          1.0
+ */
+public class IsTransactional extends JDO_Test {
+
+    /** */
+    private static final String ASSERTION_FAILED = 
+        "Assertion A8.4.2-1 (IsTransactional) 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(IsTransactional.class);
+    }
+ 
+    /* test JDOHelper.IsTransactional(Object pc)
+     *  
+     */
+    public void testIsTransactional() {
+       pm = getPM();
+       Transaction tx = pm.currentTransaction();
+       tx.begin();
+       PCPoint p1 = new PCPoint(1,3);
+       pm.makePersistent(p1);
+        boolean transactional = JDOHelper.isTransactional(p1);
+        tx.commit();
+        if (!transactional)
+            fail(ASSERTION_FAILED,
+                 "JDOHelper.isTransactional returns false for P-NEW instance");
+
+        tx.begin();
+        // check transactional flag in new tx  
+        transactional = JDOHelper.isTransactional(p1);
+        tx.commit();
+        if (transactional)
+            fail(ASSERTION_FAILED,
+                 "JDOHelper.isTransactional returns true for P-HOLLOW/P-NONTX 
instance");
+        pm.close();
+        pm = null;
+    }
+}

Propchange: 
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/jdohelper/IsTransactional.java
------------------------------------------------------------------------------
    svn:executable = *

Added: 
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/jdohelper/IsTransactionalFalse.java
URL: 
http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/jdohelper/IsTransactionalFalse.java?view=auto&rev=160090
==============================================================================
--- 
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/jdohelper/IsTransactionalFalse.java
 (added)
+++ 
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/jdohelper/IsTransactionalFalse.java
 Mon Apr  4 12:41:23 2005
@@ -0,0 +1,88 @@
+/*
+ * 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.api.jdohelper;
+
+import javax.jdo.JDOHelper;
+import javax.jdo.Transaction;
+
+import org.apache.jdo.tck.JDO_Test;
+import org.apache.jdo.tck.pc.mylib.PCPoint;
+import org.apache.jdo.tck.util.BatchTestRunner;
+
+/**
+ *<B>Title:</B> Is Transactional False
+ *<BR>
+ *<B>Keywords:</B> jdohelper 
+ *<BR>
+ *<B>Assertion ID:</B> A8.4.2-2
+ *<BR>
+ *<B>Assertion Description: </B>
+  The jdohelper.isTransactional method returns false and delegates to the 
parameter
+instance and instances whose state is not associated with the current 
transaction return false. 
+ */
+ /*
+ * Revision History
+ * ================
+ * Author         :    Date   :        Version  
+ * Azita Kamangar      10/4/01          1.0
+ */
+public class IsTransactionalFalse extends JDO_Test {
+
+    /** */
+    private static final String ASSERTION_FAILED = 
+        "Assertion A8.4.2-2 (IsTransactionalFalse) 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(IsTransactionalFalse.class);
+    }
+ 
+    /* test JDOHelper.IsTransactionalFalse(Object pc)
+     *  
+     */
+    public void testIsTransactionalFalse() {
+       pm = getPM();
+       Transaction tx = pm.currentTransaction();
+       tx.begin();
+       PCPoint p1 = new PCPoint(1,3);
+       pm.makePersistent(p1);
+       tx.commit();
+          
+       tx.begin();
+       boolean transactional = JDOHelper.isTransactional(p1);
+       tx.commit();
+       if (transactional)
+               fail(ASSERTION_FAILED,
+                 "JDOHelper.isTransactional returns true for P-HOLLOW/P-NONTX 
instance");
+          
+       tx.begin();
+       // access field to make sure the instance is P-CLEAN
+       p1.getX();
+       transactional = JDOHelper.isTransactional(p1);
+       tx.commit();
+       if (!transactional)
+               fail(ASSERTION_FAILED,
+                 "JDOHelper.isTransactional returns false for P-CLEAN 
instance");
+
+       pm.close();
+        pm = null;
+    }
+}

Propchange: 
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/jdohelper/IsTransactionalFalse.java
------------------------------------------------------------------------------
    svn:executable = *

Added: 
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/jdohelper/IsTransactionalForNull.java
URL: 
http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/jdohelper/IsTransactionalForNull.java?view=auto&rev=160090
==============================================================================
--- 
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/jdohelper/IsTransactionalForNull.java
 (added)
+++ 
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/jdohelper/IsTransactionalForNull.java
 Mon Apr  4 12:41:23 2005
@@ -0,0 +1,72 @@
+/*
+ * Copyright 2005 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at 
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software 
+ * distributed under the License is distributed on an "AS IS" BASIS, 
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
+ * See the License for the specific language governing permissions and 
+ * limitations under the License.
+ */
+ 
+package org.apache.jdo.tck.api.jdohelper;
+
+import javax.jdo.JDOHelper;
+import javax.jdo.Transaction;
+
+import org.apache.jdo.tck.JDO_Test;
+import org.apache.jdo.tck.util.BatchTestRunner;
+
+/**
+ *<B>Title:</B> Is Transactional For Null
+ *<BR>
+ *<B>Keywords:</B> jdohelper 
+ *<BR>
+ *<B>Assertion ID:</B> A8.4.2-5
+ *<BR>
+ *<B>Assertion Description: </B>
+  The jdohelper.isTransactional method returns false, if the instance is null.
+ */
+ /*
+ * Revision History
+ * ================
+ * Author         :    Date   :        Version  
+ * Azita Kamangar      10/4/01          1.0
+ */
+public class IsTransactionalForNull extends JDO_Test {
+
+    /** */
+    private static final String ASSERTION_FAILED = 
+        "Assertion A8.4.2-5 (IsTransactionalForNull) 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(IsTransactionalForNull.class);
+    }
+
+    /* test JDOHelper.IsTransactionalForNull(Object pc)
+     *  
+     */
+    public void testIsTransactionalForNull() {
+       pm = getPM();
+       Transaction tx = pm.currentTransaction();
+       tx.begin();
+       Object p1 = null;
+        boolean transactional = JDOHelper.isTransactional(p1);
+        tx.commit();
+        if (transactional)
+            fail(ASSERTION_FAILED,
+                 "JDOHelper.isTransactional with argument null returns true.");
+        pm.close();
+        pm = null;
+    }
+}

Propchange: 
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/jdohelper/IsTransactionalForNull.java
------------------------------------------------------------------------------
    svn:executable = *

Added: 
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/jdohelper/IsTransactionalForTransient.java
URL: 
http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/jdohelper/IsTransactionalForTransient.java?view=auto&rev=160090
==============================================================================
--- 
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/jdohelper/IsTransactionalForTransient.java
 (added)
+++ 
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/jdohelper/IsTransactionalForTransient.java
 Mon Apr  4 12:41:23 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.api.jdohelper;
+
+import javax.jdo.JDOHelper;
+import javax.jdo.Transaction;
+
+import org.apache.jdo.tck.JDO_Test;
+import org.apache.jdo.tck.pc.mylib.PCPoint;
+import org.apache.jdo.tck.util.BatchTestRunner;
+
+/**
+ *<B>Title:</B> Is Transactional For Transient
+ *<BR>
+ *<B>Keywords:</B> jdohelper 
+ *<BR>
+ *<B>Assertion ID:</B> A8.4.2-3
+ *<BR>
+ *<B>Assertion Description: </B>
+  The jdohelper.isTransactional method returns false if the instance is 
transien .  evaluating to true when == is used. 
+ */
+ /*
+ * Revision History
+ * ================
+ * Author         :    Date   :        Version  
+ * Azita Kamangar      10/4/01          1.0
+ */
+public class IsTransactionalForTransient extends JDO_Test {
+
+    /** */
+    private static final String ASSERTION_FAILED = 
+        "Assertion A8.4.2-3 (IsTransactionalForTransient) 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(IsTransactionalForTransient.class);
+    }
+
+    /* test JDOHelper.IsTransactionalForTransient(Object pc)
+     *  
+     */
+    public void testIsTransactionalForTransient() {
+       pm = getPM();
+       Transaction tx = pm.currentTransaction();
+       tx.begin();
+       PCPoint p1 = new PCPoint(1,3);
+       boolean transactional = JDOHelper.isTransactional(p1);
+       tx.commit();
+       if (transactional)
+               fail(ASSERTION_FAILED,
+                 "JDOHelper.isTransactional returns true for transient 
instance.");
+       pm.close();
+        pm = null;
+    }
+}

Propchange: 
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/jdohelper/IsTransactionalForTransient.java
------------------------------------------------------------------------------
    svn:executable = *

Added: 
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/jdohelper/IsTransactionalNotPersistenceCapable.java
URL: 
http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/jdohelper/IsTransactionalNotPersistenceCapable.java?view=auto&rev=160090
==============================================================================
--- 
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/jdohelper/IsTransactionalNotPersistenceCapable.java
 (added)
+++ 
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/jdohelper/IsTransactionalNotPersistenceCapable.java
 Mon Apr  4 12:41:23 2005
@@ -0,0 +1,74 @@
+/*
+ * Copyright 2005 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at 
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software 
+ * distributed under the License is distributed on an "AS IS" BASIS, 
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
+ * See the License for the specific language governing permissions and 
+ * limitations under the License.
+ */
+ 
+package org.apache.jdo.tck.api.jdohelper;
+
+import javax.jdo.JDOHelper;
+import javax.jdo.Transaction;
+
+import org.apache.jdo.tck.JDO_Test;
+import org.apache.jdo.tck.pc.mylib.Point;
+import org.apache.jdo.tck.util.BatchTestRunner;
+
+/**
+ *<B>Title:</B> Is Transactional Not Persistence Capable
+ *<BR>
+ *<B>Keywords:</B> jdohelper 
+ *<BR>
+ *<B>Assertion ID:</B> A8.4.2-4
+ *<BR>
+ *<B>Assertion Description: </B>
+  The jdohelper.isTransactional method returns false If 
+  the instance does not implement PersistenceCapable .  evaluating to true 
when == is used. 
+ */
+ /*
+ * Revision History
+ * ================
+ * Author         :    Date   :        Version  
+ * Azita Kamangar      10/4/01          1.0
+ */
+public class IsTransactionalNotPersistenceCapable extends JDO_Test {
+
+    /** */
+    private static final String ASSERTION_FAILED = 
+        "Assertion A8.4.2-4 (IsTransactionalNotPersistenceCapable) 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(IsTransactionalNotPersistenceCapable.class);
+    }
+
+    /* test JDOHelper.IsTransactionalNotPersistenceCapable(Object pc)
+     *  
+     */
+    public void testIsTransactionalNotPersistenceCapable() {
+       pm = getPM(); 
+       Transaction tx = pm.currentTransaction();
+       tx.begin();
+       Point p1 = new Point(1,3);
+        boolean transactional = JDOHelper.isTransactional(p1);
+        tx.commit();
+        if (transactional)
+            fail(ASSERTION_FAILED,
+                 "JDOHelper.isTransactional returns true for instance of 
non-pc class.");
+        pm.close();
+        pm = null;
+    }
+}

Propchange: 
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/jdohelper/IsTransactionalNotPersistenceCapable.java
------------------------------------------------------------------------------
    svn:executable = *

Added: 
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/jdohelper/MakeDirty.java
URL: 
http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/jdohelper/MakeDirty.java?view=auto&rev=160090
==============================================================================
--- 
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/jdohelper/MakeDirty.java
 (added)
+++ 
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/jdohelper/MakeDirty.java
 Mon Apr  4 12:41:23 2005
@@ -0,0 +1,83 @@
+/*
+ * 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.api.jdohelper;
+
+import javax.jdo.JDOHelper;
+import javax.jdo.Transaction;
+
+import org.apache.jdo.tck.JDO_Test;
+import org.apache.jdo.tck.pc.mylib.PCPoint;
+import org.apache.jdo.tck.util.BatchTestRunner;
+
+/**
+ *<B>Title:</B> Make Dirty 
+ *<BR>
+ *<B>Keywords:</B> jdohelper 
+ *<BR>
+ *<B>Assertion ID:</B> A8.2-1
+ *<BR>
+ *<B>Assertion Description: </B>
+  The jdohelper.makeDirty method delegates to the parameter instance
+   and marks the specified field  dirty if parameter is instance of Persistence
+   capable .  evaluating to true when == is used. 
+ */
+ /*
+ * Revision History
+ * ================
+ * Author         :     Date   :    Version  
+ * Azita Kamangar   10/2/01      1.0
+ */
+public class MakeDirty extends JDO_Test {
+
+    /** */
+    private static final String ASSERTION_FAILED = 
+        "Assertion A8.2-1 (MakeDirty) 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(MakeDirty.class);
+    }
+
+    /* test JDOHelper.MakeDirty(Object pc)
+     *  
+     */
+    public void testMakeDirty() {
+        pm = getPM();
+        Transaction tx = pm.currentTransaction();
+        tx.begin();
+        PCPoint p1 = new PCPoint(1,3);
+        pm.makePersistent(p1);
+        if (debug) logger.debug(" isDirty1:"+ JDOHelper.isDirty(p1));  
+        tx.commit();
+        if (debug) logger.debug(" isDirty2:" + JDOHelper.isDirty(p1));
+        
+        tx.begin();
+        JDOHelper.makeDirty(p1,"x");
+        boolean dirty = JDOHelper.isDirty(p1);
+        tx.commit();
+        if (debug) logger.debug(" isDirty3:" + dirty);
+        if (!dirty)
+            fail(ASSERTION_FAILED,
+                 "Instance is not dirty after calling JDOHelper.makeDirty");
+        pm.close();
+        pm = null;
+    }
+}

Propchange: 
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/jdohelper/MakeDirty.java
------------------------------------------------------------------------------
    svn:executable = *

Added: 
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/jdohelper/MakeDirtyForNull.java
URL: 
http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/jdohelper/MakeDirtyForNull.java?view=auto&rev=160090
==============================================================================
--- 
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/jdohelper/MakeDirtyForNull.java
 (added)
+++ 
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/jdohelper/MakeDirtyForNull.java
 Mon Apr  4 12:41:23 2005
@@ -0,0 +1,75 @@
+/*
+ * 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.api.jdohelper;
+
+import javax.jdo.JDOHelper;
+import javax.jdo.Transaction;
+
+import org.apache.jdo.tck.JDO_Test;
+import org.apache.jdo.tck.util.BatchTestRunner;
+
+/**
+ *<B>Title:</B> Make Dirty For Null
+ *<BR>
+ *<B>Keywords:</B> jdohelper 
+ *<BR>
+ *<B>Assertion ID:</B> A8.2-3
+ *<BR>
+ *<B>Assertion Description: </B>
+  The JDOHelper.makeDirty method has no affect if the instance is null, 
+  evaluating to true when == is used. 
+ */
+
+/*
+ * Revision History
+ * ================
+ * Author         :     Date   :    Version  
+ * Azita Kamangar   9/27/01      1.0
+ */
+public class MakeDirtyForNull extends JDO_Test {
+
+    /** */
+    private static final String ASSERTION_FAILED = 
+        "Assertion A8.2-3 (MakeDirtyForNull) 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(MakeDirtyForNull.class);
+    }
+ 
+    /* test JDOHelper.makeDirthy(Object pc)
+     *  
+     */
+    public void testMakeDirtyForNull() {
+        pm = getPM();
+        Transaction tx = pm.currentTransaction();
+        tx.begin();
+        Object p1 = null;
+        JDOHelper.makeDirty(p1,"x");
+        boolean dirty = JDOHelper.isDirty(p1);
+        tx.commit();
+        if (dirty)
+            fail(ASSERTION_FAILED,
+                 "null instance is dirty after calling JDOHelper.makeDirty.");
+        pm.close();
+        pm = null;
+    }
+}

Propchange: 
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/jdohelper/MakeDirtyForNull.java
------------------------------------------------------------------------------
    svn:executable = *

Added: 
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/jdohelper/MakeDirtyForTransient.java
URL: 
http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/jdohelper/MakeDirtyForTransient.java?view=auto&rev=160090
==============================================================================
--- 
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/jdohelper/MakeDirtyForTransient.java
 (added)
+++ 
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/jdohelper/MakeDirtyForTransient.java
 Mon Apr  4 12:41:23 2005
@@ -0,0 +1,78 @@
+/*
+ * 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.api.jdohelper;
+
+import javax.jdo.JDOHelper;
+import javax.jdo.Transaction;
+
+import org.apache.jdo.tck.JDO_Test;
+import org.apache.jdo.tck.pc.mylib.PCPoint;
+import org.apache.jdo.tck.util.BatchTestRunner;
+
+/**
+ *<B>Title:</B> Make Dirty For Transient
+ *<BR>
+ *<B>Keywords:</B> jdohelper 
+ *<BR>
+ *<B>Assertion ID:</B> A8.2-2
+ *<BR>
+ *<B>Assertion Description: </B>
+  The JDOHelper.makeDirty method has no affect if the instance is transient, 
+  evaluating to true when == is used. 
+ */
+
+/*
+ * Revision History
+ * ================
+ * Author         :     Date   :    Version  
+ * Azita Kamangar   10/3/01      1.0
+ */
+public class MakeDirtyForTransient extends JDO_Test {
+
+    /** */
+    private static final String ASSERTION_FAILED = 
+        "Assertion A8.2-2 (MakeDirtyForTransient) 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(MakeDirtyForTransient.class);
+    }
+
+    /* test JDOHelper.makeDirthy(Object pc)
+     *  
+     */
+    public void testMakeDirtyForTransient() {
+        pm = getPM();
+        Transaction tx = pm.currentTransaction();
+        tx.begin();
+        PCPoint p1 = new PCPoint(1,2);
+        if (debug) logger.debug(" isDirty1:"+ JDOHelper.isDirty(p1));
+        JDOHelper.makeDirty(p1,"x");
+        if (debug) logger.debug(" isDirty2:"+ JDOHelper.isDirty(p1));
+        boolean dirty = JDOHelper.isDirty(p1);
+        tx.commit();
+        if (dirty)
+            fail(ASSERTION_FAILED,
+                 "transient instance is dirty after calling 
JDOHelper.makeDirty.");
+        pm.close();
+        pm = null;
+    }
+}

Propchange: 
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/jdohelper/MakeDirtyForTransient.java
------------------------------------------------------------------------------
    svn:executable = *

Added: 
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/jdohelper/MakeDirtyNotPersistenceCapable.java
URL: 
http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/jdohelper/MakeDirtyNotPersistenceCapable.java?view=auto&rev=160090
==============================================================================
--- 
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/jdohelper/MakeDirtyNotPersistenceCapable.java
 (added)
+++ 
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/jdohelper/MakeDirtyNotPersistenceCapable.java
 Mon Apr  4 12:41:23 2005
@@ -0,0 +1,76 @@
+/*
+ * 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.api.jdohelper;
+
+import javax.jdo.JDOHelper;
+import javax.jdo.Transaction;
+
+import org.apache.jdo.tck.JDO_Test;
+import org.apache.jdo.tck.pc.mylib.Point;
+import org.apache.jdo.tck.util.BatchTestRunner;
+
+/**
+ *<B>Title:</B> Make Dirty Not Persistence Capable
+ *<BR>
+ *<B>Keywords:</B> jdohelper 
+ *<BR>
+ *<B>Assertion ID:</B> A8.2-4
+ *<BR>
+ *<B>Assertion Description: </B>
+  The JDOHelper.makeDirty method has no affect if the instance is not 
persistence capable
+  evaluating to true when == is used. 
+ */
+
+/*
+ * Revision History
+ * ================
+ * Author         :     Date   :    Version  
+ * Azita Kamangar   10/3/01      1.0
+ */
+public class MakeDirtyNotPersistenceCapable extends JDO_Test {
+
+    /** */
+    private static final String ASSERTION_FAILED = 
+        "Assertion A8.2-4 (MakeDirtyNotPersistenceCapable) 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(MakeDirtyNotPersistenceCapable.class);
+    }
+
+    /* test JDOHelper.makeDirthy(Object pc)
+     *  
+     */
+    public void testMakeDirtyNotPersistenceCapable() {
+        pm = getPM();
+        Transaction tx = pm.currentTransaction();
+        tx.begin();
+        Point p1 = new Point(1,2);
+        JDOHelper.makeDirty(p1,"x");
+        boolean dirty = JDOHelper.isDirty(p1);
+        tx.commit();
+        if (dirty)
+            fail(ASSERTION_FAILED,
+                 "instance of non-pc class is dirty after calling 
JDOHelper.makeDirty.");
+        pm.close();
+        pm = null;
+    }
+}

Propchange: 
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/jdohelper/MakeDirtyNotPersistenceCapable.java
------------------------------------------------------------------------------
    svn:executable = *

Added: 
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/persistencemanager/ChangingObjectIdHasNoEffectOnInstance.java
URL: 
http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/persistencemanager/ChangingObjectIdHasNoEffectOnInstance.java?view=auto&rev=160090
==============================================================================
--- 
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/persistencemanager/ChangingObjectIdHasNoEffectOnInstance.java
 (added)
+++ 
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/persistencemanager/ChangingObjectIdHasNoEffectOnInstance.java
 Mon Apr  4 12:41:23 2005
@@ -0,0 +1,67 @@
+/*
+ * 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.api.persistencemanager;
+
+import org.apache.jdo.tck.util.BatchTestRunner;
+
+/**
+ *<B>Title:</B> Changing ObjectId Has No Effect On Instance
+ *<BR>
+ *<B>Keywords:</B> identity
+ *<BR>
+ *<B>Assertion ID:</B> A12.5.6-13.
+ *<BR>
+ *<B>Assertion Description: </B>
+If the application makes a change to the <code>ObjectId</code> instance
+returned by <code>PersistenceManager.getObjectId</code>, there is no effect
+on the instance from which the <code>ObjectId</code> was obtained.
+
+ */
+
+public class ChangingObjectIdHasNoEffectOnInstance extends 
PersistenceManagerTest {
+
+    /** */
+    private static final String ASSERTION_FAILED = 
+        "Assertion A12.5.6-13 (ChangingObjectIdHasNoEffectOnInstance) 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(ChangingObjectIdHasNoEffectOnInstance.class);
+    }
+
+    /** */
+    public void testChangingObjectIdHasNoEffectOnInstance() throws Exception {
+        pm = getPM();
+        Object oid = createPCPointInstance(pm);
+        Object p1 = pm.getObjectById(oid, false);
+        Object oid2 = pm.getObjectId(p1);
+        
+        mangleObject(oid);
+        // now oid3 should equal oid2 even though we mangled oid
+        Object oid3 = getPM().getObjectId(p1);
+        if (!oid2.equals(oid3))
+               fail(ASSERTION_FAILED,
+                    "Changing the ObjectId returned by getObjectId has an 
effect on ObjectId's returned by subsequent calls of getObjectId");
+        pm.close();
+        pm = null;
+    }          
+}

Propchange: 
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/persistencemanager/ChangingObjectIdHasNoEffectOnInstance.java
------------------------------------------------------------------------------
    svn:executable = *

Added: 
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/persistencemanager/ConcurrentPersistenceManagers.java
URL: 
http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/persistencemanager/ConcurrentPersistenceManagers.java?view=auto&rev=160090
==============================================================================
--- 
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/persistencemanager/ConcurrentPersistenceManagers.java
 (added)
+++ 
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/persistencemanager/ConcurrentPersistenceManagers.java
 Mon Apr  4 12:41:23 2005
@@ -0,0 +1,92 @@
+/*
+ * 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.api.persistencemanager;
+
+import java.util.Properties;
+
+import javax.jdo.JDOHelper;
+import javax.jdo.PersistenceManager;
+import javax.jdo.PersistenceManagerFactory;
+import javax.jdo.Transaction;
+
+import org.apache.jdo.tck.JDO_Test;
+import org.apache.jdo.tck.util.BatchTestRunner;
+
+/**
+ *<B>Title:</B> Concurrent Persistence Managers
+ *<BR>
+ *<B>Keywords:</B> concurrency multipleJDOimpls
+ *<BR>
+ *<B>Assertion ID:</B> A5.2-1.
+ *<BR>
+ *<B>Assertion Description: </B>
+An implementation should support its own <code>PersistenceManager</code>
+concurrently with another <code>PersistenceManager</code>.
+A non-reference implementation will be tested concurrently
+with the Reference Implementation.
+
+ */
+
+public class ConcurrentPersistenceManagers extends JDO_Test {
+
+    /** */
+    private static final String ASSERTION_FAILED = 
+        "Assertion A5.2-1 (ConcurrentPersistenceManagers) 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(ConcurrentPersistenceManagers.class);
+    }
+
+    /** */
+    public void test() {
+       Properties pmfProperties = loadPMF2Properties();
+       PersistenceManagerFactory pmf2 = 
JDOHelper.getPersistenceManagerFactory(pmfProperties);
+       PersistenceManager pm2 = pmf2.getPersistenceManager();
+       Transaction tx2 = pm2.currentTransaction();
+        pm = getPM();
+       Transaction tx = pm.currentTransaction();
+        try {
+            tx.begin();
+            tx2.begin();
+            tx.commit();
+            tx = null;
+            tx2.commit();
+            tx2 = null;
+        }
+        finally {
+            cleanupPM(pm);
+            pm = null;
+            cleanupPM(pm2);
+            pm2 = null;
+            pmf2.close();
+        }
+    }
+
+    private Properties loadPMF2Properties() {
+       String PMF2 = System.getProperty ("PMF2Properties", 
"jdori2.properties");
+       if (debug) logger.debug("Got PMF2Properties file name:" + PMF2);
+       Properties ret = loadProperties (PMF2);
+       if (debug) logger.debug("Got PMF2Properties: " + ret);
+       return ret;
+    }
+}

Propchange: 
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/persistencemanager/ConcurrentPersistenceManagers.java
------------------------------------------------------------------------------
    svn:executable = *

Added: 
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/persistencemanager/ConcurrentPersistenceManagersSameClasses.java
URL: 
http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/persistencemanager/ConcurrentPersistenceManagersSameClasses.java?view=auto&rev=160090
==============================================================================
--- 
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/persistencemanager/ConcurrentPersistenceManagersSameClasses.java
 (added)
+++ 
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/persistencemanager/ConcurrentPersistenceManagersSameClasses.java
 Mon Apr  4 12:41:23 2005
@@ -0,0 +1,137 @@
+/*
+ * 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.api.persistencemanager;
+
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.Properties;
+
+import javax.jdo.JDOHelper;
+import javax.jdo.PersistenceManager;
+import javax.jdo.PersistenceManagerFactory;
+import javax.jdo.Query;
+import javax.jdo.Transaction;
+
+import org.apache.jdo.tck.JDO_Test;
+import org.apache.jdo.tck.pc.mylib.PCPoint;
+import org.apache.jdo.tck.pc.mylib.PCRect;
+import org.apache.jdo.tck.util.BatchTestRunner;
+
+/**
+ *<B>Title:</B> Same Classes with Concurrent Persistence Managers
+ *<BR>
+ *<B>Keywords:</B> concurrency multipleJDOimpls
+ *<BR>
+ *<B>Assertion ID:</B> A5.2-2.
+ *<BR>
+ *<B>Assertion Description: </B>
+The same classes must be supported concurrently by multiple
+<code>PersistenceManager</code>s from different implementations.
+
+ */
+
+public class ConcurrentPersistenceManagersSameClasses extends JDO_Test {
+
+    /** */
+    private static final String ASSERTION_FAILED = 
+        "Assertion A5.2-2 (ConcurrentPersistenceManagersSameClasses) 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(ConcurrentPersistenceManagersSameClasses.class);
+    }
+    
+    /** */
+    public void test() {
+       Properties pmfProperties = loadPMF2Properties();
+        PersistenceManagerFactory pmf2 = 
JDOHelper.getPersistenceManagerFactory(pmfProperties);
+        PersistenceManager pm2 = pmf2.getPersistenceManager();
+        Transaction tx2 = pm2.currentTransaction();
+        
+        pm = getPM();
+        Transaction tx = pm.currentTransaction();
+        try {
+            tx.begin();
+            tx2.begin();
+            
+            PCPoint p11 = new PCPoint(110, 120);
+            PCPoint p12 = new PCPoint(120, 140);
+            PCRect rect1 = new PCRect (0, p11, p12);
+            pm.makePersistent (rect1);
+            
+            PCPoint p21 = new PCPoint(210, 220);
+            PCPoint p22 = new PCPoint(220, 240);
+            PCRect rect2 = new PCRect (0, p21, p22);
+            pm2.makePersistent (rect2);
+            
+            tx.commit();
+            tx2.commit();
+        
+            tx.begin();
+            tx2.begin();
+            
+            PCPoint p11a = findPoint (pm, 110, 120);
+            if (p11a != p11) {
+                fail(ASSERTION_FAILED, 
+                     "unexpected PCPoint instance, expected: 110, 120, found: 
" + p11a.getX() + ", " + p11a.getY());
+            }
+            
+            PCPoint p21a = findPoint (pm2, 210, 220);
+            if (p21a != p21) {
+                fail(ASSERTION_FAILED, 
+                     "unexpected PCPoint instance, expected: 210, 220, found: 
" + p21a.getX() + ", " + p21a.getY());
+            }
+            
+            tx.commit();
+            tx = null;
+            tx2.commit();
+            tx2 = null;
+        }
+        finally {
+            cleanupPM(pm);
+            pm = null;
+            cleanupPM(pm2);
+            pm2 = null;
+            pmf2.close();
+        }
+    }
+
+    /** */
+    private Properties loadPMF2Properties() {
+        String PMF2 = System.getProperty ("PMF2Properties", 
"jdori2.properties");
+        if (debug) logger.debug("Got PMF2Properties file name:" + PMF2);
+        Properties ret = loadProperties (PMF2);
+        if (debug) logger.debug("Got PMF2Properties: " + ret);
+        return ret;
+    }
+
+    /** */
+    private PCPoint findPoint (PersistenceManager pm, int x, int y) {
+        Query q = pm.newQuery (PCPoint.class);
+        q.declareParameters ("int px, int py");
+        q.setFilter ("x == px & y == py");
+        Collection results = (Collection)q.execute (new Integer(x), new 
Integer(y));
+        Iterator it = results.iterator();
+        PCPoint ret = (PCPoint)it.next();
+        return ret;
+    }
+}

Propchange: 
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/persistencemanager/ConcurrentPersistenceManagersSameClasses.java
------------------------------------------------------------------------------
    svn:executable = *

Added: 
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/persistencemanager/CurrentTransaction.java
URL: 
http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/persistencemanager/CurrentTransaction.java?view=auto&rev=160090
==============================================================================
--- 
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/persistencemanager/CurrentTransaction.java
 (added)
+++ 
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/persistencemanager/CurrentTransaction.java
 Mon Apr  4 12:41:23 2005
@@ -0,0 +1,63 @@
+/*
+ * 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.api.persistencemanager;
+
+import javax.jdo.Transaction;
+
+import org.apache.jdo.tck.pc.mylib.PCPoint;
+import org.apache.jdo.tck.util.BatchTestRunner;
+
+/**
+ *<B>Title:</B> CurrentTransaction
+ *<BR>
+ *<B>Keywords:</B>
+ *<BR>
+ *<B>Assertion ID:</B> A12.5.2-1
+ *<BR>
+ *<B>Assertion Description: </B>
+The PersistenceManager.currentTransaction method returns the
+Transaction instance associated with the PersistenceManager.
+
+ */
+
+public class CurrentTransaction extends PersistenceManagerTest {
+
+    /** */
+    private static final String ASSERTION_FAILED = 
+        "Assertion A12.5.2-1 (CurrentTransaction) 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(CurrentTransaction.class);
+    }
+    
+    /** */
+    public void testCurrentTransaction() {
+        pm = getPM();
+        PCPoint p1 = new PCPoint();
+        Transaction tx = pm.currentTransaction();
+        tx.begin();
+        pm.makePersistent(p1);
+        tx.commit();
+        pm.close();
+        pm = null;
+    }
+}

Propchange: 
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/persistencemanager/CurrentTransaction.java
------------------------------------------------------------------------------
    svn:executable = *

Added: 
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/persistencemanager/DeletePersistent.java
URL: 
http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/persistencemanager/DeletePersistent.java?view=auto&rev=160090
==============================================================================
--- 
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/persistencemanager/DeletePersistent.java
 (added)
+++ 
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/persistencemanager/DeletePersistent.java
 Mon Apr  4 12:41:23 2005
@@ -0,0 +1,254 @@
+/*
+ * 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.api.persistencemanager;
+
+import java.util.Collection;
+import java.util.HashSet;
+
+import javax.jdo.JDOUserException;
+import javax.jdo.PersistenceManager;
+import javax.jdo.Transaction;
+
+import org.apache.jdo.tck.pc.mylib.PCPoint;
+import org.apache.jdo.tck.util.BatchTestRunner;
+
+/**
+ *<B>Title:</B> Delete Persistent
+ *<BR>
+ *<B>Keywords:</B>
+ *<BR>
+ *<B>Assertion IDs:</B> A12.5.7-9
+ *<BR>
+ *<B>Assertion Description: </B>
+PersistenceManager.deletePersistent and deletePersistentAll delete a 
persistent instance(s) from the data store. It must be called in the context of 
an active transaction, or a JDOUserExceptionis thrown. The representation in 
the data store will be deleted when this instance is flushed to the data store 
(via commit, or evict).
+
+ */
+
+public class DeletePersistent extends PersistenceManagerTest {
+    
+    /** */
+    private static final String ASSERTION_FAILED = 
+        "Assertion A12.5.7-9 (DeletePersistent) 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(DeletePersistent.class);
+    }
+    
+    private PCPoint p1 = null;
+    private PCPoint p2 = null;
+    private PCPoint p3 = null;
+    private PCPoint p4 = null;
+    private PCPoint p5 = null;
+
+    /** */
+    public void testDeletePersistent() {
+        pm = getPM();   
+        createObjects(pm);
+
+        /* positive tests */
+        /* method called in the context of an active transaction */
+        runTestDeletePersistent1(pm);
+        runTestDeletePersistent2(pm);
+        runTestDeletePersistent3(pm);
+
+        /* negative tests */
+        /* method called in the context of an non-active transaction */
+        runTestDeletePersistent4(pm);
+        runTestDeletePersistent5(pm);
+        runTestDeletePersistent6(pm);
+
+        pm.close();
+        pm = null;
+    }
+
+    /** */
+    private void  createObjects(PersistenceManager pm) {
+        Transaction tx = pm.currentTransaction();
+        try {
+            tx.begin();
+            p1 = new PCPoint(1,3);
+            p2 = new PCPoint(2,4);
+            p3 = new PCPoint(3,5);
+            p4 = new PCPoint(4,6);
+            p5 = new PCPoint(5,7);
+
+            pm.makePersistent(p1);
+            pm.makePersistent(p2);
+            pm.makePersistent(p3);
+            pm.makePersistent(p4);
+            pm.makePersistent(p5);
+
+            tx.commit();
+        }
+        finally {
+            if (tx.isActive())
+                tx.rollback();
+        }
+    }
+
+    /** test deletePersistent (Object pc) */
+    private void runTestDeletePersistent1(PersistenceManager pm) {
+        Transaction tx = pm.currentTransaction();
+        try {
+            tx = pm.currentTransaction();
+            tx.begin();
+            pm.deletePersistent(p1);
+            tx.commit();
+            if (debug) logger.debug(" \nPASSED in testDeletePersistent1()");
+        }
+        finally {
+            if (tx.isActive())
+                tx.rollback();
+        }        
+    }
+
+    /* test deletePersistentAll (Collection pcs) */
+    private void runTestDeletePersistent2(PersistenceManager pm) {
+        Transaction tx = pm.currentTransaction();
+        try {
+            tx.begin();
+
+            Collection col1 = new java.util.HashSet();
+            col1.add(p2);
+            col1.add(p3);
+
+            pm.deletePersistentAll(col1);
+            tx.commit();
+            if (debug) logger.debug(" \nPASSED in testDeletePersistent2()");
+        } 
+        finally {
+            if (tx.isActive())
+                tx.rollback();
+        }   
+    }
+
+    /* test deletePersistentAll (Object[] o) */
+    private void runTestDeletePersistent3(PersistenceManager pm) {
+        Transaction tx = pm.currentTransaction();
+        try {
+            tx.begin();
+
+            Collection col1 = new HashSet();
+            col1.add(p4);
+            col1.add(p5);
+
+            Object[] obj1= col1.toArray();
+
+            pm.deletePersistentAll(obj1);
+            tx.commit();
+            if (debug) logger.debug(" \nPASSED in testDeletePersistent3()");
+        }
+        finally {
+            if (tx.isActive())
+                tx.rollback();
+        }
+    }
+
+    /* test deletePersistent (Object pc) */
+    public void runTestDeletePersistent4(PersistenceManager pm) {
+        Transaction tx = pm.currentTransaction();
+        try {
+            tx.begin();
+            PCPoint np1 = new PCPoint(1,3);
+            pm.makePersistent(np1);
+            tx.commit();
+            
+            try {
+                pm.deletePersistent(np1);
+                fail(ASSERTION_FAILED, 
+                     "pm.deletePersistent(Object) outside of tx should throw 
an exception");
+            }
+            catch (JDOUserException ex) {
+                // expected exception
+            }
+        }
+        finally {
+            if (tx.isActive())
+                tx.rollback();
+        }
+    }
+
+    /* test deletePersistentAll (Collection pcs) */
+    public void runTestDeletePersistent5(PersistenceManager pm) {
+        Transaction tx = pm.currentTransaction();
+        try {
+            tx.begin();
+
+            PCPoint np1 = new PCPoint (3,3);
+            PCPoint np2 = new PCPoint (4,4);
+            pm.makePersistent(np1);
+            pm.makePersistent(np2);
+            tx.commit();
+
+            Collection col1 = new java.util.HashSet();
+            col1.add(np1);
+            col1.add(np2);
+
+            try {
+                pm.deletePersistentAll(col1);
+                fail(ASSERTION_FAILED, 
+                     "pm.deletePersistentAll(Collection) outside of tx should 
throw an exception");
+            }
+            catch (JDOUserException ex) {
+                // expected exception
+            }
+        }
+        finally {
+            if (tx.isActive())
+                tx.rollback();
+        }
+   }
+
+    /* test deletePersistentAll (Object[] o) */
+    public void runTestDeletePersistent6(PersistenceManager pm) {
+        Transaction tx = pm.currentTransaction();
+        try {
+            tx.begin();
+            
+            PCPoint np1 = new PCPoint (3,3);
+            PCPoint np2 = new PCPoint (4,4);
+            
+            pm.makePersistent(np1);
+            pm.makePersistent(np2);
+            tx.commit();
+            
+            Collection col1 = new java.util.HashSet();
+            col1.add(np1);
+            col1.add(np2);
+            Object[] obj1=col1.toArray();
+            
+            try {
+                pm.deletePersistentAll(obj1);
+                fail(ASSERTION_FAILED, 
+                     "pm.deletePersistentAll(Object[]) outside of tx should 
throw an exception");
+            }
+            catch (JDOUserException ex) {
+                // expected exception
+            }
+        }
+        finally {
+            if (tx.isActive())
+                tx.rollback();
+        }
+    }
+}

Propchange: 
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/persistencemanager/DeletePersistent.java
------------------------------------------------------------------------------
    svn:executable = *

Added: 
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/persistencemanager/DeletePersistentAllFails.java
URL: 
http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/persistencemanager/DeletePersistentAllFails.java?view=auto&rev=160090
==============================================================================
--- 
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/persistencemanager/DeletePersistentAllFails.java
 (added)
+++ 
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/persistencemanager/DeletePersistentAllFails.java
 Mon Apr  4 12:41:23 2005
@@ -0,0 +1,155 @@
+/*
+ * 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.api.persistencemanager;
+
+import java.util.Collection;
+
+import javax.jdo.JDOUserException;
+import javax.jdo.PersistenceManager;
+import javax.jdo.Transaction;
+
+import org.apache.jdo.tck.pc.mylib.PCPoint;
+import org.apache.jdo.tck.pc.mylib.Point;
+import org.apache.jdo.tck.util.BatchTestRunner;
+
+/**
+ *<B>Title:</B> DeletePersistentAll Fails
+ *<BR>
+ *<B>Keywords:</B> exception
+ *<BR>
+ *<B>Assertion IDs:</B> A12.5.7-2.
+ *<BR>
+ *<B>Assertion Description: </B>
+If a collection or array of instances is passed to 
PersistenceManager.deletePersistentAll, and one or more of the instances fail 
to complete the required operation, then all instances will be attempted, and a 
JDOUserException will be thrown which contains nested exceptions, each of which 
contains one of the failing instances. The succeeding instances will transition 
to the specified life cycle state, and the failing instances will remain in 
their current state.
+ */
+
+public class DeletePersistentAllFails extends PersistenceManagerTest {
+    
+    /** */
+    private static final String ASSERTION_FAILED = 
+        "Assertion A12.5.7-2 (DeletePersistentAllFails) 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(DeletePersistentAllFails.class);
+    }
+    
+    private PCPoint p1 = null;
+    private PCPoint p2 = null;
+    private PCPoint p3 = null;
+    private PCPoint p4 = null;
+    private PCPoint p5 = null;
+    
+    /** */
+    public void testDeletePersistentAllFails() {
+        pm = getPM();
+        createObjects(pm);
+        runTestDeletePersistentAllFails1(pm);
+        runTestDeletePersistentAllFails2(pm);
+        pm.close();
+        pm = null;
+    }
+
+    private void createObjects(PersistenceManager pm) {
+        Transaction tx =  pm.currentTransaction();
+        try {
+            tx.begin();
+            p1 = new PCPoint(1,3);
+            p2 = new PCPoint(2,4);
+            p3 = new PCPoint(3,5);
+            p4 = new PCPoint(4,6);
+            p5 = new PCPoint(5,7);
+
+            pm.makePersistent(p1);
+            pm.makePersistent(p2);
+            pm.makePersistent(p3);
+            pm.makePersistent(p4);
+            pm.makePersistent(p5);
+        
+            tx.commit();
+        }
+        finally {
+            if (tx.isActive())
+                tx.rollback();
+        }
+    }
+    
+    /* test deletePersistentAll (Collection pcs) */
+    private void runTestDeletePersistentAllFails1(PersistenceManager pm) {
+        Transaction tx =  pm.currentTransaction();
+        try {
+            tx.begin();
+            
+            Point np3 =  new Point (5,5);
+            
+            Collection col1 = new java.util.HashSet();
+            col1.add(p1);
+            col1.add(p2);
+            col1.add(np3);
+            
+            try {
+                pm.deletePersistentAll(col1);
+                fail(ASSERTION_FAILED,
+                     "pm.deletePersistentAll(Collection) with non persistent 
instances should throw an exception");
+            }
+            catch (JDOUserException ex) {
+                // expected exception
+            }
+            tx.rollback();
+        }
+        finally {
+            if (tx.isActive())
+                tx.rollback();
+        }
+    }
+    
+    /* test deletePersistentAll (Object[] o) */
+    private void runTestDeletePersistentAllFails2(PersistenceManager pm) {
+        Transaction tx =  pm.currentTransaction();
+        try {
+            tx.begin();
+
+            Point np3 =  new Point (5,5);
+
+            Collection col1 = new java.util.HashSet();
+            col1.add(p3);
+            col1.add(p4);
+            col1.add(np3);
+            
+            Object[] obj1=col1.toArray();
+
+            try {
+                pm.deletePersistentAll(obj1);
+                fail(ASSERTION_FAILED,
+                     "pm.deletePersistentAll(Object[]) with non persistent 
instances should throw an exception");
+            }
+            catch (JDOUserException ex) {
+                // expected exception
+            }
+            tx.rollback();
+        }
+        finally {
+            if (tx.isActive())
+                tx.rollback();
+        }
+    }
+}

Propchange: 
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/persistencemanager/DeletePersistentAllFails.java
------------------------------------------------------------------------------
    svn:executable = *

Added: 
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/persistencemanager/DeletePersistentFailsIfInstanceIsTransient.java
URL: 
http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/persistencemanager/DeletePersistentFailsIfInstanceIsTransient.java?view=auto&rev=160090
==============================================================================
--- 
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/persistencemanager/DeletePersistentFailsIfInstanceIsTransient.java
 (added)
+++ 
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/persistencemanager/DeletePersistentFailsIfInstanceIsTransient.java
 Mon Apr  4 12:41:23 2005
@@ -0,0 +1,146 @@
+/*
+ * 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.api.persistencemanager;
+
+import java.util.Collection;
+
+import javax.jdo.JDOUserException;
+import javax.jdo.Transaction;
+
+import org.apache.jdo.tck.pc.mylib.PCPoint;
+import org.apache.jdo.tck.util.BatchTestRunner;
+
+/**
+ *<B>Title:</B> DeletePersistent Fails If Instance Is Transient
+ *<BR>
+ *<B>Keywords:</B> exception
+ *<BR>
+ *<B>Assertion IDs:</B> A12.5.7-12.
+ *<BR>
+ *<B>Assertion Description: </B>
+PersistenceManager.deletePersistent and deletePersistentAll will throw a 
JDOUserException if the parameter instance is transient.
+ */
+
+public class DeletePersistentFailsIfInstanceIsTransient extends 
PersistenceManagerTest {
+    
+    /** */
+    private static final String ASSERTION_FAILED = 
+        "Assertion A12.5.7-12 (DeletePersistentFailsIfInstanceIsTransient) 
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(DeletePersistentFailsIfInstanceIsTransient.class);
+    }
+    
+    /** */
+    public void testDeletePersistentFailsIfInstanceIsTransient() {
+        pm = getPM();
+        runTestDeletePersistent();
+        runTestDeletePersistentAll1();
+        runTestDeletePersistentAll2();
+        pm.close();
+        pm = null;
+    }
+
+    /* test deletePersistent (Object pc) */
+    private void runTestDeletePersistent() {
+        Transaction tx =  pm.currentTransaction();
+        try {
+
+          tx = pm.currentTransaction();
+          tx.begin();
+          PCPoint p1 = new PCPoint (3,3);
+          try {
+              pm.deletePersistent(p1);
+              fail(ASSERTION_FAILED,
+                   "pm.deletePersistent(Object) with transient instance should 
throw exception");
+          }
+          catch (JDOUserException ex) {
+              // expected exception
+          } 
+          tx.rollback();
+        }
+        finally {
+            if (tx.isActive())
+                tx.rollback();
+        }
+    }
+
+
+    /* test deletePersistentAll (Collection pcs) */
+    private void runTestDeletePersistentAll1() {
+        Transaction tx =  pm.currentTransaction();
+        try {
+            tx.begin();
+            
+            PCPoint p1 = new PCPoint (3,3);
+            PCPoint p2 = new PCPoint (4,4);
+            
+            Collection col1 = new java.util.HashSet();
+            col1.add(p1);
+            col1.add(p2);
+            
+            try {
+                pm.deletePersistentAll(col1);
+                fail(ASSERTION_FAILED,
+                     "pm.deletePersistent(Collection) with transient 
instance(s) should throw exception");
+          }
+          catch (JDOUserException ex) {
+              // expected exception
+          } 
+          tx.rollback();
+        }
+        finally {
+            if (tx.isActive())
+                tx.rollback();
+        }
+   }
+
+    /* test deletePersistentAll (Object[] o) */
+    private void runTestDeletePersistentAll2() {
+        Transaction tx =  pm.currentTransaction();
+        try {
+            tx.begin();
+
+            PCPoint p1 = new PCPoint (3,3);
+            PCPoint p2 = new PCPoint (4,4);
+            
+            Collection col1 = new java.util.HashSet();
+            col1.add(p1);
+            col1.add(p2);
+
+            try {
+                pm.deletePersistentAll(col1.toArray());
+                fail(ASSERTION_FAILED,
+                     "pm.deletePersistent(Object[]) with transient instance(s) 
should throw exception");
+          }
+          catch (JDOUserException ex) {
+              // expected exception
+          } 
+          tx.rollback();
+        }
+        finally {
+            if (tx.isActive())
+                tx.rollback();
+        }
+   }
+}

Propchange: 
incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/persistencemanager/DeletePersistentFailsIfInstanceIsTransient.java
------------------------------------------------------------------------------
    svn:executable = *


Reply via email to