Loading plugins/org.etsi.mts.tdl.execution.java.codegen/src/org/etsi/mts/tdl/execution/java/codegen/JUnitTestGenerator.java +17 −7 Original line number Diff line number Diff line Loading @@ -827,7 +827,10 @@ public class JUnitTestGenerator extends Renderer { blockOpen(); Set<String> thrownExceptions = new HashSet<String>(); writeNotification(tc, true); write(tc.getBehaviourDescription().getBehaviour(), null, null, thrownExceptions); writeNotification(tc, false); writeObjective(tc.getTestObjective()); blockClose(); Loading Loading @@ -1513,7 +1516,7 @@ public class JUnitTestGenerator extends Renderer { } writeNotification(b, false); writeObjective(b); writeObjective(b.getTestObjective()); newLine(); exceptionalBehaviours.forEach(eb -> { Loading Loading @@ -2511,18 +2514,25 @@ public class JUnitTestGenerator extends Renderer { }); } private void writeObjective(Behaviour b) { private void writeObjective(List<TestObjective> objectives) { // TODO multiple URIs b.getTestObjective().forEach(to -> { objectives.forEach(to -> { append(REPORTER_FIELD + ".testObjectiveReached("); append(COMPONENT_FIELD + ".getTesterComponent().getName(), "); append("\"" + to.getObjectiveURI() + "\", "); append("\"" + to.getDescription() + "\""); writeTextBlock(String.join(" | ", to.getObjectiveURI())); append(", "); writeTextBlock(to.getDescription()); line(");"); }); } private void writeNotification(Behaviour b, boolean started) { private void writeTextBlock(String text) { line("\"\"\""); append(text); append("\"\"\""); } private void writeNotification(Element b, boolean started) { if (logEvents) { String behaviour = ""; if (settings.logBehaviourTraces && b instanceof AtomicBehaviour && b.eResource() instanceof XtextResource) { Loading Loading @@ -2555,7 +2565,7 @@ public class JUnitTestGenerator extends Renderer { * * @return A descriptive name of the behaviour. */ private String getQName(Behaviour b) { private String getQName(Element b) { // XXX String name = b.getName(); if (name == null) Loading Loading
plugins/org.etsi.mts.tdl.execution.java.codegen/src/org/etsi/mts/tdl/execution/java/codegen/JUnitTestGenerator.java +17 −7 Original line number Diff line number Diff line Loading @@ -827,7 +827,10 @@ public class JUnitTestGenerator extends Renderer { blockOpen(); Set<String> thrownExceptions = new HashSet<String>(); writeNotification(tc, true); write(tc.getBehaviourDescription().getBehaviour(), null, null, thrownExceptions); writeNotification(tc, false); writeObjective(tc.getTestObjective()); blockClose(); Loading Loading @@ -1513,7 +1516,7 @@ public class JUnitTestGenerator extends Renderer { } writeNotification(b, false); writeObjective(b); writeObjective(b.getTestObjective()); newLine(); exceptionalBehaviours.forEach(eb -> { Loading Loading @@ -2511,18 +2514,25 @@ public class JUnitTestGenerator extends Renderer { }); } private void writeObjective(Behaviour b) { private void writeObjective(List<TestObjective> objectives) { // TODO multiple URIs b.getTestObjective().forEach(to -> { objectives.forEach(to -> { append(REPORTER_FIELD + ".testObjectiveReached("); append(COMPONENT_FIELD + ".getTesterComponent().getName(), "); append("\"" + to.getObjectiveURI() + "\", "); append("\"" + to.getDescription() + "\""); writeTextBlock(String.join(" | ", to.getObjectiveURI())); append(", "); writeTextBlock(to.getDescription()); line(");"); }); } private void writeNotification(Behaviour b, boolean started) { private void writeTextBlock(String text) { line("\"\"\""); append(text); append("\"\"\""); } private void writeNotification(Element b, boolean started) { if (logEvents) { String behaviour = ""; if (settings.logBehaviourTraces && b instanceof AtomicBehaviour && b.eResource() instanceof XtextResource) { Loading Loading @@ -2555,7 +2565,7 @@ public class JUnitTestGenerator extends Renderer { * * @return A descriptive name of the behaviour. */ private String getQName(Behaviour b) { private String getQName(Element b) { // XXX String name = b.getName(); if (name == null) Loading