Package org.jwall.rbl.dns

Examples of org.jwall.rbl.dns.RblSecurityManager


  @Test
  public void test() {

    try {
      RblSecurityManager sec = RblSecurityManager.getInstance();

      URL url = RblSecurityManagerTest.class
          .getResource("/test.permissions");
      log.info("Reading permissions from {}", url);
      sec.readPermissions(url.openStream());

      InetAddress addr = InetAddress.getByName("::1");
      log.info("Checking permissions for address '{}'", addr);
      Assert.assertTrue(sec.hasPermission(addr,
          RblSecurityManager.BLOCK_PERMISSION));

      addr = InetAddress.getByName("127.0.0.1");
      log.info("Checking permissions for address '{}'", addr);
      Assert.assertTrue(sec.hasPermission(addr,
          RblSecurityManager.BLOCK_PERMISSION));

    } catch (Exception e) {
      e.printStackTrace();
      Assert.fail("Error: " + e.getMessage());
View Full Code Here

TOP

Related Classes of org.jwall.rbl.dns.RblSecurityManager

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.