harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From telli...@apache.org
Subject svn commit: r587631 - in /harmony/enhanced/classlib/trunk/modules/security/src: main/java/common/org/apache/harmony/security/ main/java/common/org/apache/harmony/security/fortress/ test/api/java/org/apache/harmony/security/tests/java/security/ test/imp...
Date Tue, 23 Oct 2007 19:35:49 GMT
Author: tellison
Date: Tue Oct 23 12:35:48 2007
New Revision: 587631

URL: http://svn.apache.org/viewvc?rev=587631&view=rev
Log:
Apply patch HARMONY-2910 ([classlib][security] Harmony cannot identify 'codeBase' feature
in policy file)

Modified:
    harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/PolicyEntry.java
    harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/fortress/DefaultPolicyParser.java
    harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/fortress/PolicyUtils.java
    harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/PolicyTest.java
    harmony/enhanced/classlib/trunk/modules/security/src/test/impl/java/org/apache/harmony/security/tests/PolicyEntryTest.java

Modified: harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/PolicyEntry.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/PolicyEntry.java?rev=587631&r1=587630&r2=587631&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/PolicyEntry.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/PolicyEntry.java
Tue Oct 23 12:35:48 2007
@@ -22,6 +22,8 @@
 
 package org.apache.harmony.security;
 
+import java.net.URL;
+import java.security.CodeSigner;
 import java.security.CodeSource;
 import java.security.Permission;
 import java.security.Principal;
@@ -30,7 +32,6 @@
 
 import org.apache.harmony.security.fortress.PolicyUtils;
 
-
 /**
  * This class represents an elementary block of a security policy. It associates
  * a CodeSource of an executable code, Principals allowed to execute the code,
@@ -55,7 +56,7 @@
      */
     public PolicyEntry(CodeSource cs, Collection<? extends Principal> prs,
             Collection<? extends Permission> permissions) {
-        this.cs = cs;
+        this.cs = (cs != null) ? normalizeCodeSource(cs) : null;
         this.principals = (prs == null || prs.isEmpty()) ? null
                 : (Principal[]) prs.toArray(new Principal[prs.size()]);
         this.permissions = (permissions == null || permissions.isEmpty()) ? null
@@ -68,7 +69,31 @@
      * imply() method.
      */
     public boolean impliesCodeSource(CodeSource codeSource) {
-        return (cs == null) ? true : cs.implies(codeSource);
+        if (cs == null) {
+            return true;
+        }
+
+        if (codeSource == null) {
+            return false;
+        }
+        return cs.implies(normalizeCodeSource(codeSource));
+    }
+
+    private CodeSource normalizeCodeSource(CodeSource codeSource) {
+        URL codeSourceURL = PolicyUtils.normalizeURL(codeSource.getLocation());
+        CodeSource result = codeSource;
+
+        if (codeSourceURL != codeSource.getLocation()) {
+            // URL was normalized - recreate codeSource with new URL
+            CodeSigner[] signers = codeSource.getCodeSigners();
+            if (signers == null) {
+                result = new CodeSource(codeSourceURL, codeSource
+                        .getCertificates());
+            } else {
+                result = new CodeSource(codeSourceURL, signers);
+            }
+        }
+        return result;
     }
 
     /**

Modified: harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/fortress/DefaultPolicyParser.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/fortress/DefaultPolicyParser.java?rev=587631&r1=587630&r2=587631&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/fortress/DefaultPolicyParser.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/fortress/DefaultPolicyParser.java
Tue Oct 23 12:35:48 2007
@@ -25,7 +25,6 @@
 import java.io.BufferedReader;
 import java.io.InputStream;
 import java.io.InputStreamReader;
-import java.io.File;
 import java.io.Reader;
 import java.net.URL;
 import java.security.cert.Certificate;
@@ -194,23 +193,6 @@
         if (ge.codebase != null) {
             codebase = new URL(resolve ? PolicyUtils.expandURL(ge.codebase,
                     system) : ge.codebase);
-            //Fix HARMONY-1963
-            if ("file".equals(codebase.getProtocol())) { //$NON-NLS-1$
-            	File codeFile = new File(codebase.getFile());
-            	if (codeFile.isAbsolute()) {
-                    String absolutePath = codeFile.getAbsolutePath();
-                    //Fix HARMONY-4184
-                    //Unix style file path.
-                    if (absolutePath.startsWith("/")) {
-                        codebase = new URL("file://" + //$NON-NLS-1$
-                                codeFile.getAbsolutePath());
-                    } else {
-                        //Windows style file path.                        
-                        codebase = new URL("file:/" + //$NON-NLS-1$
-                                codeFile.getAbsolutePath());
-                    }           		
-            	}
-            }
         }
         if (ge.signers != null) {
             if (resolve) {

Modified: harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/fortress/PolicyUtils.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/fortress/PolicyUtils.java?rev=587631&r1=587630&r2=587631&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/fortress/PolicyUtils.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/fortress/PolicyUtils.java
Tue Oct 23 12:35:48 2007
@@ -25,6 +25,8 @@
 import java.io.File;
 import java.io.InputStream;
 import java.lang.reflect.Constructor;
+import java.net.URI;
+import java.net.URISyntaxException;
 import java.net.URL;
 import java.security.AccessController;
 import java.security.Permission;
@@ -283,6 +285,56 @@
             throws ExpansionFailedException {
         return expand(str, properties).replace(File.separatorChar, '/');
     }
+    
+    /**
+     * Normalizes URLs to standard ones, eliminating pathname symbols.
+     * 
+     * @param codebase -
+     *            the original URL.
+     * @return - the normalized URL.
+     */
+    public static URL normalizeURL(URL codebase) {
+        if (codebase != null && "file".equals(codebase.getProtocol())) { //$NON-NLS-1$
+            try {
+                if (codebase.getHost().length() == 0) {
+                    String path = codebase.getFile();
+
+                    if (path.length() == 0) {
+                        // codebase is "file:"
+                        path = "*";
+                    }
+                    return filePathToURI(new File(path)
+                            .getAbsolutePath()).normalize().toURL();
+                } else {
+                    // codebase is "file://<smth>"
+                    return codebase.toURI().normalize().toURL();
+                }
+            } catch (Exception e) {
+                // Ignore
+            }
+        }
+        return codebase;
+    }
+
+    /**
+     * Converts a file path to URI without accessing file system
+     * (like {File#toURI()} does).
+     * 
+     * @param path -
+     *            file path.
+     * @return - the resulting URI.
+     * @throw URISyntaxException
+     */
+    public static URI filePathToURI(String path) throws URISyntaxException {
+        path = path.replace(File.separatorChar, '/');
+
+        if (!path.startsWith("/")) { //$NON-NLS-1$
+            return new URI("file", null, //$NON-NLS-1$
+                    new StringBuilder(path.length() + 1).append('/')
+                            .append(path).toString(), null, null);
+        }
+        return new URI("file", null, path, null, null); //$NON-NLS-1$
+    }
 
     /**
      * Instances of this interface are intended for resolving  
@@ -586,4 +638,4 @@
         }
         return true;
     }
-}
\ No newline at end of file
+}

Modified: harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/PolicyTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/PolicyTest.java?rev=587631&r1=587630&r2=587631&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/PolicyTest.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/PolicyTest.java
Tue Oct 23 12:35:48 2007
@@ -197,7 +197,7 @@
         // Regression for HARMONY-1963 and HARMONY-2910
         String policyFile = Support_Resources
                 .getAbsoluteResourcePath("PolicyTest.txt");
-        String oldSysProp = System.getProperty(JAVA_SECURITY_POLICY);
+        String oldJavaPolicy = System.getProperty(JAVA_SECURITY_POLICY);
         Policy oldPolicy = Policy.getPolicy();
 
         try {
@@ -206,14 +206,20 @@
             // test: absolute paths
             assertCodeBasePropertyExpansion("/11111/*", "/11111/-");
             assertCodeBasePropertyExpansion("/22222/../22222/*", "/22222/-");
-            //FIXME assertCodeBasePropertyExpansion("/33333/*", "/33333/../33333/-");
+            assertCodeBasePropertyExpansion("/33333/*", "/33333/../33333/-");
+            assertCodeBasePropertyExpansion("/44444/../44444/-", "/44444/*");
+            assertCodeBasePropertyExpansion("/55555/../55555/-", "/55555/../55555/-");
+            assertCodeBasePropertyExpansion("/666 66 66/-", "/666 66 66/-");
 
             // test: relative paths
-            assertCodeBasePropertyExpansion("44444/*", "44444/-");
-            assertCodeBasePropertyExpansion("55555/../55555/*", "55555/-");
-            //FIXME assertCodeBasePropertyExpansion("66666/*", "66666/../66666/-");
+            assertCodeBasePropertyExpansion("11111/*", "11111/-");
+            assertCodeBasePropertyExpansion("22222/../22222/*", "22222/-");
+            assertCodeBasePropertyExpansion("33333/*", "33333/../33333/-");
+            assertCodeBasePropertyExpansion("44444/../44444/-", "44444/*");
+            assertCodeBasePropertyExpansion("55555/../55555/-", "55555/../55555/-");
+            assertCodeBasePropertyExpansion("666 66 66/-", "666 66 66/-");
         } finally {
-            TestUtils.setSystemProperty(JAVA_SECURITY_POLICY, oldSysProp);
+            TestUtils.setSystemProperty(JAVA_SECURITY_POLICY, oldJavaPolicy);
             Policy.setPolicy(oldPolicy);
         }
     }
@@ -236,7 +242,7 @@
         CodeSource codeSource = new CodeSource(
                 new URL("file:" + codeSourceURL),
                 (java.security.cert.Certificate[]) null);
-        
+
         PermissionCollection pCollection = p.getPermissions(codeSource);
         Enumeration<Permission> elements = pCollection.elements();
 

Modified: harmony/enhanced/classlib/trunk/modules/security/src/test/impl/java/org/apache/harmony/security/tests/PolicyEntryTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/security/src/test/impl/java/org/apache/harmony/security/tests/PolicyEntryTest.java?rev=587631&r1=587630&r2=587631&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/security/src/test/impl/java/org/apache/harmony/security/tests/PolicyEntryTest.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/security/src/test/impl/java/org/apache/harmony/security/tests/PolicyEntryTest.java
Tue Oct 23 12:35:48 2007
@@ -71,21 +71,221 @@
      * CodeSource should delegate to its own imply() functionality
      */
     public void testImpliesCodeSource() throws Exception {
-        CodeSource cs1 = new CodeSource(null, (Certificate[])null);
-        CodeSource cs2 = new CodeSource(new URL("file://*"),
-            (Certificate[])null);
-        PolicyEntry pe = new PolicyEntry(null, null, null);
-
-        assertTrue(pe.impliesCodeSource(null));
-        assertTrue(pe.impliesCodeSource(cs1));
-        assertTrue(pe.impliesCodeSource(cs2));
-
-        pe = new PolicyEntry(cs2, null, null);
-        assertFalse(pe.impliesCodeSource(null));
-        assertFalse(pe.impliesCodeSource(cs1));
-        assertTrue(pe.impliesCodeSource(cs2));
-        assertTrue(pe.impliesCodeSource(new CodeSource(new URL("file://-"),
-            (Certificate[])null)));
+        CodeSource cs0  = new CodeSource(null, (Certificate[]) null);
+
+        CodeSource cs10 = new CodeSource(new URL("file:"), (Certificate[]) null);
+        CodeSource cs11 = new CodeSource(new URL("file:/"), (Certificate[]) null);
+        CodeSource cs12 = new CodeSource(new URL("file://"), (Certificate[]) null);
+        CodeSource cs13 = new CodeSource(new URL("file:///"), (Certificate[]) null);
+
+        CodeSource cs20 = new CodeSource(new URL("file:*"), (Certificate[]) null);
+        CodeSource cs21 = new CodeSource(new URL("file:/*"), (Certificate[]) null);
+        CodeSource cs22 = new CodeSource(new URL("file://*"), (Certificate[]) null);
+        CodeSource cs23 = new CodeSource(new URL("file:///*"), (Certificate[]) null);
+
+        CodeSource cs30 = new CodeSource(new URL("file:-"), (Certificate[]) null);
+        CodeSource cs31 = new CodeSource(new URL("file:/-"), (Certificate[]) null);
+        CodeSource cs32 = new CodeSource(new URL("file://-"), (Certificate[]) null);
+        CodeSource cs33 = new CodeSource(new URL("file:///-"), (Certificate[]) null);
+
+        PolicyEntry pe0  = new PolicyEntry(null, null, null);
+
+        PolicyEntry pe10 = new PolicyEntry(cs10, null, null);
+        PolicyEntry pe11 = new PolicyEntry(cs11, null, null);
+        PolicyEntry pe12 = new PolicyEntry(cs12, null, null);
+        PolicyEntry pe13 = new PolicyEntry(cs13, null, null);
+
+        PolicyEntry pe20 = new PolicyEntry(cs20, null, null);
+        PolicyEntry pe21 = new PolicyEntry(cs21, null, null);
+        PolicyEntry pe22 = new PolicyEntry(cs22, null, null);
+        PolicyEntry pe23 = new PolicyEntry(cs23, null, null);
+
+        PolicyEntry pe30 = new PolicyEntry(cs30, null, null);
+        PolicyEntry pe31 = new PolicyEntry(cs31, null, null);
+        PolicyEntry pe32 = new PolicyEntry(cs32, null, null);
+        PolicyEntry pe33 = new PolicyEntry(cs33, null, null);
+
+        assertTrue (pe0.impliesCodeSource(null));
+        assertTrue (pe0.impliesCodeSource(cs10));
+        assertTrue (pe0.impliesCodeSource(cs11));
+        assertTrue (pe0.impliesCodeSource(cs12));
+        assertTrue (pe0.impliesCodeSource(cs13));
+        assertTrue (pe0.impliesCodeSource(cs20));
+        assertTrue (pe0.impliesCodeSource(cs21));
+        assertTrue (pe0.impliesCodeSource(cs22));
+        assertTrue (pe0.impliesCodeSource(cs23));
+        assertTrue (pe0.impliesCodeSource(cs30));
+        assertTrue (pe0.impliesCodeSource(cs31));
+        assertTrue (pe0.impliesCodeSource(cs32));
+        assertTrue (pe0.impliesCodeSource(cs33));
+
+        assertFalse(pe10.impliesCodeSource(null));
+        assertTrue (pe10.impliesCodeSource(cs10));
+        assertFalse(pe10.impliesCodeSource(cs11));
+        assertTrue (pe10.impliesCodeSource(cs12));
+        assertFalse(pe10.impliesCodeSource(cs13));
+        assertTrue (pe10.impliesCodeSource(cs20));
+        assertFalse(pe10.impliesCodeSource(cs21));
+        assertFalse(pe10.impliesCodeSource(cs22));
+        assertFalse(pe10.impliesCodeSource(cs23));
+        assertTrue (pe10.impliesCodeSource(cs30));
+        assertFalse(pe10.impliesCodeSource(cs31));
+        assertFalse(pe10.impliesCodeSource(cs32));
+        assertFalse(pe10.impliesCodeSource(cs33));
+
+        assertFalse(pe11.impliesCodeSource(null));
+        assertFalse(pe11.impliesCodeSource(cs10));
+        assertTrue (pe11.impliesCodeSource(cs11));
+        assertFalse(pe11.impliesCodeSource(cs12));
+        assertTrue (pe11.impliesCodeSource(cs13));
+        assertFalse(pe11.impliesCodeSource(cs20));
+        assertFalse(pe11.impliesCodeSource(cs21));
+        assertFalse(pe11.impliesCodeSource(cs22));
+        assertFalse(pe11.impliesCodeSource(cs23));
+        assertFalse(pe11.impliesCodeSource(cs30));
+        assertFalse(pe11.impliesCodeSource(cs31));
+        assertFalse(pe11.impliesCodeSource(cs32));
+        assertFalse(pe11.impliesCodeSource(cs33));
+
+        assertFalse(pe12.impliesCodeSource(null));
+        assertTrue (pe12.impliesCodeSource(cs10));
+        assertFalse(pe12.impliesCodeSource(cs11));
+        assertTrue (pe12.impliesCodeSource(cs12));
+        assertFalse(pe12.impliesCodeSource(cs13));
+        assertTrue (pe12.impliesCodeSource(cs20));
+        assertFalse(pe12.impliesCodeSource(cs21));
+        assertFalse(pe12.impliesCodeSource(cs22));
+        assertFalse(pe12.impliesCodeSource(cs23));
+        assertTrue (pe12.impliesCodeSource(cs30));
+        assertFalse(pe12.impliesCodeSource(cs31));
+        assertFalse(pe12.impliesCodeSource(cs32));
+        assertFalse(pe12.impliesCodeSource(cs33));
+
+        assertFalse(pe13.impliesCodeSource(null));
+        assertFalse(pe13.impliesCodeSource(cs10));
+        assertTrue (pe13.impliesCodeSource(cs11));
+        assertFalse(pe13.impliesCodeSource(cs12));
+        assertTrue (pe13.impliesCodeSource(cs13));
+        assertFalse(pe13.impliesCodeSource(cs20));
+        assertFalse(pe13.impliesCodeSource(cs21));
+        assertFalse(pe13.impliesCodeSource(cs22));
+        assertFalse(pe13.impliesCodeSource(cs23));
+        assertFalse(pe13.impliesCodeSource(cs30));
+        assertFalse(pe13.impliesCodeSource(cs31));
+        assertFalse(pe13.impliesCodeSource(cs32));
+        assertFalse(pe13.impliesCodeSource(cs33));
+
+        assertFalse(pe20.impliesCodeSource(null));
+        assertTrue (pe20.impliesCodeSource(cs10));
+        assertFalse(pe20.impliesCodeSource(cs11));
+        assertTrue (pe20.impliesCodeSource(cs12));
+        assertFalse(pe20.impliesCodeSource(cs13));
+        assertTrue (pe20.impliesCodeSource(cs20));
+        assertFalse(pe20.impliesCodeSource(cs21));
+        assertFalse(pe20.impliesCodeSource(cs22));
+        assertFalse(pe20.impliesCodeSource(cs23));
+        assertTrue (pe20.impliesCodeSource(cs30));
+        assertFalse(pe20.impliesCodeSource(cs31));
+        assertFalse(pe20.impliesCodeSource(cs32));
+        assertFalse(pe20.impliesCodeSource(cs33));
+
+        assertFalse(pe21.impliesCodeSource(null));
+        assertFalse(pe21.impliesCodeSource(cs10));
+        assertTrue (pe21.impliesCodeSource(cs11));
+        assertFalse(pe21.impliesCodeSource(cs12));
+        assertTrue (pe21.impliesCodeSource(cs13));
+        assertFalse(pe21.impliesCodeSource(cs20));
+        assertTrue (pe21.impliesCodeSource(cs21));
+        assertFalse(pe21.impliesCodeSource(cs22));
+        assertTrue (pe21.impliesCodeSource(cs23));
+        assertFalse(pe21.impliesCodeSource(cs30));
+        assertTrue (pe21.impliesCodeSource(cs31));
+        assertFalse(pe21.impliesCodeSource(cs32));
+        assertTrue (pe21.impliesCodeSource(cs33));
+
+        assertFalse(pe22.impliesCodeSource(null));
+        assertFalse(pe22.impliesCodeSource(cs10));
+        assertFalse(pe22.impliesCodeSource(cs11));
+        assertFalse(pe22.impliesCodeSource(cs12));
+        assertFalse(pe22.impliesCodeSource(cs13));
+        assertFalse(pe22.impliesCodeSource(cs20));
+        assertFalse(pe22.impliesCodeSource(cs21));
+        assertTrue (pe22.impliesCodeSource(cs22));
+        assertFalse(pe22.impliesCodeSource(cs23));
+        assertFalse(pe22.impliesCodeSource(cs30));
+        assertFalse(pe22.impliesCodeSource(cs31));
+        assertTrue (pe22.impliesCodeSource(cs32));
+        assertFalse(pe22.impliesCodeSource(cs33));
+
+        assertFalse(pe23.impliesCodeSource(null));
+        assertFalse(pe23.impliesCodeSource(cs10));
+        assertTrue (pe23.impliesCodeSource(cs11));
+        assertFalse(pe23.impliesCodeSource(cs12));
+        assertTrue (pe23.impliesCodeSource(cs13));
+        assertFalse(pe23.impliesCodeSource(cs20));
+        assertTrue (pe23.impliesCodeSource(cs21));
+        assertFalse(pe23.impliesCodeSource(cs22));
+        assertTrue (pe23.impliesCodeSource(cs23));
+        assertFalse(pe23.impliesCodeSource(cs30));
+        assertTrue (pe23.impliesCodeSource(cs31));
+        assertFalse(pe23.impliesCodeSource(cs32));
+        assertTrue (pe23.impliesCodeSource(cs33));
+
+        assertFalse(pe30.impliesCodeSource(null));
+        assertTrue (pe30.impliesCodeSource(cs10));
+        assertFalse(pe30.impliesCodeSource(cs11));
+        assertTrue (pe30.impliesCodeSource(cs12));
+        assertFalse(pe30.impliesCodeSource(cs13));
+        assertTrue (pe30.impliesCodeSource(cs20));
+        assertFalse(pe30.impliesCodeSource(cs21));
+        assertFalse(pe30.impliesCodeSource(cs22));
+        assertFalse(pe30.impliesCodeSource(cs23));
+        assertTrue (pe30.impliesCodeSource(cs30));
+        assertFalse(pe30.impliesCodeSource(cs31));
+        assertFalse(pe30.impliesCodeSource(cs32));
+        assertFalse(pe30.impliesCodeSource(cs33));
+
+        assertFalse(pe31.impliesCodeSource(null));
+        assertTrue (pe31.impliesCodeSource(cs10));
+        assertTrue (pe31.impliesCodeSource(cs11));
+        assertTrue (pe31.impliesCodeSource(cs12));
+        assertTrue (pe31.impliesCodeSource(cs13));
+        assertTrue (pe31.impliesCodeSource(cs20));
+        assertTrue (pe31.impliesCodeSource(cs21));
+        assertFalse(pe31.impliesCodeSource(cs22));
+        assertTrue (pe31.impliesCodeSource(cs23));
+        assertTrue (pe31.impliesCodeSource(cs30));
+        assertTrue (pe31.impliesCodeSource(cs31));
+        assertFalse(pe31.impliesCodeSource(cs32));
+        assertTrue (pe31.impliesCodeSource(cs33));
+
+        assertFalse(pe32.impliesCodeSource(null));
+        assertFalse(pe32.impliesCodeSource(cs10));
+        assertFalse(pe32.impliesCodeSource(cs11));
+        assertFalse(pe32.impliesCodeSource(cs12));
+        assertFalse(pe32.impliesCodeSource(cs13));
+        assertFalse(pe32.impliesCodeSource(cs20));
+        assertFalse(pe32.impliesCodeSource(cs21));
+        assertFalse(pe32.impliesCodeSource(cs22));
+        assertFalse(pe32.impliesCodeSource(cs23));
+        assertFalse(pe32.impliesCodeSource(cs30));
+        assertFalse(pe32.impliesCodeSource(cs31));
+        assertTrue (pe32.impliesCodeSource(cs32));
+        assertFalse(pe32.impliesCodeSource(cs33));
+
+        assertFalse(pe33.impliesCodeSource(null));
+        assertTrue (pe33.impliesCodeSource(cs10));
+        assertTrue (pe33.impliesCodeSource(cs11));
+        assertTrue (pe33.impliesCodeSource(cs12));
+        assertTrue (pe33.impliesCodeSource(cs13));
+        assertTrue (pe33.impliesCodeSource(cs20));
+        assertTrue (pe33.impliesCodeSource(cs21));
+        assertFalse(pe33.impliesCodeSource(cs22));
+        assertTrue (pe33.impliesCodeSource(cs23));
+        assertTrue (pe33.impliesCodeSource(cs30));
+        assertTrue (pe33.impliesCodeSource(cs31));
+        assertFalse(pe33.impliesCodeSource(cs32));
+        assertTrue (pe33.impliesCodeSource(cs33));
     }
 
     /**



Mime
View raw message