Ejemplo n.º 1
0
  @Test
  public void parseAttributes() {
    final InputTypeConfig config = build("attributes.xml");
    assertNotNull(config);
    assertEquals(2, config.getSize());

    assertEquals("other=world[a=1],other=world[a=1,b=2]", toString(config.getProperties("other")));
  }
Ejemplo n.º 2
0
  @Test
  public void parseSimple() {
    final InputTypeConfig config = build("simple.xml");
    assertNotNull(config);
    assertEquals(2, config.getSize());

    assertEquals("timezone=true[]", toString(config.getProperties("timezone")));
    assertEquals("other=world[]", toString(config.getProperties("other")));
  }
Ejemplo n.º 3
0
  @Test
  public void parseEmpty() {
    final InputTypeConfig config = build("empty.xml");
    assertNotNull(config);
    assertEquals(2, config.getSize());

    assertEquals("contentType=[]", toString(config.getProperties("contentType")));
    assertEquals("other=[contentType=]", toString(config.getProperties("other")));
  }
Ejemplo n.º 4
0
  @Test
  public void parseAliased() {
    final InputTypeConfig config = build("aliased.xml", InputTypeName.CONTENT_SELECTOR);
    assertNotNull(config);
    assertEquals(2, config.getSize());

    assertEquals(
        "allowContentType=myapp:contentTypeTest[]",
        toString(config.getProperties("allowContentType")));
    assertEquals(
        "relationshipType=myapp:relationshipTypeTest[]",
        toString(config.getProperties("relationshipType")));
  }
Ejemplo n.º 5
0
  @Test
  public void parseResolve() {
    final InputTypeConfig config = build("resolve.xml");
    assertNotNull(config);
    assertEquals(12, config.getSize());

    assertEquals("contentType=myapp:test[]", toString(config.getProperties("contentType")));
    assertEquals("myContentType=myapp:test[]", toString(config.getProperties("myContentType")));

    assertEquals("mixinType=myapp:test[]", toString(config.getProperties("mixinType")));
    assertEquals("myMixinType=myapp:test[]", toString(config.getProperties("myMixinType")));

    assertEquals(
        "relationshipType=myapp:test[]", toString(config.getProperties("relationshipType")));
    assertEquals(
        "myRelationshipType=myapp:test[]", toString(config.getProperties("myRelationshipType")));

    assertEquals("other1=[mixinType=myapp:test]", toString(config.getProperties("other1")));
    assertEquals("other2=[contentType=myapp:test]", toString(config.getProperties("other2")));
    assertEquals("other3=[relationshipType=myapp:test]", toString(config.getProperties("other3")));
    assertEquals("other4=[myMixinType=myapp:test]", toString(config.getProperties("other4")));
    assertEquals("other5=[myContentType=myapp:test]", toString(config.getProperties("other5")));
    assertEquals(
        "other6=[myRelationshipType=myapp:test]", toString(config.getProperties("other6")));
  }
Ejemplo n.º 6
0
 @Test
 public void parseNone() {
   final InputTypeConfig config = build("none.xml");
   assertNotNull(config);
   assertEquals(0, config.getSize());
 }
Ejemplo n.º 7
0
  @Test
  public void parseCamelCase() {
    System.out.println(CaseFormat.LOWER_HYPHEN.to(CaseFormat.LOWER_CAMEL, "other-test"));

    final InputTypeConfig config = build("camelcase.xml");
    assertNotNull(config);
    assertEquals(12, config.getSize());

    assertEquals("contentType=myapp:test[]", toString(config.getProperties("contentType")));
    assertEquals("myContentType=myapp:test[]", toString(config.getProperties("myContentType")));

    assertEquals("mixinType=myapp:test[]", toString(config.getProperties("mixinType")));
    assertEquals("myMixinType=myapp:test[]", toString(config.getProperties("myMixinType")));

    assertEquals(
        "relationshipType=myapp:test[]", toString(config.getProperties("relationshipType")));
    assertEquals(
        "myRelationshipType=myapp:test[]", toString(config.getProperties("myRelationshipType")));

    assertEquals("other1=[mixinType=myapp:test]", toString(config.getProperties("other1")));
    assertEquals("other2=[contentType=myapp:test]", toString(config.getProperties("other2")));
    assertEquals("other3=[relationshipType=myapp:test]", toString(config.getProperties("other3")));
    assertEquals("other4=[myMixinType=myapp:test]", toString(config.getProperties("other4")));
    assertEquals("other5=[myContentType=myapp:test]", toString(config.getProperties("other5")));
    assertEquals(
        "other6=[myRelationshipType=myapp:test]", toString(config.getProperties("other6")));
  }