예제 #1
0
  @Before
  public void clearGrammarCache() {
    LOG.info("Clearing grammar cache");
    ResourceSet results = null;
    try {
      results = executeQuery("validation:clear-grammar-cache()");
      String r = (String) results.getResource(0).getContent();
      System.out.println(r);

    } catch (Exception e) {
      LOG.error(e);
      e.printStackTrace();
      fail(e.getMessage());
    }
  }
예제 #2
0
  private void executeAndEvaluate(String query, String expectedValue) {

    LOG.info("Query=" + query);
    LOG.info("ExpectedValue=" + query);

    try {
      ResourceSet results = executeQuery(query);
      assertEquals(1, results.getSize());

      String r = (String) results.getResource(0).getContent();
      LOG.info(r);

      assertXpathEvaluatesTo(expectedValue, "//status/text()", r);

    } catch (Exception ex) {
      LOG.error(ex);
      fail(ex.getMessage());
    }
  }