Commit 0607f681 authored by Philip Makedonski's avatar Philip Makedonski
Browse files

+ fix for multiple or no test objective in TPD #20

parent b0c08973
Loading
Loading
Loading
Loading
Loading
+11 −3
Original line number Diff line number Diff line
@@ -431,9 +431,17 @@ public class Generator {
		LinkedHashMap<String,String> map = new LinkedHashMap<>();
		map.put(Placeholders.NAME, tpd.getName());
		//TODO: what if 0? what if more than 1?
		//TODO: make more robust
		if (tpd.getTestObjective().size() == 1) {
			map.put(Placeholders.DESCRIPTION, tpd.getTestObjective().get(0).getDescription().replaceAll("\"", ""));
			String uri = String.join("\n", tpd.getTestObjective().get(0).getObjectiveURI()).trim();
			map.put(Placeholders.URI, uri.replaceAll("\"",""));
		} else {
			//TODO: handle more adequately
			String error = "N/A (multiple or no Test Objectives linked)";
			map.put(Placeholders.DESCRIPTION, error);
			map.put(Placeholders.URI, error);
		}
		TestConfiguration configuration = tpd.getTestConfiguration();
		String config = "";
		if (configuration != null) {