use of org.kie.workbench.common.services.datamodeller.core.impl.MethodImpl 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;
}
use of org.kie.workbench.common.services.datamodeller.core.impl.MethodImpl in project kie-wb-common by kiegroup.
the class JavaRoasterModelDriverTest method createNestedClassUpdateTest.
private DataObject createNestedClassUpdateTest() {
DataObject dataObject = createDataObject("org.kie.workbench.common.services.datamodeller.driver.package5", "NestedClassUpdateTest", null);
JavaClass nestedClass = new JavaClassImpl("", "NestedClass");
nestedClass.addInterface("java.io.Serializable");
nestedClass.addInterface("ParametrizedInterface<Integer>");
Annotation generatedAnnotation = createAnnotation(Generated.class);
generatedAnnotation.setValue("value", Arrays.asList("foo.bar.Generator"));
nestedClass.addAnnotation(generatedAnnotation);
MethodImpl method = new MethodImpl("method", Collections.EMPTY_LIST, "", new TypeImpl(void.class.getName()), Visibility.PUBLIC);
generatedAnnotation = createAnnotation(Generated.class);
generatedAnnotation.setValue("value", Arrays.asList("foo.bar.Generator"));
method.addAnnotation(generatedAnnotation);
nestedClass.addMethod(method);
dataObject.addNestedClass(nestedClass);
return dataObject;
}
Aggregations