Exemplo n.º 1
0
 @Test
 public void readConstraints() throws Exception {
   final Map<String, List<String>> constraintsByType =
       customModelParser.getConstraintsByMetadata();
   assertThat(
       constraintsByType,
       hasEntry(equalTo("bazTextWithContraints"), hasItems("foo", "bar", "baz")));
 }
Exemplo n.º 2
0
  @Test
  public void readAspectsByType() throws Exception {
    final Map<String, List<String>> aspectsByType = customModelParser.getAspectsByType();

    final Collection<String> types = aspectsByType.keySet();
    assertThat(types, hasItem("CMDBuild SuperType"));
    assertThat(types, hasItem("A type"));
    assertThat(types, hasItem("Another type"));
    assertThat(types, hasItem("Document"));
    assertThat(types, hasItem("Image"));

    assertThat(aspectsByType.get("A type"), hasItem("foo"));
    assertThat(aspectsByType.get("A type"), hasItem("bar"));
    assertThat(aspectsByType.get("Another type"), hasItem("baz"));
    assertThat(
        aspectsByType.get("Document"), hasItems("documentStatistics", "taggable", "summary"));
    assertThat(aspectsByType.get("Document"), hasItem("summary"));
    assertThat(aspectsByType.get("Image"), hasItem("displayable"));
  }