/**
* Null CodeSource of PolicyEntry implies any CodeSource; non-null
* 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)));
}