ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/i-scream/experimental/server/ACL/ACLTest.java
(Generate patch)

Comparing experimental/server/ACL/ACLTest.java (file contents):
Revision 1.3 by tdb, Sun Dec 23 00:29:33 2001 UTC vs.
Revision 1.6 by tdb, Mon Dec 31 02:57:00 2001 UTC

# Line 9 | Line 9 | class ACLTest {
9          
10          // add some test rules
11          acl.add(ACL.ALLOW, "*.ukc.ac.uk");
12 <        acl.add(ACL.ALLOW, "129.12.*");
12 >        acl.add(ACL.ALLOW, "129.12.*.*");
13          acl.add(ACL.ALLOW, "*.bishnet.net");
14          acl.add(ACL.ALLOW, "192.168.*");
15 +        acl.add(ACL.ALLOW, "192.168.*.*");
16 +        acl.add(ACL.ALLOW, "one.two.three.four.five.six.*");
17 +        acl.add(ACL.ALLOW, "192.129.12.*.*");
18 +        acl.add(ACL.ALLOW, "129.12.*");
19 +        acl.add(ACL.ALLOW, "129.12.4");
20 +        acl.add(ACL.ALLOW, "129.*");
21 +        acl.add(ACL.ALLOW, "129*");
22 +        acl.add(ACL.ALLOW, "*");
23 +        acl.add(ACL.ALLOW, "");
24          // not really needed if we default to deny :)
25          //acl.add(ACL.DENY, "*");
26          
27          // dump our ACL to the console before serialization
28 <        System.out.println("BEFORE: "+acl.getStringACL());
28 >        System.out.println("BEFORE: " + acl);
29          
30          // name for our serialized ACL
31          String aclFilename = "aclfile";
# Line 47 | Line 56 | class ACLTest {
56          }
57          
58          // dump our ACL to the console after serialization
59 <        System.out.println("AFTER: "+acl.getStringACL());
59 >        System.out.println("AFTER: " + acl);
60          
61          // run a few tests
62          System.out.println("killigrew.ukc.ac.uk: " + acl.check("killigrew.ukc.ac.uk"));
# Line 56 | Line 65 | class ACLTest {
65          System.out.println("192.168.1.1: " + acl.check("192.168.1.1"));
66          
67          // setup an ACLServerSocket putting our ACL in
68 +        // and an ACLDatagramSocket (which we'll test better later)
69          ACLServerSocket ss = null;
70 +        ACLDatagramSocket ds = null;
71          try {
72              ss = new ACLServerSocket(acl, 1337);
73 +            ds = new ACLDatagramSocket(acl, 1337);
74          }
75          catch(IOException e) {
76              System.out.println("exception: " + e);
77              e.printStackTrace();
78              System.exit(1);
79          }
80 +        
81 +        System.out.println(ss);
82 +        System.out.println(ds);
83          
84          // start listening
85          // valid connections (allowed by ACL) will get a message sent back

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines