db-jdo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From c..@apache.org
Subject svn commit: r516842 - /db/jdo/trunk/api20/test/java/javax/jdo/JDOHelperTest.java
Date Sun, 11 Mar 2007 02:11:00 GMT
Author: clr
Date: Sat Mar 10 18:11:00 2007
New Revision: 516842

URL: http://svn.apache.org/viewvc?view=rev&rev=516842
Log:
JDO-471 add tests for constructor and getInstance

Modified:
    db/jdo/trunk/api20/test/java/javax/jdo/JDOHelperTest.java

Modified: db/jdo/trunk/api20/test/java/javax/jdo/JDOHelperTest.java
URL: http://svn.apache.org/viewvc/db/jdo/trunk/api20/test/java/javax/jdo/JDOHelperTest.java?view=diff&rev=516842&r1=516841&r2=516842
==============================================================================
--- db/jdo/trunk/api20/test/java/javax/jdo/JDOHelperTest.java (original)
+++ db/jdo/trunk/api20/test/java/javax/jdo/JDOHelperTest.java Sat Mar 10 18:11:00 2007
@@ -46,6 +46,64 @@
         BatchTestRunner.run(JDOHelperTest.class);
     }
 
+    /** The purpose of this test is simply to call some of the
+     * methods on a constructed instance of JDOHelper and verify that
+     * they do not throw exceptions. It is not a functional test.
+     * @since 2.1
+     */
+    public void testConstructor() {
+        JDOHelper helper = new JDOHelper();
+        assertNull("getObjectId(null) returned non-null", 
+                helper.getObjectId(null));
+        assertNull("getPersistenceManager(null) returned non-null", 
+                helper.getPersistenceManager(null));
+        assertNull("getTransactionalObjectId(null) returned non-null", 
+                helper.getTransactionalObjectId(null));
+        assertNull("getVersion(null) returned non-null", 
+                helper.getVersion(null));
+        assertFalse("isDeleted(null) returned non-null", 
+                helper.isDeleted(null));
+        assertFalse("isDetached(null) returned non-null", 
+                helper.isDetached(null));
+        assertFalse("isDirty(null) returned non-null", 
+                helper.isDirty(null));
+        assertFalse("isNew(null) returned non-null", 
+                helper.isNew(null));
+        assertFalse("isPersistent(null) returned non-null", 
+                helper.isPersistent(null));
+        assertFalse("isTransactional(null) returned non-null", 
+                helper.isTransactional(null));
+    }
+
+    /** The purpose of this test is simply to call some of the
+     * methods on the static instance of JDOHelper and verify that
+     * they do not throw exceptions. It is not a functional test.
+     * @since 2.1
+     */
+    public void testGetInstance() {
+        JDOHelper helper = JDOHelper.getInstance();
+        assertNull("getObjectId(null) returned non-null", 
+                helper.getObjectId(null));
+        assertNull("getPersistenceManager(null) returned non-null", 
+                helper.getPersistenceManager(null));
+        assertNull("getTransactionalObjectId(null) returned non-null", 
+                helper.getTransactionalObjectId(null));
+        assertNull("getVersion(null) returned non-null", 
+                helper.getVersion(null));
+        assertFalse("isDeleted(null) returned non-null", 
+                helper.isDeleted(null));
+        assertFalse("isDetached(null) returned non-null", 
+                helper.isDetached(null));
+        assertFalse("isDirty(null) returned non-null", 
+                helper.isDirty(null));
+        assertFalse("isNew(null) returned non-null", 
+                helper.isNew(null));
+        assertFalse("isPersistent(null) returned non-null", 
+                helper.isPersistent(null));
+        assertFalse("isTransactional(null) returned non-null", 
+                helper.isTransactional(null));
+    }
+
     /** */
     public void testGetPM() {
         PCPoint p = new PCPoint(1, new Integer(1));



Mime
View raw message