コード例 #1
0
  public void testInit_NoMetadataKey() throws Exception {
    XpathQueryImpl query = (XpathQueryImpl) create();
    try {
      query.verify();
      fail();
    } catch (CoreException expected) {

    }
  }
コード例 #2
0
 public void testSetAllowNullResults() throws Exception {
   XpathQueryImpl query = (XpathQueryImpl) create();
   assertNull(query.getAllowEmptyResults());
   assertFalse(query.allowEmptyResults());
   query.setAllowEmptyResults(Boolean.FALSE);
   assertNotNull(query.getAllowEmptyResults());
   assertEquals(Boolean.FALSE, query.getAllowEmptyResults());
   assertFalse(query.allowEmptyResults());
   query.setAllowEmptyResults(null);
   assertFalse(query.allowEmptyResults());
   assertNull(query.getAllowEmptyResults());
 }
コード例 #3
0
  public void testSetMetadataKey() throws Exception {
    XpathQueryImpl query = (XpathQueryImpl) create();
    assertNull(query.getMetadataKey());
    query.setMetadataKey("key");
    assertEquals("key", query.getMetadataKey());
    try {
      query.setMetadataKey("");
      fail();
    } catch (IllegalArgumentException expected) {

    }
    assertEquals("key", query.getMetadataKey());
    try {
      query.setMetadataKey(null);
      fail();
    } catch (IllegalArgumentException expected) {

    }
    assertEquals("key", query.getMetadataKey());
  }