svn commit: r158179 [4/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/

19 Mar 2005 05:36:37 -0000

Added: 
incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/api/jdohelper/GetObjectIdForNull.java
URL: 
http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/api/jdohelper/GetObjectIdForNull.java?view=auto&rev=158179
==============================================================================
--- 
incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/api/jdohelper/GetObjectIdForNull.java
 (added)
+++ 
incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/api/jdohelper/GetObjectIdForNull.java
 Fri Mar 18 17:07:39 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.util.BatchTestRunner;
+
+
+/**
+ *<B>Title:</B> Get Object Id For Null
+ *<BR>
+ *<B>Keywords:</B> jdohelper
+ *<BR>
+ *<B>Assertion ID:</B> A8.3-4.
+ *<BR>
+ *<B>Assertion Description: </B>
+The jdohelper.getObjectId  method returns null if Object is null.
+  Evaluating to true when == is used.
+  
+ */
+
+ 
+ /*
+ * Revision History
+ * ================
+ * Author         :    Date   :        Version  
+ * Azita Kamangar      9/26/01          1.0
+ */
+ 
+public class GetObjectIdForNull extends JDO_Test {
+    /** */
+    private static final String ASSERTION_FAILED = 
+        "Assertion A8.3-4 (GetObjectIdForNull) 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(GetObjectIdForNull.class);
+    }
+    
+    /* test jdohelper.getObjectId(Object pc)
+     */  
+    public void testGetObjectIdForNull() {
+        pm = getPM();
+       Transaction tx = pm.currentTransaction();
+        tx.begin();
+        Object p1 = null;
+           Object oid = JDOHelper.getObjectId(p1);
+        tx.commit();
+           if (oid != null)
+            fail(ASSERTION_FAILED,
+                 "JDOHelper.getObjectId called for null instance returned 
non-null ObjectId");
+        pm.close();
+        pm = null;
+    }
+}

Added: 
incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/api/jdohelper/GetObjectIdForTransient.java
URL: 
http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/api/jdohelper/GetObjectIdForTransient.java?view=auto&rev=158179
==============================================================================
--- 
incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/api/jdohelper/GetObjectIdForTransient.java
 (added)
+++ 
incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/api/jdohelper/GetObjectIdForTransient.java
 Fri Mar 18 17:07:39 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> Get Object Id For Transient
+ *<BR>
+ *<B>Keywords:</B> jdohelper
+ *<BR>
+ *<B>Assertion ID:</B> A8.3-2.
+ *<BR>
+ *<B>Assertion Description: </B>
+The jdohelper.getObjectId method returns null if Object is a transient.
+Evaluating to true when == is used.
+ */
+
+ /*
+ * Revision History
+ * ================
+ * Author         :    Date   :        Version  
+ * Azita Kamangar      9/27/01          1.0
+ */
+ 
+public class GetObjectIdForTransient extends JDO_Test {
+
+    /** */
+    private static final String ASSERTION_FAILED = 
+        "Assertion A8.3-2 (GetObjectIdForTransient) 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(GetObjectIdForTransient.class);
+    }
+
+    /* test JDOHelper.getObjectId(Object pc)
+     *  
+     */
+    public void testGetObjectIdForTransient() {
+        pm = getPM();
+        Transaction tx = pm.currentTransaction();
+        tx.begin();
+        PCPoint p1 = new PCPoint(1,3);
+        Object oid = JDOHelper.getObjectId(p1);
+        tx.commit();
+        if (oid != null) 
+            fail(ASSERTION_FAILED,
+                 "JDOHelper.getObjectId called for transient instance returned 
non-null ObjectId " + oid);
+        pm.close();
+        pm = null;
+    }
+}

Added: 
incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/api/jdohelper/GetObjectIdNotPersistenceCapable.java
URL: 
http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/api/jdohelper/GetObjectIdNotPersistenceCapable.java?view=auto&rev=158179
==============================================================================
--- 
incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/api/jdohelper/GetObjectIdNotPersistenceCapable.java
 (added)
+++ 
incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/api/jdohelper/GetObjectIdNotPersistenceCapable.java
 Fri Mar 18 17:07:39 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> Get Object Id Not Persistence Capable
+ *<BR>
+ *<B>Keywords:</B> jdohelper
+ *<BR>
+ *<B>Assertion ID:</B> A8.3-3.
+ *<BR>
+ *<B>Assertion Description: </B>
+The jdohelper.getObjectId method returns null if Object is not persistence 
capable
+
+ */
+
+ /*
+ * Revision History
+ * ================
+ * Author         :    Date   :        Version  
+ * Azita Kamangar      9/26/01          1.0
+ */
+
+public class GetObjectIdNotPersistenceCapable extends JDO_Test {
+
+    /** */
+    private static final String ASSERTION_FAILED = 
+        "Assertion A8.3-3 (GetObjectIdNotPersistenceCapable) 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(GetObjectIdNotPersistenceCapable.class);
+    }
+
+    /* test JDOHelper.getObjectId(Object pc)
+     *  
+     */
+    public void testGetObjectIdNotPersistenceCapable() {
+        pm = getPM();
+        Transaction tx = pm.currentTransaction();
+        tx.begin();
+        Point p1 = new Point(1,3);
+        Object oid = JDOHelper.getObjectId(p1);
+        tx.commit();
+        if (oid != null) 
+            fail(ASSERTION_FAILED,
+                 "JDOHelper.getObjectId called for instance of non-pc class 
returned non-null ObjectId " + oid);
+        pm.close();
+        pm = null;
+    }
+}

Added: 
incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/api/jdohelper/GetPersistenceManager.java
URL: 
http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/api/jdohelper/GetPersistenceManager.java?view=auto&rev=158179
==============================================================================
--- 
incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/api/jdohelper/GetPersistenceManager.java
 (added)
+++ 
incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/api/jdohelper/GetPersistenceManager.java
 Fri Mar 18 17:07:39 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.PersistenceManager;
+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> Get Persistence Manager
+ *<BR>
+ *<B>Keywords:</B> jdohelper
+ *<BR>
+ *<B>Assertion ID:</B> A8.1-1.
+ *<BR>
+ *<B>Assertion Description: </B>
+The jdohelper.getPersistenceManager method returns associated persistence 
manager 
+  if the object parameter is not null and implements persistenceCapable.
+  evaluating to true when == is used. 
+ */
+
+
+ /*
+ * Revision History
+ * ================
+ * Author         :    Date   :        Version  
+ * Azita Kamangar      9/26/01          1.0
+ */
+public class GetPersistenceManager extends JDO_Test {
+
+    /** */
+    private static final String ASSERTION_FAILED = 
+        "Assertion A8.1-1 (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);
+    }
+
+    /* test jdohelper.getPersistenceManager(Object pc)
+     *  
+     */
+    public void testGetPersistenceManager() {
+        pm = getPM();
+        Transaction tx = pm.currentTransaction();
+        tx.begin();
+        PCPoint p1 = new PCPoint(1,3);
+        pm.makePersistent(p1);
+        PersistenceManager pm1= JDOHelper.getPersistenceManager(p1);
+        tx.commit();
+        if (pm1 == null)
+            fail(ASSERTION_FAILED, 
+                 "JDOHelper.getPersistenceManager returns null for persistent 
instance");
+        if (pm1 != pm)
+            fail(ASSERTION_FAILED, 
+                 "JDOHelper.getPersistenceManager returns wrong pm " + pm1 + 
+                 ", expected " + pm);
+        pm.close();
+        pm = null;
+    }
+}

Added: 
incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/api/jdohelper/GetPersistenceManagerForNull.java
URL: 
http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/api/jdohelper/GetPersistenceManagerForNull.java?view=auto&rev=158179
==============================================================================
--- 
incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/api/jdohelper/GetPersistenceManagerForNull.java
 (added)
+++ 
incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/api/jdohelper/GetPersistenceManagerForNull.java
 Fri Mar 18 17:07:39 2005
@@ -0,0 +1,77 @@
+/*
+ * 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.PersistenceManager;
+import javax.jdo.Transaction;
+
+import org.apache.jdo.tck.JDO_Test;
+import org.apache.jdo.tck.util.BatchTestRunner;
+
+
+/**
+ *<B>Title:</B> Get Persistence Manager For Null
+ *<BR>
+ *<B>Keywords:</B> jdohelper
+ *<BR>
+ *<B>Assertion ID:</B> A8.1-4.
+ *<BR>
+ *<B>Assertion Description: </B>
+The jdohelper.getPersistenceManager method returns null if Object is null.
+Evaluating to true when == is used.
+ */
+
+
+ /*
+ * Revision History
+ * ================
+ * Author         :    Date   :        Version  
+ * Azita Kamangar      9/27/01          1.0
+ */ 
+
+public class GetPersistenceManagerForNull extends JDO_Test {
+
+    /** */
+    private static final String ASSERTION_FAILED = 
+        "Assertion A8.1-4 (GetPersistenceManagerForNull) 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(GetPersistenceManagerForNull.class);
+    }
+
+    /** */
+    public void testGetPersistenceManagerForNull() {
+        pm = getPM();
+        Transaction tx = pm.currentTransaction();
+        tx.begin();
+        Object p1 = null;
+        PersistenceManager pm1 = JDOHelper.getPersistenceManager(p1);
+        tx.commit();
+
+        if (pm1 != null)
+            fail(ASSERTION_FAILED, 
+                 "JDOHelper.getPersistenceManager with argument null returned 
non-null pm " + pm1);
+        pm.close();
+        pm = null;
+    }
+}

Added: 
incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/api/jdohelper/GetPersistenceManagerForTransient.java
URL: 
http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/api/jdohelper/GetPersistenceManagerForTransient.java?view=auto&rev=158179
==============================================================================
--- 
incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/api/jdohelper/GetPersistenceManagerForTransient.java
 (added)
+++ 
incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/api/jdohelper/GetPersistenceManagerForTransient.java
 Fri Mar 18 17:07:39 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.PersistenceManager;
+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> Get Persistence Manager For Transien
+ *<BR>
+ *<B>Keywords:</B> jdohelper
+ *<BR>
+ *<B>Assertion ID:</B> A8.1-2.
+ *<BR>
+ *<B>Assertion Description: </B>
+The jdohelper.getPersistenceManager method returns null if object is transient 
+  evaluating to true when == is used. 
+ */
+
+ /*
+ * Revision History
+ * ================
+ * Author         :    Date   :        Version  
+ * Azita Kamangar      9/28/01          1.0
+ */
+
+public class GetPersistenceManagerForTransient extends JDO_Test {
+
+    /** */
+    private static final String ASSERTION_FAILED = 
+        "Assertion A8.1-2 (GetPersistenceManagerForTransient) 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(GetPersistenceManagerForTransient.class);
+    }
+
+    /* test jdohelper.getPersistenceManager(Object transient)
+     */
+    public void testGetPersistenceManagerForTransient() {
+        pm  = getPM();
+        Transaction tx = pm.currentTransaction();
+        tx.begin();
+        PCPoint p1 = new PCPoint(1,3);
+        tx.commit();
+        PersistenceManager pm1 = JDOHelper.getPersistenceManager(p1);
+          
+        if (pm1 != null)
+            fail(ASSERTION_FAILED, 
+                 "JDOHelper.getPersistenceManager called for transient 
instance returned non-null pm " + pm1);
+    }
+}

Added: 
incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/api/jdohelper/GetPersistenceManagerNotPersistenceCapable.java
URL: 
http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/api/jdohelper/GetPersistenceManagerNotPersistenceCapable.java?view=auto&rev=158179
==============================================================================
--- 
incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/api/jdohelper/GetPersistenceManagerNotPersistenceCapable.java
 (added)
+++ 
incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/api/jdohelper/GetPersistenceManagerNotPersistenceCapable.java
 Fri Mar 18 17:07:39 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.PersistenceManager;
+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> Get Persistence Manager Not Persistence Capable
+ *<BR>
+ *<B>Keywords:</B> jdohelper
+ *<BR>
+ *<B>Assertion ID:</B> A8.1-3.
+ *<BR>
+ *<B>Assertion Description: </B>
+The jdohelper.getPersistenceManager method returns null if object is not 
+persistence capable   evaluating to true when == is used. 
+ */
+ /*
+ * Revision History
+ * ================
+ * Author         :    Date   :        Version  
+ * Azita Kamangar      9/28/01          1.0
+ */
+public class GetPersistenceManagerNotPersistenceCapable extends JDO_Test {
+
+    /** */
+    private static final String ASSERTION_FAILED = 
+        "Assertion A8.1-3 (GetPersistenceManagerNotPersistenceCapable) 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(GetPersistenceManagerNotPersistenceCapable.class);
+    }
+    
+    /* test jdohelper.getPersistenceManager(Object pc)
+     *  
+    */
+    public void testGetPersistenceManagerNotPersistenceCapable() {
+       pm = getPM();
+        Transaction tx = pm.currentTransaction();
+        tx.begin();
+        Point p1 = new Point(1,3);
+        tx.commit();
+        PersistenceManager pm1 = JDOHelper.getPersistenceManager(p1);
+        if (pm1 != null)
+            fail(ASSERTION_FAILED, 
+                 "JDOHelper.getPersistenceManager called for instance of 
non-pc class returned non-null pm " + pm1);
+        pm.close();
+        pm = null;
+    }
+}

Added: 
incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/api/jdohelper/GetTransactionalObjectId.java
URL: 
http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/api/jdohelper/GetTransactionalObjectId.java?view=auto&rev=158179
==============================================================================
--- 
incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/api/jdohelper/GetTransactionalObjectId.java
 (added)
+++ 
incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/api/jdohelper/GetTransactionalObjectId.java
 Fri Mar 18 17:07:39 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> Get Transactional Object Id
+ *<BR>
+ *<B>Keywords:</B> jdohelper 
+ *<BR>
+ *<B>Assertion ID:</B> A8.3-5
+ *<BR>
+ *<B>Assertion Description: </B>
+   If the object parameter implements PersistenceCapable,
+   JDOHelper.getTransactionalObjectId delegates to the parameter instance and 
+   returns the JDO identity of the instance.
+ */
+ /*
+ * Revision History
+ * ================
+ * Author         :    Date   :        Version  
+ * Azita Kamangar      9/26/01          1.0
+ */
+
+public class GetTransactionalObjectId extends JDO_Test {
+
+    /** */
+    private static final String ASSERTION_FAILED = 
+        "Assertion A8.3-5 (GetTransactionalObjectId) 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(GetTransactionalObjectId.class);
+    }
+    
+    /* test JDOHelper.getTransactionalObjectId(Object pc)
+     *  
+     */
+    public void testGetTransactionalObjectId() {
+        pm = getPM();  
+        Transaction tx = pm.currentTransaction();
+        tx.begin();
+        PCPoint p1 = new PCPoint(1,3);
+        pm.makePersistent(p1);
+        Object oid = JDOHelper.getTransactionalObjectId(p1);
+        tx.commit();
+
+        if (oid == null)
+            fail(ASSERTION_FAILED, 
+                 "JDOHelper.getTransactionalObjectId returned null oid.");
+        pm.close();
+        pm = null;
+    }
+}

Added: 
incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/api/jdohelper/GetTransactionalObjectIdForNull.java
URL: 
http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/api/jdohelper/GetTransactionalObjectIdForNull.java?view=auto&rev=158179
==============================================================================
--- 
incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/api/jdohelper/GetTransactionalObjectIdForNull.java
 (added)
+++ 
incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/api/jdohelper/GetTransactionalObjectIdForNull.java
 Fri Mar 18 17:07:39 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> Get Transactional Object Id For Null
+ *<BR>
+ *<B>Keywords:</B> jdohelper 
+ *<BR>
+ *<B>Assertion ID:</B> A8.3-8
+ *<BR>
+ *<B>Assertion Description: </B>
+  The jdohelper.getTransactionalObjectIdForNull  method returns null if Object 
is null.Evaluating to true when == is used.
+ */
+ /*
+ * Revision History
+ * ================
+ * Author         :    Date   :        Version  
+ * Azita Kamangar      10/1/01          1.0
+ */
+ 
+public class GetTransactionalObjectIdForNull extends JDO_Test {
+
+    /** */
+    private static final String ASSERTION_FAILED = 
+        "Assertion A8.3-8 (GetTransactionalObjectIdForNull) 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(GetTransactionalObjectIdForNull.class);
+    }
+
+    /* test jdohelper.getTransactionalObjectId(Object pc)
+     *  
+     */
+    public void testGetTransactionalObjectIdForNull() {
+        pm = getPM();
+        Transaction tx = pm.currentTransaction();
+        tx.begin();
+        Object p1 = null;
+        Object oid = JDOHelper.getTransactionalObjectId(p1);
+        tx.commit();    
+
+        if (oid != null)
+            fail(ASSERTION_FAILED, 
+                 "JDOHelper.getTransactionalObjectId with argument null 
returned non-null oid " + oid);
+        pm.close();
+        pm = null;
+    }
+}
+

Added: 
incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/api/jdohelper/GetTransactionalObjectIdForTransient.java
URL: 
http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/api/jdohelper/GetTransactionalObjectIdForTransient.java?view=auto&rev=158179
==============================================================================
--- 
incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/api/jdohelper/GetTransactionalObjectIdForTransient.java
 (added)
+++ 
incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/api/jdohelper/GetTransactionalObjectIdForTransient.java
 Fri Mar 18 17:07:39 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> Get Transactional Object Id For Transient
+ *<BR>
+ *<B>Keywords:</B> jdohelper 
+ *<BR>
+ *<B>Assertion ID:</B> A8.3-6
+ *<BR>
+ *<B>Assertion Description: </B>
+  The jdohelper.getTransactionalObjectIdForTransient  method returns null if 
Object is a transient.Evaluating to true when == is used.
+ */
+
+ /*
+ * Revision History
+ * ================
+ * Author         :    Date   :        Version  
+ * Azita Kamangar      10/1/01          1.0
+ */
+ 
+public class GetTransactionalObjectIdForTransient extends JDO_Test {
+
+    /** */
+    private static final String ASSERTION_FAILED = 
+        "Assertion A8.3-6 (GetTransactionalObjectIdForTransient) 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(GetTransactionalObjectIdForTransient.class);
+    }
+
+    /* test JDOHelper.getTransactionalObjectId(Object pc)
+     *  
+     */
+    public void testGetTransactionalObjectIdForTransient() {
+       pm = getPM();
+       Transaction tx = pm.currentTransaction();
+       tx.begin();
+       PCPoint p1 = new PCPoint(1,3);
+       Object oid = JDOHelper.getTransactionalObjectId(p1);
+        tx.commit();
+
+        if (oid != null)
+               fail(ASSERTION_FAILED,
+                 "JDOHelper.getTransactionalObjectId called for transiewt 
instance returned non-null oid " + oid);
+        pm.close();
+        pm = null;
+    }
+}

Added: 
incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/api/jdohelper/GetTransactionalObjectIdNotPersistenceCapable.java
URL: 
http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/api/jdohelper/GetTransactionalObjectIdNotPersistenceCapable.java?view=auto&rev=158179
==============================================================================
--- 
incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/api/jdohelper/GetTransactionalObjectIdNotPersistenceCapable.java
 (added)
+++ 
incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/api/jdohelper/GetTransactionalObjectIdNotPersistenceCapable.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.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> Get Object Id Not Persistence Capable
+ *<BR>
+ *<B>Keywords:</B> jdohelper 
+ *<BR>
+ *<B>Assertion ID:</B> A8.3-7
+ *<BR>
+ *<B>Assertion Description: </B>
+  The jdohelper.getTransactionalObjectId  method returns null if Object is not 
PC.Evaluating to true when == is used.
+ */
+ /*
+ * Revision History
+ * ================
+ * Author         :    Date   :        Version  
+ * Azita Kamangar      10/1/01          1.0
+ */
+
+public class GetTransactionalObjectIdNotPersistenceCapable extends JDO_Test {
+
+    /** */
+    private static final String ASSERTION_FAILED = 
+        "Assertion A8.3-7 (GetTransactionalObjectIdNotPersistenceCapable) 
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(GetTransactionalObjectIdNotPersistenceCapable.class);
+    }
+
+    /* test JDOHelper.getTransactionalObjectId(Object pc)
+     *  
+     */
+    public void testGetTransactionalObjectIdNotPersistenceCapable() {
+        pm = getPM();
+        Transaction tx = pm.currentTransaction();
+        tx.begin();
+        Point p1 = new Point(1,3);
+        Object oid = JDOHelper.getTransactionalObjectId(p1);
+        tx.commit();
+
+        if (oid != null)
+            fail(ASSERTION_FAILED, 
+                 "JDOHelper.getTransactionalObjectId called for instance of 
non-pc class returned non-null ObjectId " + oid);
+    }
+}

Added: 
incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/api/jdohelper/IsDeleted.java
URL: 
http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/api/jdohelper/IsDeleted.java?view=auto&rev=158179
==============================================================================
--- 
incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/api/jdohelper/IsDeleted.java
 (added)
+++ 
incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/api/jdohelper/IsDeleted.java
 Fri Mar 18 17:07:39 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> Is Deleted 
+ *<BR>
+ *<B>Keywords:</B> jdohelper 
+ *<BR>
+ *<B>Assertion ID:</B> A8.4.5-1
+ *<BR>
+ *<B>Assertion Description: </B>
+  The jdohelper.isDeleted method returns true if the instance of persistence 
capable
+  have been deleted in the current transaction 
+  evaluating to true when == is used. 
+ */
+ /*
+ * Revision History
+ * ================
+ * Author         :    Date   :        Version  
+ * Azita Kamangar      9/26/01          1.0
+ */
+
+public class IsDeleted extends JDO_Test {
+
+    /** */
+    private static final String ASSERTION_FAILED = 
+        "Assertion A8.4.5-1 (IsDeleted) 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(IsDeleted.class);
+    }
+
+    /* test jdohelper.isDeleted(Object pc)
+     *  
+     */
+    public void testIsDeleted() {
+        pm = getPM();
+        Transaction tx = pm.currentTransaction();
+        tx.begin();
+        PCPoint p1 = new PCPoint(1,3);
+        pm.makePersistent(p1);
+        pm.deletePersistent(p1);
+        boolean deleted = JDOHelper.isDeleted(p1);
+        tx.commit();
+        if (!deleted)
+            fail(ASSERTION_FAILED,
+                 "JDOHelper.isDeleted returns false for deleted instance");
+        pm.close(); 
+        pm = null;
+    }
+}

Added: 
incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/api/jdohelper/IsDeletedFalse.java
URL: 
http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/api/jdohelper/IsDeletedFalse.java?view=auto&rev=158179
==============================================================================
--- 
incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/api/jdohelper/IsDeletedFalse.java
 (added)
+++ 
incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/api/jdohelper/IsDeletedFalse.java
 Fri Mar 18 17:07:39 2005
@@ -0,0 +1,79 @@
+/*
+ * 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 Deleted False
+ *<BR>
+ *<B>Keywords:</B> jdohelper 
+ *<BR>
+ *<B>Assertion ID:</B> A8.4.5-2
+ *<BR>
+ *<B>Assertion Description: </B>
+  The object parameter that implements PersistenceCapable, JDOHelper.isDeleted
+   delegates to the parameter instance and instances that have not been deleted
+   in the current transaction return false. 
+  evaluating to true when == is used. 
+ */
+ /*
+ * Revision History
+ * ================
+ * Author         :    Date   :        Version  
+ * Azita Kamangar      9/29/01          1.0
+ */
+
+public class IsDeletedFalse extends JDO_Test {
+
+    /** */
+    private static final String ASSERTION_FAILED = 
+        "Assertion A8.4.5-2 (IsDeletedFalse) 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(IsDeletedFalse.class);
+    }
+
+    /* test JDOHelper.isDeleted(Object pc)
+     *  
+     */
+    public void testIsDeletedFalse() {
+        pm = getPM();
+        Transaction tx = pm.currentTransaction();
+        tx.begin();
+        PCPoint p1 = new PCPoint(1,3);
+        pm.makePersistent(p1);
+        //pm.deletePersistent(p1);
+        boolean deleted = JDOHelper.isDeleted(p1);
+        tx.commit();
+        if (deleted)
+            fail(ASSERTION_FAILED,
+                 "JDOHelper.isDeleted returns true for non-deleted instance");
+        pm.close();
+        pm = null;
+    }
+}

Added: 
incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/api/jdohelper/IsDeletedForNull.java
URL: 
http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/api/jdohelper/IsDeletedForNull.java?view=auto&rev=158179
==============================================================================
--- 
incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/api/jdohelper/IsDeletedForNull.java
 (added)
+++ 
incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/api/jdohelper/IsDeletedForNull.java
 Fri Mar 18 17:07:39 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> Is Deleted For Null
+ *<BR>
+ *<B>Keywords:</B> jdohelper 
+ *<BR>
+ *<B>Assertion ID:</B> A8.4.5-5
+ *<BR>
+ *<B>Assertion Description: </B>
+  The jdohelper.isDeleted method returns false for the instance of null,
+  evaluating to true when == is used. 
+ */
+ /*
+ * Revision History
+ * ================
+ * Author         :    Date   :        Version  
+ * Azita Kamangar      9/28/01          1.0
+ */
+ 
+public class IsDeletedForNull extends JDO_Test {
+
+    /** */
+    private static final String ASSERTION_FAILED = 
+        "Assertion A8.4.5-5 (IsDeletedForNull) 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(IsDeletedForNull.class);
+    }
+
+    /* test JDOHelper.IsDeleted(object PC)
+     *  
+     */
+    public void testIsDeletedForNull() {
+        pm = getPM();
+        Transaction tx = pm.currentTransaction();
+        tx.begin();
+        Object p1 = null;
+        //pm.deletePersistent(p1);
+        boolean deleted = JDOHelper.isDeleted(p1);
+        tx.commit();
+        if (deleted)
+            fail(ASSERTION_FAILED,
+                 "JDOHelper.isDeleted with argumnet null returns true.");
+        pm.close();
+        pm = null;
+    }
+}

Added: 
incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/api/jdohelper/IsDeletedForTransient.java
URL: 
http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/api/jdohelper/IsDeletedForTransient.java?view=auto&rev=158179
==============================================================================
--- 
incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/api/jdohelper/IsDeletedForTransient.java
 (added)
+++ 
incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/api/jdohelper/IsDeletedForTransient.java
 Fri Mar 18 17:07:39 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 Deleted For Transient
+ *<BR>
+ *<B>Keywords:</B> jdohelper 
+ *<BR>
+ *<B>Assertion ID:</B> A8.4.5-3
+ *<BR>
+ *<B>Assertion Description: </B>
+  The JDOHelper.IsDeleted method returns false if the instance is a transient,
+  evaluating to true when == is used. 
+ */
+ /*
+ * Revision History
+ * ================
+ * Author         :    Date   :        Version  
+ * Azita Kamangar      9/26/01          1.0
+ */
+
+public class IsDeletedForTransient extends JDO_Test {
+
+    /** */
+    private static final String ASSERTION_FAILED = 
+        "Assertion A8.4.5-3 (IsDeletedForTransient) 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(IsDeletedForTransient.class);
+    }
+
+    /* test JDOHelper.IsDeleted(Object pc)
+     *  
+    */
+    public void testIsDeletedForTransient() {
+       pm = getPM();
+       Transaction tx = pm.currentTransaction();
+       tx.begin();
+       PCPoint p1 = new PCPoint(1,3);
+       boolean deleted = JDOHelper.isDeleted(p1);
+        tx.commit();
+        if (deleted)
+            fail(ASSERTION_FAILED,
+                 "JDOHelper.isDeleted called for transient instance returns 
true.");
+        pm.close();
+        pm = null;
+    }
+}

Added: 
incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/api/jdohelper/IsDeletedNotPersistenceCapable.java
URL: 
http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/api/jdohelper/IsDeletedNotPersistenceCapable.java?view=auto&rev=158179
==============================================================================
--- 
incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/api/jdohelper/IsDeletedNotPersistenceCapable.java
 (added)
+++ 
incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/api/jdohelper/IsDeletedNotPersistenceCapable.java
 Fri Mar 18 17:07:39 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 Deleted Not Persistence Capable
+ *<BR>
+ *<B>Keywords:</B> jdohelper 
+ *<BR>
+ *<B>Assertion ID:</B> A8.4.5-4
+ *<BR>
+ *<B>Assertion Description: </B>
+  The JDOHelper.IsDeleted method returns false if the instance is not 
persistence
+  capable , evaluating to true when == is used. 
+ */
+
+/*
+ * Revision History
+ * ================
+ * Author         :    Date   :        Version  
+ * Azita Kamangar      9/26/01          1.0
+ */
+public class IsDeletedNotPersistenceCapable extends JDO_Test {
+
+    /** */
+    private static final String ASSERTION_FAILED = 
+        "Assertion A8.4.5-4 (IsDeletedNotPersistenceCapable) 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(IsDeletedNotPersistenceCapable.class);
+    }
+ 
+    /* test JDOHelper.isDeleted(Object pc)
+     *  
+     */
+    public void testIsDeletedNotPersistenceCapable() {
+       pm = getPM();
+       Transaction tx = pm.currentTransaction();
+       tx.begin();
+       Point p1 = new Point(1,3);
+       boolean deleted = JDOHelper.isDeleted(p1);
+       tx.commit();
+       if (deleted)
+            fail(ASSERTION_FAILED,
+                 "JDOHelper.isDeleted called for instance of non-pc class 
returns true.");
+        pm.close();
+        pm = null;
+   }
+}

Added: 
incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/api/jdohelper/IsDirty.java
URL: 
http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/api/jdohelper/IsDirty.java?view=auto&rev=158179
==============================================================================
--- 
incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/api/jdohelper/IsDirty.java
 (added)
+++ 
incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/api/jdohelper/IsDirty.java
 Fri Mar 18 17:07:39 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> Is Dirty 
+ *<BR>
+ *<B>Keywords:</B> jdohelper 
+ *<BR>
+ *<B>Assertion ID:</B> A8.4.1-1
+ *<BR>
+ *<B>Assertion Description: </B>
+  The jdohelper.isDirty method returns true if the instance of persistence 
capable
+  have changed the state in the current transaction 
+  evaluating to true when == is used. 
+ */
+ /*
+ * Revision History
+ * ================
+ * Author         :    Date   :        Version  
+ * Azita Kamangar      9/30/01          1.0
+ */
+public class IsDirty extends JDO_Test {
+
+    /** */
+    private static final String ASSERTION_FAILED = 
+        "Assertion A8.4.1-1 (IsDirty) 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(IsDirty.class);
+    }
+
+    /* test JDOHelper.isDeleted(Object pc)
+     *  
+     */
+    public void testIsDirty() {
+       pm = getPM();
+       Transaction tx = pm.currentTransaction();
+       tx.begin();
+       PCPoint p1 = new PCPoint(1,3);
+       pm.makePersistent(p1);
+       
+       boolean dirty = JDOHelper.isDirty(p1);
+       tx.commit();
+        
+        if (!dirty)
+            fail(ASSERTION_FAILED,
+                 "JDOHelper.isDirty returns false for P-NEW instance");
+        pm.close();
+        pm = null;
+    }
+}

Added: 
incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/api/jdohelper/IsDirtyFalse.java
URL: 
http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/api/jdohelper/IsDirtyFalse.java?view=auto&rev=158179
==============================================================================
--- 
incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/api/jdohelper/IsDirtyFalse.java
 (added)
+++ 
incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/api/jdohelper/IsDirtyFalse.java
 Fri Mar 18 17:07:39 2005
@@ -0,0 +1,81 @@
+/*
+ * 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 Dirty False
+ *<BR>
+ *<B>Keywords:</B> jdohelper 
+ *<BR>
+ *<B>Assertion ID:</B> A8.4.1-2
+ *<BR>
+ *<B>Assertion Description: </B>
+  The jdohelper.isDirty method returns false if the instance of persistence 
capable
+  have not  changed the state in the current transaction 
+  evaluating to true when == is used. 
+ */
+ /*
+ * Revision History
+ * ================
+ * Author         :    Date   :        Version  
+ * Azita Kamangar      9/25/01          1.0
+ */
+public class IsDirtyFalse extends JDO_Test {
+
+    /** */
+    private static final String ASSERTION_FAILED = 
+        "Assertion A8.4.1-2 (IsDirtyFalse) 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(IsDirtyFalse.class);
+    }
+ 
+    /* test JDOHelper.isDirty(Object pc)
+     *  
+     */
+    public void testIsDirtyFalse() {
+       pm = getPM();
+       Transaction tx = pm.currentTransaction();
+       tx.begin();
+       PCPoint p1 = new PCPoint(1,3);
+       pm.makePersistent(p1);
+        tx.commit();
+        
+        tx.begin();
+        // access p1 field to make sure the instance is loaded in new tx
+        p1.getX();
+       boolean dirty = JDOHelper.isDirty(p1);
+       tx.commit();
+       if (dirty)
+               fail(ASSERTION_FAILED,
+                 "JDOHelper.isDirty returns true for P-CLEAN instance");
+        pm.close();
+        pm = null;
+    }
+}

Added: 
incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/api/jdohelper/IsDirtyForNull.java
URL: 
http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/api/jdohelper/IsDirtyForNull.java?view=auto&rev=158179
==============================================================================
--- 
incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/api/jdohelper/IsDirtyForNull.java
 (added)
+++ 
incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/api/jdohelper/IsDirtyForNull.java
 Fri Mar 18 17:07:39 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 Dirty For Null
+ *<BR>
+ *<B>Keywords:</B> jdohelper 
+ *<BR>
+ *<B>Assertion ID:</B> A8.4.1-5
+ *<BR>
+ *<B>Assertion Description: </B>
+  The jdohelper.isDirty method returns false 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 IsDirtyForNull extends JDO_Test {
+
+    /** */
+    private static final String ASSERTION_FAILED = 
+        "Assertion A8.4.1-5 (IsDirtyForNull) 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(IsDirtyForNull.class);
+    }
+ 
+    /* test JDOHelper.isDirthy(Object pc)
+     *  
+     */
+    public void testIsDirtyForNull() {
+        pm = getPM();
+        Transaction tx = pm.currentTransaction();
+        tx.begin();
+        Object p1 = null;
+        boolean dirty = JDOHelper.isDirty(p1);
+        tx.commit();
+        if (dirty)
+            fail(ASSERTION_FAILED,
+                 "JDOHelper.isDirty with argument null returns true.");
+        pm.close();
+        pm = null;
+    }
+}

Added: 
incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/api/jdohelper/IsDirtyForTransient.java
URL: 
http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/api/jdohelper/IsDirtyForTransient.java?view=auto&rev=158179
==============================================================================
--- 
incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/api/jdohelper/IsDirtyForTransient.java
 (added)
+++ 
incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/api/jdohelper/IsDirtyForTransient.java
 Fri Mar 18 17:07:39 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 Dirty For Transient
+ *<BR>
+ *<B>Keywords:</B> jdohelper 
+ *<BR>
+ *<B>Assertion ID:</B> A8.4.1-3
+ *<BR>
+ *<B>Assertion Description: </B>
+  The jdohelper.isDirty method returns false If the instance is transient,  
+  evaluating to true when == is used. 
+ */
+  
+  /*
+ * Revision History
+ * ================
+ * Author         :    Date   :        Version  
+ * Azita Kamangar      9/28/01          1.0
+ */
+public class IsDirtyForTransient extends JDO_Test {
+
+    /** */
+    private static final String ASSERTION_FAILED = 
+        "Assertion A8.4.1-3 (IsDirtyForTransient) 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(IsDirtyForTransient.class);
+    }
+
+    /* test JDOHelper.isDeleted(Object pc)
+     *  
+     */
+    public void testIsDirtyForTransient() {
+       pm = getPM();
+       Transaction tx = pm.currentTransaction();
+       tx.begin();
+       PCPoint p1 = new PCPoint(1,3);
+        boolean dirty = JDOHelper.isDirty(p1);
+        tx.commit();
+        if (dirty)
+            fail(ASSERTION_FAILED,
+                 "JDOHelper.isDirty returns true for transient instance");
+        pm.close();
+        pm = null;
+    }
+}

Added: 
incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/api/jdohelper/IsDirtyNotPersistenceCapable.java
URL: 
http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/api/jdohelper/IsDirtyNotPersistenceCapable.java?view=auto&rev=158179
==============================================================================
--- 
incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/api/jdohelper/IsDirtyNotPersistenceCapable.java
 (added)
+++ 
incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/api/jdohelper/IsDirtyNotPersistenceCapable.java
 Fri Mar 18 17:07:39 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 Dirty Not Persistence Capable
+ *<BR>
+ *<B>Keywords:</B> jdohelper 
+ *<BR>
+ *<B>Assertion ID:</B> A8.4.1-4
+ *<BR>
+ *<B>Assertion Description: </B>
+  The jdohelper.isDirty method returns false If the instance does not 
implement PersistenceCapable
+  evaluating to true when == is used. 
+ */
+ /*
+ * Revision History
+ * ================
+ * Author         :    Date   :        Version  
+ * Azita Kamangar      9/26/01          1.0
+ */
+ 
+public class IsDirtyNotPersistenceCapable extends JDO_Test {
+
+    /** */
+    private static final String ASSERTION_FAILED = 
+        "Assertion A8.4.1-4 (IsDirtyNotPersistenceCapable) 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(IsDirtyNotPersistenceCapable.class);
+    }
+
+    /* test JDOHelper.isDeleted(Object pc)
+     *  
+     */
+    public void testIsDirtyNotPersistenceCapable() {
+       pm = getPM();
+       Transaction tx = pm.currentTransaction();
+       tx.begin();
+       Point p1 = new Point(1,3);
+        boolean dirty = JDOHelper.isDirty(p1);
+        tx.commit();
+        if (dirty)
+            fail(ASSERTION_FAILED,
+                 "JDOHelper.isDirty returns true for instance of non-pc 
class.");
+        pm.close();
+        pm = null;
+    }
+}

Added: 
incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/api/jdohelper/IsNew.java
URL: 
http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/api/jdohelper/IsNew.java?view=auto&rev=158179
==============================================================================
--- 
incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/api/jdohelper/IsNew.java 
(added)
+++ 
incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/api/jdohelper/IsNew.java 
Fri Mar 18 17:07:39 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 New 
+ *<BR>
+ *<B>Keywords:</B> jdohelper 
+ *<BR>
+ *<B>Assertion ID:</B> A8.4.4-1
+ *<BR>
+ *<B>Assertion Description: </B>
+  The jdohelper.isNew method returns true for instances that have
+  been made persistent in the current transactionthe evaluating to
+  true when == is used. 
+ */
+ /*
+ * Revision History
+ * ================
+ * Author         :    Date   :        Version  
+ * Azita Kamangar      10/2/01          1.0
+ */
+public class IsNew extends JDO_Test {
+
+    /** */
+    private static final String ASSERTION_FAILED = 
+        "Assertion A8.4.4-1 (IsNew) 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(IsNew.class);
+    }
+
+    /* test JDOHelper.isNew(Object pc)
+     *  
+     */
+    public void testIsNew() {
+        pm = getPM();
+        Transaction tx = pm.currentTransaction();
+        tx.begin();
+        PCPoint p1 = new PCPoint(1,3);
+        pm.makePersistent(p1);
+        boolean isNew = JDOHelper.isNew(p1);
+        tx.commit();
+        if (!isNew)
+            fail(ASSERTION_FAILED,
+                 "JDOHelper.isNew returns false for P-NEW instance");
+        pm.close();
+        pm = null;
+    }
+}

Added: 
incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/api/jdohelper/IsNewFalse.java
URL: 
http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/api/jdohelper/IsNewFalse.java?view=auto&rev=158179
==============================================================================
--- 
incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/api/jdohelper/IsNewFalse.java
 (added)
+++ 
incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/api/jdohelper/IsNewFalse.java
 Fri Mar 18 17:07:39 2005
@@ -0,0 +1,80 @@
+/*
+ * 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 New False
+ *<BR>
+ *<B>Keywords:</B> jdohelper 
+ *<BR>
+ *<B>Assertion ID:</B> A8.4.4-2
+ *<BR>
+ *<B>Assertion Description: </B>
+  The jdohelper.isnew method returns false for the instances that have not
+been made persistent in the current transaction 
+  evaluating to true when == is used. 
+ */
+ /*
+ * Revision History
+ * ================
+ * Author         :    Date   :        Version  
+ * Azita Kamangar      10/2/01          1.0
+ */
+public class IsNewFalse extends JDO_Test {
+
+    /** */
+    private static final String ASSERTION_FAILED = 
+        "Assertion A8.4.4-2 (IsNewFalse) 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(IsNewFalse.class);
+    }
+ 
+    /* test JDOHelper.isNew(Object pc)
+     *  
+     */
+    public void testIsNewFalse() {
+       pm = getPM();
+       Transaction tx = pm.currentTransaction();
+       tx.begin();
+       PCPoint p1 = new PCPoint(1,3);
+       tx.commit();
+          
+       tx.begin();
+       // access p1 field to make sure the instance is loaded in new tx
+       p1.getX();
+       boolean isNew = JDOHelper.isNew(p1);
+       tx.commit();
+       if (isNew)
+               fail(ASSERTION_FAILED,
+                   "JDOHelper.isNew returns true for P-CLEAN instance");
+        pm.close();
+        pm = null;
+    }
+}

Added: 
incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/api/jdohelper/IsNewForNull.java
URL: 
http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/api/jdohelper/IsNewForNull.java?view=auto&rev=158179
==============================================================================
--- 
incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/api/jdohelper/IsNewForNull.java
 (added)
+++ 
incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/api/jdohelper/IsNewForNull.java
 Fri Mar 18 17:07:39 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 New For Null
+ *<BR>
+ *<B>Keywords:</B> jdohelper 
+ *<BR>
+ *<B>Assertion ID:</B> A8.4.4-5
+ *<BR>
+ *<B>Assertion Description: </B>
+  The jdohelper.isNew 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 IsNewForNull extends JDO_Test {
+
+    /** */
+    private static final String ASSERTION_FAILED = 
+        "Assertion A8.4.4-5 (IsNewForNull) 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(IsNewForNull.class);
+    }
+
+    /* test JDOHelper.isNew(Object pc)
+     *  
+     */
+    public void testIsNewForNull() {
+       pm = getPM();
+       Transaction tx = pm.currentTransaction();
+       tx.begin();
+       Object p1 = null;
+       boolean isNew = JDOHelper.isNew(p1);
+       tx.commit();
+       if (isNew)
+               fail(ASSERTION_FAILED,
+                   "JDOHelper.isNew with argument null returns true");
+        pm.close();
+        pm = null;
+    }
+}

Added: 
incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/api/jdohelper/IsNewForTransient.java
URL: 
http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/api/jdohelper/IsNewForTransient.java?view=auto&rev=158179
==============================================================================
--- 
incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/api/jdohelper/IsNewForTransient.java
 (added)
+++ 
incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/api/jdohelper/IsNewForTransient.java
 Fri Mar 18 17:07:39 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 New For Transient
+ *<BR>
+ *<B>Keywords:</B> jdohelper 
+ *<BR>
+ *<B>Assertion ID:</B> A8.4.4-3
+ *<BR>
+ *<B>Assertion Description: </B>
+  The jdohelper.isNew  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 IsNewForTransient extends JDO_Test {
+
+    /** */
+    private static final String ASSERTION_FAILED = 
+        "Assertion A8.4.4-3 (IsNewForTransient) 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(IsNewForTransient.class);
+    }
+
+    /* test JDOHelper.isNew(Object pc)
+     *  
+     */
+    public void testIsNewForTransient() {
+       pm = getPM();
+       Transaction tx = pm.currentTransaction();
+       tx.begin();
+       PCPoint p1 = new PCPoint(1,3);
+       boolean isNew = JDOHelper.isNew(p1);
+       tx.commit();
+       if (isNew)
+               fail(ASSERTION_FAILED,
+                    "JDOHelper.isNew returns true for transient instance");
+        pm.close();
+        pm = null;
+    }
+}

Added: 
incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/api/jdohelper/IsNewNotPersistenceCapable.java
URL: 
http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/api/jdohelper/IsNewNotPersistenceCapable.java?view=auto&rev=158179
==============================================================================
--- 
incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/api/jdohelper/IsNewNotPersistenceCapable.java
 (added)
+++ 
incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/api/jdohelper/IsNewNotPersistenceCapable.java
 Fri Mar 18 17:07:39 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;
+    }
+}

Added: 
incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/api/jdohelper/IsPersistent.java
URL: 
http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/api/jdohelper/IsPersistent.java?view=auto&rev=158179
==============================================================================
--- 
incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/api/jdohelper/IsPersistent.java
 (added)
+++ 
incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/api/jdohelper/IsPersistent.java
 Fri Mar 18 17:07:39 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;
+    }
+}

Added: 
incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/api/jdohelper/IsPersistentFalse.java
URL: 
http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/api/jdohelper/IsPersistentFalse.java?view=auto&rev=158179
==============================================================================
--- 
incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/api/jdohelper/IsPersistentFalse.java
 (added)
+++ 
incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/api/jdohelper/IsPersistentFalse.java
 Fri Mar 18 17:07:39 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;
+    }
+}

Added: 
incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/api/jdohelper/IsPersistentForNull.java
URL: 
http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/api/jdohelper/IsPersistentForNull.java?view=auto&rev=158179
==============================================================================
--- 
incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/api/jdohelper/IsPersistentForNull.java
 (added)
+++ 
incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/api/jdohelper/IsPersistentForNull.java
 Fri Mar 18 17:07:39 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;
+    }
+}

Added: 
incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/api/jdohelper/IsPersistentForTransient.java
URL: 
http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/api/jdohelper/IsPersistentForTransient.java?view=auto&rev=158179
==============================================================================
--- 
incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/api/jdohelper/IsPersistentForTransient.java
 (added)
+++ 
incubator/jdo/trunk/tck11/test/java/org/apache/jdo/tck/api/jdohelper/IsPersistentForTransient.java
 Fri Mar 18 17:07:39 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;
+    }
+}
+ 


Reply via email to