Ejemplo n.º 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());
  }
Ejemplo n.º 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());
  }
Ejemplo n.º 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());
  }
Ejemplo n.º 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]);
  }
Ejemplo n.º 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]);
  }