harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From qi...@apache.org
Subject svn commit: r790088 - in /harmony/enhanced/classlib/trunk/modules/prefs: ./ make/ src/test/java/org/apache/harmony/prefs/tests/java/util/prefs/
Date Wed, 01 Jul 2009 09:29:01 GMT
Author: qiuxx
Date: Wed Jul  1 09:29:00 2009
New Revision: 790088

URL: http://svn.apache.org/viewvc?rev=790088&view=rev
Log:
Apply for HARMONY-6058, [classlib][prefs] - remove FilePreferencesImplTest from exclude list

Modified:
    harmony/enhanced/classlib/trunk/modules/prefs/build.xml
    harmony/enhanced/classlib/trunk/modules/prefs/make/exclude.common
    harmony/enhanced/classlib/trunk/modules/prefs/src/test/java/org/apache/harmony/prefs/tests/java/util/prefs/AbstractPreferencesTest.java
    harmony/enhanced/classlib/trunk/modules/prefs/src/test/java/org/apache/harmony/prefs/tests/java/util/prefs/FilePreferencesImplTest.java
    harmony/enhanced/classlib/trunk/modules/prefs/src/test/java/org/apache/harmony/prefs/tests/java/util/prefs/MockAbstractPreferences.java

Modified: harmony/enhanced/classlib/trunk/modules/prefs/build.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/prefs/build.xml?rev=790088&r1=790087&r2=790088&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/prefs/build.xml (original)
+++ harmony/enhanced/classlib/trunk/modules/prefs/build.xml Wed Jul  1 09:29:00 2009
@@ -188,7 +188,7 @@
         <property name="test.jre.home" value="${hy.jdk}/jre" />
 
         <junit fork="yes"
-            forkmode="${hy.test.forkmode}"
+            forkmode="perBatch"
             timeout="${hy.test.timeout}"
             printsummary="withOutAndErr"
             errorproperty="test.errors"
@@ -219,8 +219,18 @@
                     <!-- unless ${test.case} -->
                     <include name="**/*Test.java" unless="test.case" />
                     <excludesfile name="${prefs.exclude.file}" unless="test.case" />
+
+                    <!--  These tests run in a separate jvm below -->
+                    <exclude name="org/apache/harmony/prefs/tests/java/util/prefs/FilePreferencesImplTest.java"
unless="test.case" />
+                </fileset>
+            </batchtest>
+
+            <batchtest todir="${tests.output}" haltonfailure="no" unless="test.case" >
+                <fileset dir="${hy.prefs.src.test.java}">
+                    <include name="org/apache/harmony/prefs/tests/java/util/prefs/FilePreferencesImplTest.java"
/>
                 </fileset>
             </batchtest>
+
         </junit>
         <antcall target="touch-failures-file" />
         <antcall target="touch-errors-file" />

Modified: harmony/enhanced/classlib/trunk/modules/prefs/make/exclude.common
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/prefs/make/exclude.common?rev=790088&r1=790087&r2=790088&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/prefs/make/exclude.common (original)
+++ harmony/enhanced/classlib/trunk/modules/prefs/make/exclude.common Wed Jul  1 09:29:00
2009
@@ -1 +1 @@
-org/apache/harmony/prefs/tests/java/util/prefs/FilePreferencesImplTest.java
+

Modified: harmony/enhanced/classlib/trunk/modules/prefs/src/test/java/org/apache/harmony/prefs/tests/java/util/prefs/AbstractPreferencesTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/prefs/src/test/java/org/apache/harmony/prefs/tests/java/util/prefs/AbstractPreferencesTest.java?rev=790088&r1=790087&r2=790088&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/prefs/src/test/java/org/apache/harmony/prefs/tests/java/util/prefs/AbstractPreferencesTest.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/prefs/src/test/java/org/apache/harmony/prefs/tests/java/util/prefs/AbstractPreferencesTest.java
Wed Jul  1 09:29:00 2009
@@ -105,7 +105,9 @@
                 ((MockAbstractPreferences) pref)
                 .setResult(MockAbstractPreferences.NORMAL);
             }
-            pref.removeNode();
+            // make sure remove it successfully
+            parent.node("mock").removeNode();
+
         } catch (Exception e) {
         }
         super.tearDown();

Modified: harmony/enhanced/classlib/trunk/modules/prefs/src/test/java/org/apache/harmony/prefs/tests/java/util/prefs/FilePreferencesImplTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/prefs/src/test/java/org/apache/harmony/prefs/tests/java/util/prefs/FilePreferencesImplTest.java?rev=790088&r1=790087&r2=790088&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/prefs/src/test/java/org/apache/harmony/prefs/tests/java/util/prefs/FilePreferencesImplTest.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/prefs/src/test/java/org/apache/harmony/prefs/tests/java/util/prefs/FilePreferencesImplTest.java
Wed Jul  1 09:29:00 2009
@@ -39,8 +39,8 @@
         prevFactory = System.getProperty("java.util.prefs.PreferencesFactory");
         System.setProperty("java.util.prefs.PreferencesFactory", "java.util.prefs.FilePreferencesFactoryImpl");
 
-        uroot = Preferences.userRoot();
-        sroot = Preferences.systemRoot();
+        uroot = Preferences.userRoot().node("harmony_test");
+        sroot = Preferences.systemRoot().node("harmony_test");
     }
 
     @Override
@@ -48,6 +48,8 @@
         if (prevFactory != null)
             System.setProperty("java.util.prefs.PreferencesFactory", prevFactory);
 
+        uroot.removeNode();
+        sroot.removeNode();
         uroot = null;
         sroot = null;
     }
@@ -84,31 +86,20 @@
 
         String[] childNames = uroot.childrenNames();
         assertEquals(2, childNames.length);
-        for (int i = 0; i < childNames.length; i++) {
-            System.out.println(childNames[i]);
-        }
 
         childNames = child1.childrenNames();
         assertEquals(1, childNames.length);
-        for (int i = 0; i < childNames.length; i++) {
-            System.out.println(childNames[i]);
-        }
 
         childNames = child2.childrenNames();
         assertEquals(0, childNames.length);
-        for (int i = 0; i < childNames.length; i++) {
-            System.out.println(childNames[i]);
-        }
 
         child1.removeNode();
         childNames = uroot.childrenNames();
         assertEquals(1, childNames.length);
-        for (int i = 0; i < childNames.length; i++) {
-            System.out.println(childNames[i]);
-        }
-        // child2.removeNode();
-        // childNames = uroot.childrenNames();
-        // assertEquals(0, childNames.length);
+
+        child2.removeNode();
+        childNames = uroot.childrenNames();
+        assertEquals(0, childNames.length);
 
         child1 = sroot.node("child1");
         child2 = sroot.node("child2");
@@ -116,22 +107,13 @@
 
         childNames = sroot.childrenNames();
 
-        for (int i = 0; i < childNames.length; i++) {
-            System.out.println(childNames[i]);
-        }
         assertEquals(2, childNames.length);
 
         childNames = child1.childrenNames();
         assertEquals(1, childNames.length);
-        for (int i = 0; i < childNames.length; i++) {
-            System.out.println(childNames[i]);
-        }
 
         childNames = child2.childrenNames();
         assertEquals(0, childNames.length);
-        for (int i = 0; i < childNames.length; i++) {
-            System.out.println(childNames[i]);
-        }
 
         child1.removeNode();
         assertNotSame(child1, sroot.node("child1"));
@@ -139,9 +121,6 @@
         sroot.node("child1").removeNode();
         childNames = sroot.childrenNames();
         assertEquals(1, childNames.length);
-        for (int i = 0; i < childNames.length; i++) {
-            System.out.println(childNames[i]);
-        }
         child2.removeNode();
         childNames = sroot.childrenNames();
         assertEquals(0, childNames.length);
@@ -219,7 +198,6 @@
         @Override
         public void checkPermission(Permission perm, Object ctx) {
             if (perm instanceof FilePermission) {
-                System.out.println(perm.getActions());
                 throw new SecurityException();
             } else if (dflt != null) {
                 dflt.checkPermission(perm, ctx);

Modified: harmony/enhanced/classlib/trunk/modules/prefs/src/test/java/org/apache/harmony/prefs/tests/java/util/prefs/MockAbstractPreferences.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/prefs/src/test/java/org/apache/harmony/prefs/tests/java/util/prefs/MockAbstractPreferences.java?rev=790088&r1=790087&r2=790088&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/prefs/src/test/java/org/apache/harmony/prefs/tests/java/util/prefs/MockAbstractPreferences.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/prefs/src/test/java/org/apache/harmony/prefs/tests/java/util/prefs/MockAbstractPreferences.java
Wed Jul  1 09:29:00 2009
@@ -22,6 +22,7 @@
 import java.util.Set;
 import java.util.prefs.AbstractPreferences;
 import java.util.prefs.BackingStoreException;
+import java.util.prefs.Preferences;
 
 public class MockAbstractPreferences extends AbstractPreferences {
     static final int NORMAL = 0;
@@ -167,7 +168,15 @@
     @Override
     protected void removeNodeSpi() throws BackingStoreException {
         checkException();
-        ((MockAbstractPreferences) parent()).childs.remove(name());
+        Preferences p = parent();
+        if (p instanceof MockAbstractPreferences) {
+            ((MockAbstractPreferences) p).childs.remove(name());
+        } else {
+            String[] children = p.childrenNames();
+            for (String child : children) {
+                p.node(child).removeNode();
+            }
+        }
     }
 
     @Override



Mime
View raw message