@Test
  public void testProjectDMOAnnotationAttributes2() throws Exception {
    final ProjectDataModelOracleBuilder builder =
        ProjectDataModelOracleBuilder.newProjectOracleBuilder();
    final ProjectDataModelOracleImpl oracle = new ProjectDataModelOracleImpl();

    final ClassFactBuilder cb =
        new ClassFactBuilder(builder, RoleSmurf.class, false, TypeSource.JAVA_PROJECT);
    cb.build(oracle);

    assertEquals(1, oracle.getProjectModelFields().size());
    assertContains(
        "org.kie.workbench.common.services.datamodel.backend.server.testclasses.annotations.RoleSmurf",
        oracle.getProjectModelFields().keySet());

    final Set<Annotation> annotations =
        oracle
            .getProjectTypeAnnotations()
            .get(
                "org.kie.workbench.common.services.datamodel.backend.server.testclasses.annotations.RoleSmurf");
    assertNotNull(annotations);
    assertEquals(1, annotations.size());

    final Annotation annotation = annotations.iterator().next();
    assertEquals("org.kie.api.definition.type.Role", annotation.getQualifiedTypeName());
    assertEquals(Role.Type.EVENT.name(), annotation.getAttributes().get("value"));
  }
 private void loadEnums() {
   final Map<String, String[]> loadableEnums = new HashMap<String, String[]>();
   for (Map.Entry<String, String[]> e : factFieldEnums.entrySet()) {
     final String qualifiedFactField = e.getKey();
     loadableEnums.put(qualifiedFactField, e.getValue());
   }
   oracle.addProjectJavaEnumDefinitions(loadableEnums);
 }
  @Test
  public void testProjectDMOZeroAnnotationAttributes() throws Exception {
    final ProjectDataModelOracleBuilder builder =
        ProjectDataModelOracleBuilder.newProjectOracleBuilder();
    final ProjectDataModelOracleImpl oracle = new ProjectDataModelOracleImpl();

    final ClassFactBuilder cb =
        new ClassFactBuilder(builder, Product.class, false, TypeSource.JAVA_PROJECT);
    cb.build(oracle);

    assertEquals(1, oracle.getProjectModelFields().size());
    assertContains(
        "org.kie.workbench.common.services.datamodel.backend.server.testclasses.Product",
        oracle.getProjectModelFields().keySet());

    final Set<Annotation> annotations =
        oracle
            .getProjectTypeAnnotations()
            .get("org.kie.workbench.common.services.datamodel.backend.server.testclasses.Product");
    assertNotNull(annotations);
    assertEquals(0, annotations.size());
  }
 private void loadPackageNames() {
   oracle.addProjectPackageNames(packageNames);
 }