harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From smish...@apache.org
Subject svn commit: r426447 - 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 09:08:49 GMT
Author: smishura
Date: Fri Jul 28 02:08:48 2006
New Revision: 426447

URL: http://svn.apache.org/viewvc?rev=426447&view=rev
Log:
Refactoring Permission 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/MyPermission.java
  (with props)
Modified:
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/serialization/PermissionTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/resources/java/security/serialization/PermissionTest.0.dat
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/resources/java/security/serialization/PermissionTest.1.dat

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/serialization/PermissionTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/serialization/PermissionTest.java?rev=426447&r1=426446&r2=426447&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/serialization/PermissionTest.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/serialization/PermissionTest.java
Fri Jul 28 02:08:48 2006
@@ -21,14 +21,11 @@
 
 package java.security.serialization;
 
-import java.security.Permission;
-
+import org.apache.harmony.security.tests.support.MyPermission;
 import org.apache.harmony.testframework.serialization.SerializationTest;
 
-
 /**
  * Serialization tests for <code>Permission</code>
- * 
  */
 
 public class PermissionTest extends SerializationTest {
@@ -37,38 +34,7 @@
      * @see com.intel.drl.test.SerializationTest#getData()
      */
     protected Object[] getData() {
-        return new Object[] { new RealPermission(null),
-                new RealPermission("IYF&*%^sd 43") };
+        return new Object[] { new MyPermission(null),
+                new MyPermission("IYF&*%^sd 43") };
     }
 }
-
-// Bare extension to instantiate abstract Permission class
-final class RealPermission extends Permission {
-
-    public RealPermission(String name) {
-        super(name);
-    }
-
-    public boolean equals(Object obj) {
-        if (obj instanceof RealPermission) {
-            String name = ((RealPermission) obj).getName();
-            if (name == null) {
-                return getName() == null;
-            }
-            return name.equals(getName());
-        }
-        return false;
-    }
-
-    public String getActions() {
-        return null;
-    }
-
-    public int hashCode() {
-        return 0;
-    }
-
-    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/PermissionTest.0.dat
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/resources/java/security/serialization/PermissionTest.0.dat?rev=426447&r1=426446&r2=426447&view=diff
==============================================================================
Binary files - no diff available.

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/resources/java/security/serialization/PermissionTest.1.dat
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/resources/java/security/serialization/PermissionTest.1.dat?rev=426447&r1=426446&r2=426447&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/MyPermission.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/MyPermission.java?rev=426447&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/support/common/java/org/apache/harmony/security/tests/support/MyPermission.java
(added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/support/common/java/org/apache/harmony/security/tests/support/MyPermission.java
Fri Jul 28 02:08:48 2006
@@ -0,0 +1,49 @@
+/*
+ *  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.Permission;
+
+public final class MyPermission extends Permission {
+
+    public MyPermission(String name) {
+        super(name);
+    }
+
+    public boolean equals(Object obj) {
+        if (obj instanceof MyPermission) {
+            String name = ((MyPermission) obj).getName();
+            if (name == null) {
+                return getName() == null;
+            }
+            return name.equals(getName());
+        }
+        return false;
+    }
+
+    public String getActions() {
+        return null;
+    }
+
+    public int hashCode() {
+        return 0;
+    }
+
+    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/MyPermission.java
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message