示例#1
0
  public void testSetters() {
    QueryElement q = new QueryElement("role", "value");

    assertEquals("role", q.getRole());
    q.setRole("newRole");
    assertEquals("newRole", q.getRole());
    q.setRole(null);
    assertEquals("UNKNOWN", q.getRole());

    assertEquals("value", q.getValue());
    q.setValue("newValue");
    assertEquals("newValue", q.getValue());
    q.setValue(null);
    assertEquals("UNKNOWN", q.getValue());
  }
示例#2
0
 public void testCtor() {
   QueryElement full = new QueryElement("role", "value");
   assertEquals("role", full.getRole());
   assertEquals("value", full.getValue());
 }
示例#3
0
 public void testNoArgsCtor() {
   QueryElement blank = new QueryElement();
   assertEquals("UNKNOWN", blank.getRole());
   assertEquals("UNKNOWN", blank.getValue());
 }