示例#1
0
  @Test
  public void testNullSingleValueWithDefaultToIgnore() throws Throwable {
    Map<String, RequestProperty> props = collectContent(p("./param@DefaultValue", ":ignore"));

    assertEquals(1, props.size());
    RequestProperty prop = props.get("/test/path/param");
    assertFalse(prop.hasValues());
  }
示例#2
0
  @Test
  public void testMultiValueWithAllBlanksIgnoringBlanks() throws Throwable {
    Map<String, RequestProperty> props =
        collectContent(p("./param", "", "", ""), p("./param@IgnoreBlanks", "true"));

    assertEquals(1, props.size());
    RequestProperty prop = props.get("/test/path/param");
    assertFalse(prop.hasValues());
  }
示例#3
0
  @Test
  public void testSingleValueWithDefaultToNull() throws Throwable {
    Map<String, RequestProperty> props =
        collectContent(p("./param", ""), p("./param@DefaultValue", ":null"));

    assertEquals(1, props.size());
    RequestProperty prop = props.get("/test/path/param");
    assertTrue(prop.hasValues());
    assertTrue(prop.providesValue());
    assertNull(prop.getStringValues());
  }
示例#4
0
  @Test
  public void testSingleValueWithBlank() throws Throwable {
    Map<String, RequestProperty> props = collectContent(p("./param", ""));

    assertEquals(1, props.size());
    RequestProperty prop = props.get("/test/path/param");
    assertTrue(prop.hasValues());
    assertFalse(prop.providesValue());
    assertEquals(1, prop.getStringValues().length);
    assertEquals("", prop.getStringValues()[0]);
  }
示例#5
0
  @Test
  public void testMultiValue() throws Throwable {
    Map<String, RequestProperty> props = collectContent(p("./param", "true", "false"));

    assertEquals(1, props.size());
    RequestProperty prop = props.get("/test/path/param");
    assertTrue(prop.hasValues());
    assertTrue(prop.providesValue());
    assertEquals(2, prop.getStringValues().length);
    assertEquals("true", prop.getStringValues()[0]);
    assertEquals("false", prop.getStringValues()[1]);
  }