예제 #1
0
  @BeforeClass
  public static void setUpBeforeClass() throws Exception {
    Log4J.init();

    MockStendhalRPRuleProcessor.get();

    MockStendlRPWorld.reset();
    MockStendlRPWorld.get();
  }
예제 #2
0
  /**
   * Test the validation method
   *
   * @throws ParserConfigurationException in case of an invalid zone file
   * @throws SAXException in case of an invalid zone file
   * @throws IOException in case of an input/output error
   */
  @Test
  public void testvalidate() throws ParserConfigurationException, SAXException, IOException {
    Log4J.init();
    final PortalMatchTest pmt = new PortalMatchTest();
    LinkedList<PortalTestObject> portals = new LinkedList<PortalTestObject>();
    final DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance();
    final DocumentBuilder docBuilder = docBuilderFactory.newDocumentBuilder();
    Document xmldoc = docBuilder.parse(new File("tests/conf/valid.xml"));

    portals.addAll(pmt.proceedDocument(xmldoc));
    assertThat("all portals in this test file are valid", pmt.isValid(portals), equalTo(""));
    portals = new LinkedList<PortalTestObject>();
    xmldoc = docBuilder.parse(new File("tests/conf/invalid.xml"));
    portals.addAll(pmt.proceedDocument(xmldoc));
    assertThat("there is a known bad in it", pmt.isValid(portals), not(equalTo("")));
  }
 @BeforeClass
 public static void setUpBeforeClass() throws Exception {
   Log4J.init();
   MockStendlRPWorld.get();
   ItemTestHelper.generateRPClasses();
 }