harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From smish...@apache.org
Subject svn commit: r426439 - in /incubator/harmony/enhanced/classlib/trunk/modules/security/src/test: api/java.injected/java/security/serialization/ resources/java/security/serialization/ support/common/java/org/apache/harmony/security/tests/support/
Date Fri, 28 Jul 2006 08:46:23 GMT
Author: smishura
Date: Fri Jul 28 01:46:22 2006
New Revision: 426439

URL: http://svn.apache.org/viewvc?rev=426439&view=rev
Log:
Refactoring PermissionCollection serialization test - use support test class

Added:
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/support/common/java/org/apache/harmony/security/tests/support/MyPermissionCollection.java
  (with props)
Modified:
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/serialization/PermissionCollectionTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/resources/java/security/serialization/PermissionCollectionTest.0.dat
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/resources/java/security/serialization/PermissionCollectionTest.1.dat

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/serialization/PermissionCollectionTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/serialization/PermissionCollectionTest.java?rev=426439&r1=426438&r2=426439&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/serialization/PermissionCollectionTest.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/serialization/PermissionCollectionTest.java
Fri Jul 28 01:46:22 2006
@@ -21,17 +21,11 @@
 
 package java.security.serialization;
 
-import java.security.Permission;
-import java.security.PermissionCollection;
-import java.util.Enumeration;
-import java.util.NoSuchElementException;
-
+import org.apache.harmony.security.tests.support.MyPermissionCollection;
 import org.apache.harmony.testframework.serialization.SerializationTest;
 
-
 /**
  * Serialization tests for <code>PermissionCollection</code>
- * 
  */
 
 public class PermissionCollectionTest extends SerializationTest {
@@ -40,36 +34,7 @@
      * @see com.intel.drl.test.SerializationTest#getData()
      */
     protected Object[] getData() {
-        return new Object[] { new RealPermissionCollection(false),
-                new RealPermissionCollection(true) };
+        return new Object[] { new MyPermissionCollection(false),
+                new MyPermissionCollection(true) };
     }
 }
-
-// Bare extension to instantiate abstract PermissionCollection class
-final class RealPermissionCollection extends PermissionCollection {
-
-    public RealPermissionCollection(boolean readOnly) {
-        if (readOnly) {
-            setReadOnly();
-        }
-    }
-
-    public void add(Permission permission) {}
-
-    public Enumeration<Permission> elements() {
-
-        return new Enumeration<Permission>() {
-            public boolean hasMoreElements() {
-                return false;
-            }
-
-            public Permission nextElement() {
-                throw new NoSuchElementException();
-            }
-        };
-    }
-
-    public boolean implies(Permission permission) {
-        return false;
-    }
-}
\ No newline at end of file

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/resources/java/security/serialization/PermissionCollectionTest.0.dat
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/resources/java/security/serialization/PermissionCollectionTest.0.dat?rev=426439&r1=426438&r2=426439&view=diff
==============================================================================
Binary files - no diff available.

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/resources/java/security/serialization/PermissionCollectionTest.1.dat
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/resources/java/security/serialization/PermissionCollectionTest.1.dat?rev=426439&r1=426438&r2=426439&view=diff
==============================================================================
Binary files - no diff available.

Added: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/support/common/java/org/apache/harmony/security/tests/support/MyPermissionCollection.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/support/common/java/org/apache/harmony/security/tests/support/MyPermissionCollection.java?rev=426439&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/support/common/java/org/apache/harmony/security/tests/support/MyPermissionCollection.java
(added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/support/common/java/org/apache/harmony/security/tests/support/MyPermissionCollection.java
Fri Jul 28 01:46:22 2006
@@ -0,0 +1,51 @@
+/*
+ *  Copyright 2006 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  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.harmony.security.tests.support;
+
+import java.security.BasicPermission;
+import java.security.Permission;
+import java.security.PermissionCollection;
+import java.util.Enumeration;
+import java.util.NoSuchElementException;
+
+public class MyPermissionCollection extends PermissionCollection {
+
+     public MyPermissionCollection(boolean readOnly) {
+         if (readOnly) {
+             setReadOnly();
+         }
+     }
+
+     public void add(Permission permission) {}
+
+     public Enumeration<Permission> elements() {
+
+         return new Enumeration<Permission>() {
+             public boolean hasMoreElements() {
+                 return false;
+             }
+
+             public Permission nextElement() {
+                 throw new NoSuchElementException();
+             }
+         };
+     }
+
+     public boolean implies(Permission permission) {
+         return false;
+     }
+ }

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/support/common/java/org/apache/harmony/security/tests/support/MyPermissionCollection.java
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message