Commit 63b77090 authored by Faezeh KHORRAM's avatar Faezeh KHORRAM 💬
Browse files

update code generator

parent f371a68a
......@@ -108,6 +108,9 @@ public class DSLSpecificEventsGenerator {
for (int j=0; j<event.getParams().size();j++) {
String paramName = validName(event.getParams().get(j).getName());
String paramType = event.getParams().get(j).getType().toLowerCase();
if (paramType.contains(".")) {
paramType = paramType.substring(paramType.lastIndexOf(".") + 1, paramType.length());
}
if (this.dslSpecificTypes.get(paramType) != null) {
Member member = factory.createMember();
member.setName(paramName);
......
......@@ -89,14 +89,16 @@ public class DSLSpecificTypesGenerator {
if (dataType instanceof StructuredDataType) {
StructuredDataType type = (StructuredDataType) dataType;
for (int j=0; j < type.getAnnotation().size(); j++){
if (type.getAnnotation().get(j).getKey().getName().toString().contains("dynamic")) {
String annotation = type.getAnnotation().get(j).getKey().getName().toString();
if (annotation.contains("dynamic")||annotation.contains("aspect")) {
return true;
}
}
for (int j=0; j < type.getMember().size(); j++) {
Member m = type.getMember().get(j);
for (int k=0; k < m.getAnnotation().size(); k++) {
if (m.getAnnotation().get(k).getKey().getName().toString().contains("dynamic")) {
String annotation = m.getAnnotation().get(k).getKey().getName().toString();
if (annotation.contains("dynamic")||annotation.contains("aspect")) {
return true;
}
}
......
......@@ -156,8 +156,6 @@ public class TestConfigurationGenerator {
TestConfiguration dslSpecificConfiguration = factory.createTestConfiguration();
dslSpecificConfiguration.setName("dslSpecificConfiguration");
generateComponentInstances(dslSpecificConfiguration);
//two connections are required, one for generic communication, another for dsl-specific commands
generateConnection(dslSpecificConfiguration, "generic");
generateConnection(dslSpecificConfiguration, "dslSpecific");
this.testConfigurationPackage.getPackagedElement().add(dslSpecificConfiguration);
this.configurations.put(dslSpecificConfiguration.getName(), dslSpecificConfiguration);
......
......@@ -38,7 +38,7 @@ public class TestSuitePackageGenerator {
this.testSuitePackage = factory.createPackage();
this.testSuitePackage.setName("testSuite");
generateImports(this.testSuitePackage);
generateGenericDataInstances();
//generateGenericDataInstances();
generateAnnotations();
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment