Search in sources :

Example 86 with DataObject

use of org.kie.workbench.common.services.datamodeller.core.DataObject in project kie-wb-common by kiegroup.

the class JavaRoasterModelDriverTest method createMethodsUpdateTestResult.

private DataObject createMethodsUpdateTestResult() {
    DataObject dataObject = createDataObject("org.kie.workbench.common.services.datamodeller.driver.package4", "MethodsUpdateTestResult", null);
    Type methodReturnType = new TypeImpl(List.class.getName(), Arrays.asList(new TypeImpl(Integer.class.getName())));
    Type parameterType1 = new TypeImpl(List.class.getName(), Arrays.asList(new TypeImpl(List.class.getName(), Arrays.asList(new TypeImpl("org.kie.workbench.common.services.datamodeller.driver.package4.MethodsUpdateTestResult")))));
    Parameter parameter1 = new ParameterImpl(parameterType1, "methodUpdateTestResultList");
    Type parameterType2 = new TypeImpl(int.class.getName());
    Parameter parameter2 = new ParameterImpl(parameterType2, "intParameter");
    Method methodImpl = new MethodImpl("getTestString", Arrays.asList(parameter1, parameter2), "return Arrays.asList(1);", methodReturnType, Visibility.PUBLIC);
    Annotation testAnnotation = createAnnotation(TestAnnotation.class);
    methodImpl.addAnnotation(testAnnotation);
    dataObject.addMethod(methodImpl);
    methodImpl = new MethodImpl("noOpMethodWithTestAnnotationUpdated", Collections.EMPTY_LIST, "return 1;", new TypeImpl(Integer.class.getName()), Visibility.PUBLIC);
    Annotation testAnnotation1 = createAnnotation(Generated.class);
    testAnnotation1.setValue("value", "foo.bar.Generator");
    methodImpl.addAnnotation(testAnnotation1);
    Annotation testAnnotation2 = createAnnotation(TestAnnotation1.class);
    testAnnotation2.setValue("value", "annotationParameterUpdated");
    methodImpl.addAnnotation(testAnnotation2);
    dataObject.addMethod(methodImpl);
    return dataObject;
}
Also used : Type(org.kie.workbench.common.services.datamodeller.core.Type) DataObject(org.kie.workbench.common.services.datamodeller.core.DataObject) MethodImpl(org.kie.workbench.common.services.datamodeller.core.impl.MethodImpl) ParameterImpl(org.kie.workbench.common.services.datamodeller.core.impl.ParameterImpl) Parameter(org.kie.workbench.common.services.datamodeller.core.Parameter) List(java.util.List) ArrayList(java.util.ArrayList) Method(org.kie.workbench.common.services.datamodeller.core.Method) ClassAnnotation(org.kie.workbench.common.services.datamodeller.annotations.ClassAnnotation) EnumsAnnotation(org.kie.workbench.common.services.datamodeller.annotations.EnumsAnnotation) AnnotationValuesAnnotation(org.kie.workbench.common.services.datamodeller.annotations.AnnotationValuesAnnotation) PrimitivesAnnotation(org.kie.workbench.common.services.datamodeller.annotations.PrimitivesAnnotation) TestAnnotation(org.kie.workbench.common.services.datamodeller.parser.test.TestAnnotation) MarkerAnnotation(org.kie.workbench.common.services.datamodeller.annotations.MarkerAnnotation) Annotation(org.kie.workbench.common.services.datamodeller.core.Annotation) TypeImpl(org.kie.workbench.common.services.datamodeller.core.impl.TypeImpl)

Example 87 with DataObject

use of org.kie.workbench.common.services.datamodeller.core.DataObject in project kie-wb-common by kiegroup.

the class JavaRoasterModelDriverTest method createImportsUpdateTest.

private DataObject createImportsUpdateTest() {
    DataObject dataObject = createDataObject("org.kie.workbench.common.services.datamodeller.driver.package6", "ImportsUpdateTest", null);
    dataObject.addImport(new ImportImpl(Generated.class.getName()));
    return dataObject;
}
Also used : DataObject(org.kie.workbench.common.services.datamodeller.core.DataObject) ImportImpl(org.kie.workbench.common.services.datamodeller.core.impl.ImportImpl)

Example 88 with DataObject

use of org.kie.workbench.common.services.datamodeller.core.DataObject in project kie-wb-common by kiegroup.

the class JavaRoasterModelDriverTest method createPrimitivesAnnotationTest.

private DataObject createPrimitivesAnnotationTest() {
    DataObject dataObject = createDataObject("org.kie.workbench.common.services.datamodeller.driver.package3", "PrimitivesAnnotationTest", null);
    ObjectProperty field1 = dataObject.addProperty("field1", String.class.getName());
    Annotation annotation = createPrimitivesAnnotation();
    dataObject.addAnnotation(annotation);
    field1.addAnnotation(annotation);
    return dataObject;
}
Also used : ObjectProperty(org.kie.workbench.common.services.datamodeller.core.ObjectProperty) DataObject(org.kie.workbench.common.services.datamodeller.core.DataObject) ClassAnnotation(org.kie.workbench.common.services.datamodeller.annotations.ClassAnnotation) EnumsAnnotation(org.kie.workbench.common.services.datamodeller.annotations.EnumsAnnotation) AnnotationValuesAnnotation(org.kie.workbench.common.services.datamodeller.annotations.AnnotationValuesAnnotation) PrimitivesAnnotation(org.kie.workbench.common.services.datamodeller.annotations.PrimitivesAnnotation) TestAnnotation(org.kie.workbench.common.services.datamodeller.parser.test.TestAnnotation) MarkerAnnotation(org.kie.workbench.common.services.datamodeller.annotations.MarkerAnnotation) Annotation(org.kie.workbench.common.services.datamodeller.core.Annotation)

Example 89 with DataObject

use of org.kie.workbench.common.services.datamodeller.core.DataObject in project kie-wb-common by kiegroup.

the class JavaRoasterModelDriverTest method createMarkerAnnotationTest.

private DataObject createMarkerAnnotationTest() {
    DataObject dataObject = createDataObject("org.kie.workbench.common.services.datamodeller.driver.package3", "MarkerAnnotationTest", null);
    ObjectProperty field1 = dataObject.addProperty("field1", String.class.getName());
    Annotation annotation = createMarkerAnnotation();
    dataObject.addAnnotation(annotation);
    field1.addAnnotation(annotation);
    return dataObject;
}
Also used : ObjectProperty(org.kie.workbench.common.services.datamodeller.core.ObjectProperty) DataObject(org.kie.workbench.common.services.datamodeller.core.DataObject) ClassAnnotation(org.kie.workbench.common.services.datamodeller.annotations.ClassAnnotation) EnumsAnnotation(org.kie.workbench.common.services.datamodeller.annotations.EnumsAnnotation) AnnotationValuesAnnotation(org.kie.workbench.common.services.datamodeller.annotations.AnnotationValuesAnnotation) PrimitivesAnnotation(org.kie.workbench.common.services.datamodeller.annotations.PrimitivesAnnotation) TestAnnotation(org.kie.workbench.common.services.datamodeller.parser.test.TestAnnotation) MarkerAnnotation(org.kie.workbench.common.services.datamodeller.annotations.MarkerAnnotation) Annotation(org.kie.workbench.common.services.datamodeller.core.Annotation)

Example 90 with DataObject

use of org.kie.workbench.common.services.datamodeller.core.DataObject in project kie-wb-common by kiegroup.

the class JavaRoasterModelDriverTest method createImportsUpdateTestResult.

private DataObject createImportsUpdateTestResult() {
    DataObject dataObject = createDataObject("org.kie.workbench.common.services.datamodeller.driver.package6", "ImportsUpdateTestResult", null);
    dataObject.addImport(new ImportImpl(Generated.class.getName()));
    dataObject.addImport(new ImportImpl(List.class.getName()));
    dataObject.addImport(new ImportImpl(ArrayList.class.getName()));
    return dataObject;
}
Also used : DataObject(org.kie.workbench.common.services.datamodeller.core.DataObject) ImportImpl(org.kie.workbench.common.services.datamodeller.core.impl.ImportImpl)

Aggregations

DataObject (org.kie.workbench.common.services.datamodeller.core.DataObject)95 Test (org.junit.Test)45 ObjectProperty (org.kie.workbench.common.services.datamodeller.core.ObjectProperty)40 DataModel (org.kie.workbench.common.services.datamodeller.core.DataModel)29 Annotation (org.kie.workbench.common.services.datamodeller.core.Annotation)28 DataObjectImpl (org.kie.workbench.common.services.datamodeller.core.impl.DataObjectImpl)21 ArrayList (java.util.ArrayList)17 AnnotationValuesAnnotation (org.kie.workbench.common.services.datamodeller.annotations.AnnotationValuesAnnotation)17 ClassAnnotation (org.kie.workbench.common.services.datamodeller.annotations.ClassAnnotation)17 EnumsAnnotation (org.kie.workbench.common.services.datamodeller.annotations.EnumsAnnotation)17 MarkerAnnotation (org.kie.workbench.common.services.datamodeller.annotations.MarkerAnnotation)17 PrimitivesAnnotation (org.kie.workbench.common.services.datamodeller.annotations.PrimitivesAnnotation)17 TestAnnotation (org.kie.workbench.common.services.datamodeller.parser.test.TestAnnotation)17 AnnotationImpl (org.kie.workbench.common.services.datamodeller.core.impl.AnnotationImpl)16 DomainEditorBaseTest (org.kie.workbench.common.screens.datamodeller.client.widgets.DomainEditorBaseTest)15 MethodImpl (org.kie.workbench.common.services.datamodeller.core.impl.MethodImpl)12 List (java.util.List)11 TypeImpl (org.kie.workbench.common.services.datamodeller.core.impl.TypeImpl)11 Method (org.kie.workbench.common.services.datamodeller.core.Method)10 Generated (javax.annotation.Generated)8