* @version $Rev: 46019 $ $Date: 2004-09-14 03:56:06 -0600 (Tue, 14 Sep 2004) $
*/
public class EJBMethodPermissionCollectionTest extends TestCase {
public void testWildCards() {
PermissionCollection collection = new EJBMethodPermission("HelloWorld", "").newPermissionCollection();
collection.add(new EJBMethodPermission("HelloWorld", ""));
assertTrue(collection.implies(new EJBMethodPermission("HelloWorld", "")));
assertTrue(collection.implies(new EJBMethodPermission("HelloWorld", ",,a,b,c")));
assertTrue(collection.implies(new EJBMethodPermission("HelloWorld", ",,")));
assertTrue(collection.implies(new EJBMethodPermission("HelloWorld", ",Local")));
assertTrue(collection.implies(new EJBMethodPermission("HelloWorld", ",Local,a,b,c")));
assertTrue(collection.implies(new EJBMethodPermission("HelloWorld", ",Local,")));
assertTrue(collection.implies(new EJBMethodPermission("HelloWorld", "hello")));
assertTrue(collection.implies(new EJBMethodPermission("HelloWorld", "hello,,a,b,c")));
assertTrue(collection.implies(new EJBMethodPermission("HelloWorld", "hello,,")));
assertTrue(collection.implies(new EJBMethodPermission("HelloWorld", "hello,Local")));
assertTrue(collection.implies(new EJBMethodPermission("HelloWorld", "hello,Local,a,b,c")));
assertTrue(collection.implies(new EJBMethodPermission("HelloWorld", "hello,Local,")));
assertFalse(collection.implies(new EJBMethodPermission("GoodbyeWorld", "")));
collection = new EJBMethodPermission("HelloWorld", "").newPermissionCollection();
collection.add(new EJBMethodPermission("HelloWorld", ",,a,b,c"));
assertFalse(collection.implies(new EJBMethodPermission("HelloWorld", "")));
assertTrue(collection.implies(new EJBMethodPermission("HelloWorld", ",,a,b,c")));
assertFalse(collection.implies(new EJBMethodPermission("HelloWorld", ",,")));
assertFalse(collection.implies(new EJBMethodPermission("HelloWorld", ",Local")));
assertTrue(collection.implies(new EJBMethodPermission("HelloWorld", ",Local,a,b,c")));
assertFalse(collection.implies(new EJBMethodPermission("HelloWorld", ",Local,")));
assertFalse(collection.implies(new EJBMethodPermission("HelloWorld", "hello")));
assertTrue(collection.implies(new EJBMethodPermission("HelloWorld", "hello,,a,b,c")));
assertFalse(collection.implies(new EJBMethodPermission("HelloWorld", "hello,,")));
assertFalse(collection.implies(new EJBMethodPermission("HelloWorld", "hello,Local")));
assertTrue(collection.implies(new EJBMethodPermission("HelloWorld", "hello,Local,a,b,c")));
assertFalse(collection.implies(new EJBMethodPermission("HelloWorld", "hello,Local,")));
assertFalse(collection.implies(new EJBMethodPermission("GoodbyeWorld", ",,a,b,c")));
collection = new EJBMethodPermission("HelloWorld", "").newPermissionCollection();
collection.add(new EJBMethodPermission("HelloWorld", ",,"));
assertFalse(collection.implies(new EJBMethodPermission("HelloWorld", "")));
assertFalse(collection.implies(new EJBMethodPermission("HelloWorld", ",,a,b,c")));
assertTrue(collection.implies(new EJBMethodPermission("HelloWorld", ",,")));
assertFalse(collection.implies(new EJBMethodPermission("HelloWorld", ",Local")));
assertFalse(collection.implies(new EJBMethodPermission("HelloWorld", ",Local,a,b,c")));
assertTrue(collection.implies(new EJBMethodPermission("HelloWorld", ",Local,")));
assertFalse(collection.implies(new EJBMethodPermission("HelloWorld", "hello")));
assertFalse(collection.implies(new EJBMethodPermission("HelloWorld", "hello,,a,b,c")));
assertTrue(collection.implies(new EJBMethodPermission("HelloWorld", "hello,,")));
assertFalse(collection.implies(new EJBMethodPermission("HelloWorld", "hello,Local")));
assertFalse(collection.implies(new EJBMethodPermission("HelloWorld", "hello,Local,a,b,c")));
assertTrue(collection.implies(new EJBMethodPermission("HelloWorld", "hello,Local,")));
assertFalse(collection.implies(new EJBMethodPermission("GoodbyeWorld", ",,")));
collection = new EJBMethodPermission("HelloWorld", "").newPermissionCollection();
collection.add(new EJBMethodPermission("HelloWorld", ",Local"));
assertFalse(collection.implies(new EJBMethodPermission("HelloWorld", "")));
assertFalse(collection.implies(new EJBMethodPermission("HelloWorld", ",,a,b,c")));
assertFalse(collection.implies(new EJBMethodPermission("HelloWorld", ",,")));
assertTrue(collection.implies(new EJBMethodPermission("HelloWorld", ",Local")));
assertTrue(collection.implies(new EJBMethodPermission("HelloWorld", ",Local,a,b,c")));
assertTrue(collection.implies(new EJBMethodPermission("HelloWorld", ",Local,")));
assertFalse(collection.implies(new EJBMethodPermission("HelloWorld", "hello")));
assertFalse(collection.implies(new EJBMethodPermission("HelloWorld", "hello,,a,b,c")));
assertFalse(collection.implies(new EJBMethodPermission("HelloWorld", "hello,,")));
assertTrue(collection.implies(new EJBMethodPermission("HelloWorld", "hello,Local")));
assertTrue(collection.implies(new EJBMethodPermission("HelloWorld", "hello,Local,a,b,c")));
assertTrue(collection.implies(new EJBMethodPermission("HelloWorld", "hello,Local,")));
assertFalse(collection.implies(new EJBMethodPermission("GoodbyeWorld", ",Local")));
collection = new EJBMethodPermission("HelloWorld", "").newPermissionCollection();
collection.add(new EJBMethodPermission("HelloWorld", ",Local,a,b,c"));
assertFalse(collection.implies(new EJBMethodPermission("HelloWorld", "")));
assertFalse(collection.implies(new EJBMethodPermission("HelloWorld", ",,a,b,c")));
assertFalse(collection.implies(new EJBMethodPermission("HelloWorld", ",,")));
assertFalse(collection.implies(new EJBMethodPermission("HelloWorld", ",Local")));
assertTrue(collection.implies(new EJBMethodPermission("HelloWorld", ",Local,a,b,c")));
assertFalse(collection.implies(new EJBMethodPermission("HelloWorld", ",Local,")));
assertFalse(collection.implies(new EJBMethodPermission("HelloWorld", "hello")));
assertFalse(collection.implies(new EJBMethodPermission("HelloWorld", "hello,,a,b,c")));
assertFalse(collection.implies(new EJBMethodPermission("HelloWorld", "hello,,")));
assertFalse(collection.implies(new EJBMethodPermission("HelloWorld", "hello,Local")));
assertTrue(collection.implies(new EJBMethodPermission("HelloWorld", "hello,Local,a,b,c")));
assertFalse(collection.implies(new EJBMethodPermission("HelloWorld", "hello,Local,")));
assertFalse(collection.implies(new EJBMethodPermission("GoodbyeWorld", ",Local,a,b,c")));
collection = new EJBMethodPermission("HelloWorld", "").newPermissionCollection();
collection.add(new EJBMethodPermission("HelloWorld", ",Local,"));
assertFalse(collection.implies(new EJBMethodPermission("HelloWorld", "")));
assertFalse(collection.implies(new EJBMethodPermission("HelloWorld", ",,a,b,c")));
assertFalse(collection.implies(new EJBMethodPermission("HelloWorld", ",,")));
assertFalse(collection.implies(new EJBMethodPermission("HelloWorld", ",Local")));
assertFalse(collection.implies(new EJBMethodPermission("HelloWorld", ",Local,a,b,c")));
assertTrue(collection.implies(new EJBMethodPermission("HelloWorld", ",Local,")));
assertFalse(collection.implies(new EJBMethodPermission("HelloWorld", "hello")));
assertFalse(collection.implies(new EJBMethodPermission("HelloWorld", "hello,,a,b,c")));
assertFalse(collection.implies(new EJBMethodPermission("HelloWorld", "hello,,")));
assertFalse(collection.implies(new EJBMethodPermission("HelloWorld", "hello,Local")));
assertFalse(collection.implies(new EJBMethodPermission("HelloWorld", "hello,Local,a,b,c")));
assertTrue(collection.implies(new EJBMethodPermission("HelloWorld", "hello,Local,")));
assertFalse(collection.implies(new EJBMethodPermission("GoodbyeWorld", ",Local,")));
collection = new EJBMethodPermission("HelloWorld", "").newPermissionCollection();
collection.add(new EJBMethodPermission("HelloWorld", "hello"));
assertFalse(collection.implies(new EJBMethodPermission("HelloWorld", "")));
assertFalse(collection.implies(new EJBMethodPermission("HelloWorld", ",,a,b,c")));
assertFalse(collection.implies(new EJBMethodPermission("HelloWorld", ",,")));
assertFalse(collection.implies(new EJBMethodPermission("HelloWorld", ",Local")));
assertFalse(collection.implies(new EJBMethodPermission("HelloWorld", ",Local,a,b,c")));
assertFalse(collection.implies(new EJBMethodPermission("HelloWorld", ",Local,")));
assertTrue(collection.implies(new EJBMethodPermission("HelloWorld", "hello")));
assertTrue(collection.implies(new EJBMethodPermission("HelloWorld", "hello,,a,b,c")));
assertTrue(collection.implies(new EJBMethodPermission("HelloWorld", "hello,,")));
assertTrue(collection.implies(new EJBMethodPermission("HelloWorld", "hello,Local")));
assertTrue(collection.implies(new EJBMethodPermission("HelloWorld", "hello,Local,a,b,c")));
assertTrue(collection.implies(new EJBMethodPermission("HelloWorld", "hello,Local,")));
assertFalse(collection.implies(new EJBMethodPermission("GoodbyeWorld", "hello")));
collection = new EJBMethodPermission("HelloWorld", "").newPermissionCollection();
collection.add(new EJBMethodPermission("HelloWorld", "hello,,a,b,c"));
assertFalse(collection.implies(new EJBMethodPermission("HelloWorld", "")));
assertFalse(collection.implies(new EJBMethodPermission("HelloWorld", ",,a,b,c")));
assertFalse(collection.implies(new EJBMethodPermission("HelloWorld", ",,")));
assertFalse(collection.implies(new EJBMethodPermission("HelloWorld", ",Local")));
assertFalse(collection.implies(new EJBMethodPermission("HelloWorld", ",Local,a,b,c")));
assertFalse(collection.implies(new EJBMethodPermission("HelloWorld", ",Local,")));
assertFalse(collection.implies(new EJBMethodPermission("HelloWorld", "hello")));
assertTrue(collection.implies(new EJBMethodPermission("HelloWorld", "hello,,a,b,c")));
assertFalse(collection.implies(new EJBMethodPermission("HelloWorld", "hello,,")));
assertFalse(collection.implies(new EJBMethodPermission("HelloWorld", "hello,Local")));
assertTrue(collection.implies(new EJBMethodPermission("HelloWorld", "hello,Local,a,b,c")));
assertFalse(collection.implies(new EJBMethodPermission("HelloWorld", "hello,Local,")));
assertFalse(collection.implies(new EJBMethodPermission("GoodbyeWorld", "hello,,a,b,c")));
collection = new EJBMethodPermission("HelloWorld", "").newPermissionCollection();
collection.add(new EJBMethodPermission("HelloWorld", "hello,,"));
assertFalse(collection.implies(new EJBMethodPermission("HelloWorld", "")));
assertFalse(collection.implies(new EJBMethodPermission("HelloWorld", ",,a,b,c")));
assertFalse(collection.implies(new EJBMethodPermission("HelloWorld", ",,")));
assertFalse(collection.implies(new EJBMethodPermission("HelloWorld", ",Local")));
assertFalse(collection.implies(new EJBMethodPermission("HelloWorld", ",Local,a,b,c")));
assertFalse(collection.implies(new EJBMethodPermission("HelloWorld", ",Local,")));
assertFalse(collection.implies(new EJBMethodPermission("HelloWorld", "hello")));
assertFalse(collection.implies(new EJBMethodPermission("HelloWorld", "hello,,a,b,c")));
assertTrue(collection.implies(new EJBMethodPermission("HelloWorld", "hello,,")));
assertFalse(collection.implies(new EJBMethodPermission("HelloWorld", "hello,Local")));
assertFalse(collection.implies(new EJBMethodPermission("HelloWorld", "hello,Local,a,b,c")));
assertTrue(collection.implies(new EJBMethodPermission("HelloWorld", "hello,Local,")));
assertFalse(collection.implies(new EJBMethodPermission("GoodbyeWorld", "hello,,")));
collection = new EJBMethodPermission("HelloWorld", "").newPermissionCollection();
collection.add(new EJBMethodPermission("HelloWorld", "hello,Local"));
assertFalse(collection.implies(new EJBMethodPermission("HelloWorld", "")));
assertFalse(collection.implies(new EJBMethodPermission("HelloWorld", ",,a,b,c")));
assertFalse(collection.implies(new EJBMethodPermission("HelloWorld", ",,")));
assertFalse(collection.implies(new EJBMethodPermission("HelloWorld", ",Local")));
assertFalse(collection.implies(new EJBMethodPermission("HelloWorld", ",Local,a,b,c")));
assertFalse(collection.implies(new EJBMethodPermission("HelloWorld", ",Local,")));
assertFalse(collection.implies(new EJBMethodPermission("HelloWorld", "hello")));
assertFalse(collection.implies(new EJBMethodPermission("HelloWorld", "hello,,a,b,c")));
assertFalse(collection.implies(new EJBMethodPermission("HelloWorld", "hello,,")));
assertTrue(collection.implies(new EJBMethodPermission("HelloWorld", "hello,Local")));
assertTrue(collection.implies(new EJBMethodPermission("HelloWorld", "hello,Local,a,b,c")));
assertTrue(collection.implies(new EJBMethodPermission("HelloWorld", "hello,Local,")));
assertFalse(collection.implies(new EJBMethodPermission("GoodbyeWorld", "hello,Local")));
collection = new EJBMethodPermission("HelloWorld", "").newPermissionCollection();
collection.add(new EJBMethodPermission("HelloWorld", "hello,Local,a,b,c"));
assertFalse(collection.implies(new EJBMethodPermission("HelloWorld", "")));
assertFalse(collection.implies(new EJBMethodPermission("HelloWorld", ",,a,b,c")));
assertFalse(collection.implies(new EJBMethodPermission("HelloWorld", ",,")));
assertFalse(collection.implies(new EJBMethodPermission("HelloWorld", ",Local")));
assertFalse(collection.implies(new EJBMethodPermission("HelloWorld", ",Local,a,b,c")));
assertFalse(collection.implies(new EJBMethodPermission("HelloWorld", ",Local,")));
assertFalse(collection.implies(new EJBMethodPermission("HelloWorld", "hello")));
assertFalse(collection.implies(new EJBMethodPermission("HelloWorld", "hello,,a,b,c")));
assertFalse(collection.implies(new EJBMethodPermission("HelloWorld", "hello,,")));
assertFalse(collection.implies(new EJBMethodPermission("HelloWorld", "hello,Local")));
assertTrue(collection.implies(new EJBMethodPermission("HelloWorld", "hello,Local,a,b,c")));
assertFalse(collection.implies(new EJBMethodPermission("HelloWorld", "hello,Local,")));
assertFalse(collection.implies(new EJBMethodPermission("GoodbyeWorld", "hello,Local,a,b,c")));
collection = new EJBMethodPermission("HelloWorld", "").newPermissionCollection();
collection.add(new EJBMethodPermission("HelloWorld", "hello,Local,"));
assertFalse(collection.implies(new EJBMethodPermission("HelloWorld", "")));
assertFalse(collection.implies(new EJBMethodPermission("HelloWorld", ",,a,b,c")));
assertFalse(collection.implies(new EJBMethodPermission("HelloWorld", ",,")));
assertFalse(collection.implies(new EJBMethodPermission("HelloWorld", ",Local")));
assertFalse(collection.implies(new EJBMethodPermission("HelloWorld", ",Local,a,b,c")));
assertFalse(collection.implies(new EJBMethodPermission("HelloWorld", ",Local,")));
assertFalse(collection.implies(new EJBMethodPermission("HelloWorld", "hello")));
assertFalse(collection.implies(new EJBMethodPermission("HelloWorld", "hello,,a,b,c")));
assertFalse(collection.implies(new EJBMethodPermission("HelloWorld", "hello,,")));
assertFalse(collection.implies(new EJBMethodPermission("HelloWorld", "hello,Local")));
assertFalse(collection.implies(new EJBMethodPermission("HelloWorld", "hello,Local,a,b,c")));
assertTrue(collection.implies(new EJBMethodPermission("HelloWorld", "hello,Local,")));
assertFalse(collection.implies(new EJBMethodPermission("GoodbyeWorld", "hello,Local,")));
}