Package com.getperka.flatpack.policy.pst

Examples of com.getperka.flatpack.policy.pst.PolicyFile.toSource()


          return false;
        }
      });

      try {
        doTest(policyFile.toSource());
      } catch (IllegalArgumentException e) {
        System.err.println(i + " Failing source:\n" + policyFile.toSource());
        throw e;
      }
    }
View Full Code Here


      });

      try {
        doTest(policyFile.toSource());
      } catch (IllegalArgumentException e) {
        System.err.println(i + " Failing source:\n" + policyFile.toSource());
        throw e;
      }
    }
  }
View Full Code Here

  public void test() throws IOException {
    String contents = FileUtils.readAllText(getClass().getResourceAsStream("test.policy"));
    PolicyFile p = (PolicyFile) testRule(parser.PolicyFile(), contents);

    // Test print-parse-print to make sure nothing is getting lost
    String string = p.toSource();
    PolicyFile p2 = (PolicyFile) testRule(parser.PolicyFile(), string);
    assertEquals(string, p2.toSource());
  }

  @Test
View Full Code Here

    PolicyFile p = (PolicyFile) testRule(parser.PolicyFile(), contents);

    // Test print-parse-print to make sure nothing is getting lost
    String string = p.toSource();
    PolicyFile p2 = (PolicyFile) testRule(parser.PolicyFile(), string);
    assertEquals(string, p2.toSource());
  }

  @Test
  public void testCloner() throws IOException {
    String contents = FileUtils.readAllText(getClass().getResourceAsStream("test.policy"));
View Full Code Here

  public void testCloner() throws IOException {
    String contents = FileUtils.readAllText(getClass().getResourceAsStream("test.policy"));
    PolicyFile p = (PolicyFile) testRule(parser.PolicyFile(), contents);
    PolicyFile p2 = new PolicyCloner().clone(p);

    assertEquals(p.toSource(), p2.toSource());
  }

  private void checkResult(ParsingResult<Object> res) {
    if (res.parseErrors.isEmpty()) {
      assertTrue(res.matched);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.