db-jdo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From c..@apache.org
Subject svn commit: r386517 - in /db/jdo/trunk/api20: src/java/javax/jdo/identity/ObjectIdentity.java test/java/javax/jdo/identity/ObjectIdentityTest.java test/java/javax/jdo/util/AbstractTest.java
Date Fri, 17 Mar 2006 03:16:32 GMT
Author: clr
Date: Thu Mar 16 19:16:32 2006
New Revision: 386517

URL: http://svn.apache.org/viewcvs?rev=386517&view=rev
Log:
JDO-341 Change access from public to private for JDOImplHelper.isClassLoadable and ObjectIdentity.STRING_DELIMITER

Modified:
    db/jdo/trunk/api20/src/java/javax/jdo/identity/ObjectIdentity.java
    db/jdo/trunk/api20/test/java/javax/jdo/identity/ObjectIdentityTest.java
    db/jdo/trunk/api20/test/java/javax/jdo/util/AbstractTest.java

Modified: db/jdo/trunk/api20/src/java/javax/jdo/identity/ObjectIdentity.java
URL: http://svn.apache.org/viewcvs/db/jdo/trunk/api20/src/java/javax/jdo/identity/ObjectIdentity.java?rev=386517&r1=386516&r2=386517&view=diff
==============================================================================
--- db/jdo/trunk/api20/src/java/javax/jdo/identity/ObjectIdentity.java (original)
+++ db/jdo/trunk/api20/src/java/javax/jdo/identity/ObjectIdentity.java Thu Mar 16 19:16:32
2006
@@ -53,7 +53,7 @@
     
     /** The delimiter for String constructor.
      */
-    public static String STRING_DELIMITER = ":"; //NOI18N
+    private static String STRING_DELIMITER = ":"; //NOI18N
     
     /** Constructor with class and key.
      * @param pcClass the class

Modified: db/jdo/trunk/api20/test/java/javax/jdo/identity/ObjectIdentityTest.java
URL: http://svn.apache.org/viewcvs/db/jdo/trunk/api20/test/java/javax/jdo/identity/ObjectIdentityTest.java?rev=386517&r1=386516&r2=386517&view=diff
==============================================================================
--- db/jdo/trunk/api20/test/java/javax/jdo/identity/ObjectIdentityTest.java (original)
+++ db/jdo/trunk/api20/test/java/javax/jdo/identity/ObjectIdentityTest.java Thu Mar 16 19:16:32
2006
@@ -113,7 +113,7 @@
     }
     
     public void testCurrencyConstructor() {
-        if (!helper.isClassLoadable("java.util.Currency")) return;
+        if (!isClassLoadable("java.util.Currency")) return;
         ObjectIdentity c1 = new ObjectIdentity(Object.class, 
                 Currency.getInstance(Locale.US));
         ObjectIdentity c2 = new ObjectIdentity(Object.class, 
@@ -247,7 +247,7 @@
     }
 
     public void testStringLocaleConstructorLanguage() {
-        if (!helper.isClassLoadable("java.util.Currency")) return;
+        if (!isClassLoadable("java.util.Currency")) return;
         SingleFieldIdentity c1 = new ObjectIdentity(Object.class, 
                     "java.util.Locale:en");
         assertEquals(new Locale("en"), c1.getKeyAsObject());
@@ -272,13 +272,13 @@
     }
 
     public void testStringCurrencyConstructor() {
-        if (!helper.isClassLoadable("java.util.Currency")) return;
+        if (!isClassLoadable("java.util.Currency")) return;
         SingleFieldIdentity c1 = new ObjectIdentity(Object.class, 
                     "java.util.Currency:USD");
     }
 
     public void testBadStringCurrencyConstructor() {
-        if (!helper.isClassLoadable("java.util.Currency")) return;
+        if (!isClassLoadable("java.util.Currency")) return;
         try {
             ObjectIdentity c1 = new ObjectIdentity(Object.class, 
                     "java.util.Currency:NowhereInTheWorld");
@@ -326,7 +326,7 @@
     }
     
     public void testSerializedCurrency() {
-        if (!helper.isClassLoadable("java.util.Currency")) return;
+        if (!isClassLoadable("java.util.Currency")) return;
         ObjectIdentity c1 = new ObjectIdentity(Object.class, Currency.getInstance(Locale.US));
         ObjectIdentity c2 = new ObjectIdentity(Object.class, Currency.getInstance(Locale.US));
         ObjectIdentity c3 = new ObjectIdentity(Object.class, Currency.getInstance(Locale.GERMANY));

Modified: db/jdo/trunk/api20/test/java/javax/jdo/util/AbstractTest.java
URL: http://svn.apache.org/viewcvs/db/jdo/trunk/api20/test/java/javax/jdo/util/AbstractTest.java?rev=386517&r1=386516&r2=386517&view=diff
==============================================================================
--- db/jdo/trunk/api20/test/java/javax/jdo/util/AbstractTest.java (original)
+++ db/jdo/trunk/api20/test/java/javax/jdo/util/AbstractTest.java Thu Mar 16 19:16:32 2006
@@ -38,6 +38,18 @@
     }
     
     /**
+     * Determine if a class is loadable in the current environment.
+     */
+    protected static boolean isClassLoadable(String className) {
+        try {
+            Class.forName(className);
+            return true;
+        } catch (ClassNotFoundException ex) {
+            return false;
+        }
+    }
+    
+    /**
      */
     protected void println(String s) {
         if (verbose) 



Mime
View raw message