Commit 7a6bfbc1 authored by Simon Barner's avatar Simon Barner
Browse files

GREEN

Issue-Ref: 4048
Issue-Url: https://af3-developer.fortiss.org/issues/4048

Signed-off-by: Simon Barner's avatarSimon Barner <barner@fortiss.org>
parent d17d364d
ArchitectureGraph.java 4f1539b6997b7a71d744ef750aa2f102097f211d GREEN
ExplorationTestCaseGenerator.java 1a311a49caef1be66ecb2757da803ce63a070f87 YELLOW
ExplorationTestCaseGenerator.java 5e16627d68276a1e90912e1e85d65ef01e1303e6 GREEN
......@@ -26,6 +26,7 @@ import static org.fortiss.af3.project.utils.FileUtils.getDefaultGeneralProjectUR
import static org.fortiss.af3.project.utils.TestCaseProjectUtils.loadTestProject;
import static org.fortiss.tooling.base.utils.AnnotationUtils.instantiateAnnotationsRecursive;
import static org.fortiss.tooling.kernel.utils.EcoreUtils.copy;
import static org.fortiss.tooling.kernel.utils.EcoreUtils.getFirstChildWithType;
import static org.fortiss.tooling.kernel.utils.EcoreUtils.pickFirstInstanceOf;
import static org.fortiss.tooling.kernel.utils.EcoreUtils.pickInstanceOf;
import static org.fortiss.tooling.kernel.utils.LoggingUtils.error;
......@@ -49,7 +50,6 @@ import org.fortiss.af3.exploration.model.project.RuleSet;
import org.fortiss.af3.platform.model.PlatformArchitecture;
import org.fortiss.af3.project.model.FileProject;
import org.fortiss.af3.task.model.TaskArchitecture;
import org.fortiss.tooling.kernel.utils.EcoreUtils;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
......@@ -91,7 +91,7 @@ public class ExplorationTestCaseGenerator {
fileProjects = expandByDseProblems(fileProjects);
info(AF3ExplorationActivator.getDefault(),
"Test cases are generated in the runtime Workspace.");
"Test cases are generated in the runtime workspace.");
// Instantiate missing annotations.
fileProjects.forEach(fp -> instantiateAnnotationsRecursive(fp));
......@@ -100,7 +100,7 @@ public class ExplorationTestCaseGenerator {
dumpDSEMetrics(fileProjects);
}
/** Dumps information about the generated DSE testcases to a JSON file. */
/** Dumps information about the generated DSE test cases to a JSON file. */
@SuppressWarnings("unchecked")
private static void dumpDSEMetrics(Collection<FileProject> fileProjects) {
JSONObject jsonObject = new JSONObject();
......@@ -109,7 +109,7 @@ public class ExplorationTestCaseGenerator {
jsonObject.put("testcaseNumber", fileProjects.size());
jsonObject.put("testcases", testCaseMetaData);
} catch(JSONException e) {
String errorMsg = "Could not dump the meta data of the testcases.";
String errorMsg = "Could not dump the meta data of the testcases.";
error(AF3ExplorationActivator.getDefault(), errorMsg, e);
}
......@@ -118,7 +118,7 @@ public class ExplorationTestCaseGenerator {
JSONObject projectMetaData = new JSONObject();
projectMetaData.put("name", fp.getName());
DSE dse = EcoreUtils.getFirstChildWithType(fp, DSE.class);
DSE dse = getFirstChildWithType(fp, DSE.class);
ProcessStep pStep = dse.getCurrentStep();
SuperSet<Component> cSet = pStep.getSuperSetMap().get(Component.class);
projectMetaData.put("components", cSet.getEntries().size());
......@@ -130,8 +130,8 @@ public class ExplorationTestCaseGenerator {
projectMetaData.put("componentMetrics", compMetrics);
}
int allConsraintNumber = 0;
int allObjectiveNumber = 0;
int allConstraintsNumber = 0;
int allObjectivesNumber = 0;
JSONArray rsMetaDataArr = new JSONArray();
for(RuleSet rS : pStep.getRuleSets()) {
JSONObject ruleSetMetaData = new JSONObject();
......@@ -146,20 +146,20 @@ public class ExplorationTestCaseGenerator {
createExplorationTargetJSONArray(ruleSetMetaData, "constraints",
"constraintNames",
(List<? extends IExplorationTarget<?>>)constraints);
allConsraintNumber += constraints.size();
allConstraintsNumber += constraints.size();
}
if(!objectives.isEmpty()) {
createExplorationTargetJSONArray(ruleSetMetaData, "objectives",
"objectiveNames",
(List<? extends IExplorationTarget<?>>)objectives);
allObjectiveNumber += objectives.size();
allObjectivesNumber += objectives.size();
}
rsMetaDataArr.put(ruleSetMetaData);
}
projectMetaData.put("constraints", allConsraintNumber);
projectMetaData.put("objectives", allObjectiveNumber);
projectMetaData.put("constraints", allConstraintsNumber);
projectMetaData.put("objectives", allObjectivesNumber);
projectMetaData.put("ruleSets", rsMetaDataArr);
testCaseMetaData.put(projectMetaData);
......
......@@ -5,4 +5,4 @@ FileWriterUtil.java 4a95559f571d41fa44e6236fc055ab5baac7c384 GREEN
GraphGenerationUtilities.java e637fd6a38339c60a6a7ac5af116db304266d345 GREEN
GraphMetricUtils.java 99a398d4ff9b15b3eeb35748e32aa34a9b197f07 GREEN
GraphUtils.java 4d59affe2bab3113f48d1a827ad0bc9599b3439e GREEN
ProjectUtils.java 4d8a8796f911d22df8ded53f46491284f14d977f YELLOW
ProjectUtils.java 4d8a8796f911d22df8ded53f46491284f14d977f GREEN
Supports Markdown
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