Commit 37c02b0d authored by Paff's avatar Paff
Browse files

output for metrik

parent 20a5da59
......@@ -18,6 +18,7 @@ import java.util.Map;
import mc.DSLRoot;
import mc.DSLWorkflow;
import mc.ProblemReport;
import mc.ProblemReport.Type;
import mc.ast.ASTNode;
import mc.ast.IVisitor;
import mc.ast.MultiInheritanceVisitor;
......@@ -184,6 +185,9 @@ public final class MontiSecArcAnalysisWorkflow<Root extends DSLRoot<?>> extends
v.startVisit((ASTNode) dslroot.getAst());
ProblemReport rep = new ProblemReport(Type.WARNING, "Regarding the configuration the result of the metrik is: " + analysisVisitor.getFactorSum() , 0, 0);
dslroot.getErrorDelegator().addProblemReport(rep);
}
......
......@@ -14,6 +14,8 @@ import secarc.ets.check.MontiSecArcAnalysisCreator;
import secarc.ets.check.MontiSecArcAnalysisVisitor;
import secarc.ets.check.MontiSecArcAnalysisWorkflow;
import mc.DSLWorkflow;
import mc.ProblemReport;
import mc.ProblemReport.Type;
import mc.ast.ASTNode;
import mc.ast.InheritanceVisitor;
import mc.umlp.common._ast.UMLPNode;
......@@ -94,7 +96,7 @@ public class AnalysisCriticalPortTransformationWorkflow<T extends MontiSecArcRoo
MontiSecArcAnalysisVisitor analysisTransfromVisitor = new MontiSecArcAnalysisVisitor();
analysisTransfromVisitor.setAdvanced(advanced);
analysisTransformWorkflow.run(dslroot);
//Set original AST
dslroot.setAst(astCopy);
......
......@@ -48,7 +48,7 @@ public class MontiSecArcAnalysisTest extends TestWithSymtabAnalysis<MontiSecArcA
errorCodes.add(MontiSecArcAnalysisErrorCodes.EncryptedPathEndInLowTrustlevel);
errorCodes.add(MontiSecArcAnalysisErrorCodes.ListThirdPartyComponents);
assertEquals(4, handler.getWarnings().size());
assertEquals(5, handler.getWarnings().size());
for(ProblemReport error : handler.getErrors()) {
assertTrue(errorCodes.contains(error.getErrorcode()));
}
......@@ -61,7 +61,7 @@ public class MontiSecArcAnalysisTest extends TestWithSymtabAnalysis<MontiSecArcA
tool.init();
assertTrue(tool.run());
assertEquals(2, handler.getWarnings().size());
assertEquals(3, handler.getWarnings().size());
for(ProblemReport error : handler.getErrors()) {
assertTrue(errorCodes.contains(error.getErrorcode()));
}
......@@ -74,7 +74,7 @@ public class MontiSecArcAnalysisTest extends TestWithSymtabAnalysis<MontiSecArcA
tool.init();
assertTrue(tool.run());
assertEquals(5, handler.getWarnings().size());
assertEquals(6, handler.getWarnings().size());
for(ProblemReport error : handler.getErrors()) {
assertTrue(errorCodes.contains(error.getErrorcode()));
}
......@@ -87,7 +87,7 @@ public class MontiSecArcAnalysisTest extends TestWithSymtabAnalysis<MontiSecArcA
tool.init();
assertTrue(tool.run());
assertEquals(2, handler.getWarnings().size());
assertEquals(3, handler.getWarnings().size());
for(ProblemReport error : handler.getErrors()) {
assertTrue(errorCodes.contains(error.getErrorcode()));
}
......@@ -110,7 +110,7 @@ public class MontiSecArcAnalysisTest extends TestWithSymtabAnalysis<MontiSecArcA
errorCodes.add(MontiSecArcAnalysisErrorCodes.UnencryptedConnectorThroughLowTrustlevel);
errorCodes.add(MontiSecArcAnalysisErrorCodes.FilterWithHigherTrust);
assertEquals(3, handler.getWarnings().size());
assertEquals(4, handler.getWarnings().size());
for(ProblemReport error : handler.getErrors()) {
assertTrue(errorCodes.contains(error.getErrorcode()));
}
......@@ -123,7 +123,7 @@ public class MontiSecArcAnalysisTest extends TestWithSymtabAnalysis<MontiSecArcA
tool.init();
assertTrue(tool.run());
assertEquals(1, handler.getWarnings().size());
assertEquals(2, handler.getWarnings().size());
for(ProblemReport error : handler.getErrors()) {
assertTrue(errorCodes.contains(error.getErrorcode()));
}
......@@ -145,7 +145,7 @@ public class MontiSecArcAnalysisTest extends TestWithSymtabAnalysis<MontiSecArcA
errorCodes.add(MontiSecArcAnalysisErrorCodes.ReviewedConfiguration);
errorCodes.add(MontiSecArcAnalysisErrorCodes.ListThirdPartyComponents);
assertEquals(2, handler.getWarnings().size());
assertEquals(3, handler.getWarnings().size());
for(ProblemReport error : handler.getErrors()) {
assertTrue(errorCodes.contains(error.getErrorcode()));
}
......@@ -160,7 +160,7 @@ public class MontiSecArcAnalysisTest extends TestWithSymtabAnalysis<MontiSecArcA
errorCodes.add(MontiSecArcAnalysisErrorCodes.ListThirdPartyComponents);
assertEquals(1, handler.getWarnings().size());
assertEquals(2, handler.getWarnings().size());
for(ProblemReport error : handler.getErrors()) {
assertTrue(errorCodes.contains(error.getErrorcode()));
}
......@@ -185,7 +185,7 @@ public class MontiSecArcAnalysisTest extends TestWithSymtabAnalysis<MontiSecArcA
errorCodes.add(MontiSecArcAnalysisErrorCodes.RoleAccess);
errorCodes.add(MontiSecArcAnalysisErrorCodes.ListThirdPartyComponents);
assertEquals(6, handler.getWarnings().size());
assertEquals(7, handler.getWarnings().size());
for(ProblemReport error : handler.getErrors()) {
assertTrue(errorCodes.contains(error.getErrorcode()));
}
......@@ -207,7 +207,7 @@ public class MontiSecArcAnalysisTest extends TestWithSymtabAnalysis<MontiSecArcA
errorCodes.add(MontiSecArcAnalysisErrorCodes.ListOutgoingPorts);
errorCodes.add(MontiSecArcAnalysisErrorCodes.ListAllCriticalPorts);
assertEquals(1, handler.getWarnings().size());
assertEquals(2, handler.getWarnings().size());
for(ProblemReport error : handler.getErrors()) {
assertTrue(errorCodes.contains(error.getErrorcode()));
}
......@@ -220,7 +220,7 @@ public class MontiSecArcAnalysisTest extends TestWithSymtabAnalysis<MontiSecArcA
tool.init();
assertTrue(tool.run());
assertEquals(1, handler.getWarnings().size());
assertEquals(2, handler.getWarnings().size());
for(ProblemReport error : handler.getErrors()) {
assertTrue(errorCodes.contains(error.getErrorcode()));
}
......@@ -233,7 +233,7 @@ public class MontiSecArcAnalysisTest extends TestWithSymtabAnalysis<MontiSecArcA
tool.init();
assertTrue(tool.run());
assertEquals(1, handler.getWarnings().size());
assertEquals(2, handler.getWarnings().size());
for(ProblemReport error : handler.getErrors()) {
assertTrue(errorCodes.contains(error.getErrorcode()));
}
......@@ -256,7 +256,7 @@ public class MontiSecArcAnalysisTest extends TestWithSymtabAnalysis<MontiSecArcA
errorCodes.add(MontiSecArcAnalysisErrorCodes.DerivedRolesPort);
errorCodes.add(MontiSecArcAnalysisErrorCodes.RoleAccess);
assertEquals(4, handler.getWarnings().size());
assertEquals(5, handler.getWarnings().size());
for(ProblemReport error : handler.getErrors()) {
assertTrue(errorCodes.contains(error.getErrorcode()));
}
......@@ -269,7 +269,7 @@ public class MontiSecArcAnalysisTest extends TestWithSymtabAnalysis<MontiSecArcA
tool.init();
assertTrue(tool.run());
assertEquals(5, handler.getWarnings().size());
assertEquals(6, handler.getWarnings().size());
for(ProblemReport error : handler.getErrors()) {
assertTrue(errorCodes.contains(error.getErrorcode()));
}
......@@ -282,7 +282,7 @@ public class MontiSecArcAnalysisTest extends TestWithSymtabAnalysis<MontiSecArcA
tool.init();
assertTrue(tool.run());
assertEquals(1, handler.getWarnings().size());
assertEquals(2, handler.getWarnings().size());
for(ProblemReport error : handler.getErrors()) {
assertTrue(errorCodes.contains(error.getErrorcode()));
}
......@@ -303,7 +303,7 @@ public class MontiSecArcAnalysisTest extends TestWithSymtabAnalysis<MontiSecArcA
errorCodes.add(MontiSecArcAnalysisErrorCodes.ReasonDifferingTrustlevel);
errorCodes.add(MontiSecArcAnalysisErrorCodes.DerivedTrustlevel);
assertEquals(1, handler.getWarnings().size());
assertEquals(2, handler.getWarnings().size());
for(ProblemReport error : handler.getErrors()) {
assertTrue(errorCodes.contains(error.getErrorcode()));
}
......@@ -316,7 +316,7 @@ public class MontiSecArcAnalysisTest extends TestWithSymtabAnalysis<MontiSecArcA
tool.init();
assertTrue(tool.run());
assertEquals(1, handler.getWarnings().size());
assertEquals(2, handler.getWarnings().size());
for(ProblemReport error : handler.getErrors()) {
assertTrue(errorCodes.contains(error.getErrorcode()));
}
......@@ -337,7 +337,7 @@ public class MontiSecArcAnalysisTest extends TestWithSymtabAnalysis<MontiSecArcA
errorCodes.add(MontiSecArcAnalysisErrorCodes.TrustlevelForTrustlevelrelation);
errorCodes.add(MontiSecArcAnalysisErrorCodes.DerivedTrustlevel);
assertEquals(3, handler.getWarnings().size());
assertEquals(4, handler.getWarnings().size());
for(ProblemReport error : handler.getErrors()) {
assertTrue(errorCodes.contains(error.getErrorcode()));
}
......
......@@ -61,7 +61,7 @@ public class MontiSecArcAnalysisTransformationTrustlevelTest extends TestWithSym
assertEquals(true, ((SecComponentEntry) entry).getTrustlevel().get().isPositive());
}
assertEquals(9, handler.getWarnings().size());
assertEquals(11, handler.getWarnings().size());
}
/**
......@@ -106,7 +106,7 @@ public class MontiSecArcAnalysisTransformationTrustlevelTest extends TestWithSym
assertEquals(false, ((SecComponentEntry) entry).getTrustlevel().get().isPositive());
}
assertEquals(4, handler.getWarnings().size());
assertEquals(5, handler.getWarnings().size());
}
/**
......@@ -136,7 +136,7 @@ public class MontiSecArcAnalysisTransformationTrustlevelTest extends TestWithSym
}
assertEquals(null, entry);
assertEquals(9, handler.getWarnings().size());
assertEquals(11, handler.getWarnings().size());
}
protected ComponentEntry existComponent(String parameter, NameSpace np) throws AmbigousException {
......
......@@ -38,7 +38,7 @@ public class MontiSecArcAnalysisWhatIfTrustlevelTest extends TestWithSymtabAnaly
errorCodes.add(MontiSecArcAnalysisErrorCodes.ReasonDifferingTrustlevel);
errorCodes.add(MontiSecArcAnalysisErrorCodes.TaintTracking);
assertEquals(9, handler.getWarnings().size());
assertEquals(11, handler.getWarnings().size());
for(ProblemReport error : handler.getErrors()) {
assertTrue(errorCodes.contains(error.getErrorcode()));
}
......@@ -51,7 +51,7 @@ public class MontiSecArcAnalysisWhatIfTrustlevelTest extends TestWithSymtabAnaly
tool.init();
assertTrue(tool.run());
assertEquals(5, handler.getWarnings().size());
assertEquals(7, handler.getWarnings().size());
for(ProblemReport error : handler.getErrors()) {
assertTrue(errorCodes.contains(error.getErrorcode()));
}
......@@ -64,7 +64,7 @@ public class MontiSecArcAnalysisWhatIfTrustlevelTest extends TestWithSymtabAnaly
tool.init();
assertTrue(tool.run());
assertEquals(11, handler.getWarnings().size());
assertEquals(13, handler.getWarnings().size());
for(ProblemReport error : handler.getErrors()) {
assertTrue(errorCodes.contains(error.getErrorcode()));
}
......@@ -77,7 +77,7 @@ public class MontiSecArcAnalysisWhatIfTrustlevelTest extends TestWithSymtabAnaly
tool.init();
assertTrue(tool.run());
assertEquals(5, handler.getWarnings().size());
assertEquals(7, handler.getWarnings().size());
for(ProblemReport error : handler.getErrors()) {
assertTrue(errorCodes.contains(error.getErrorcode()));
}
......@@ -100,7 +100,7 @@ public class MontiSecArcAnalysisWhatIfTrustlevelTest extends TestWithSymtabAnaly
errorCodes.add(MontiSecArcAnalysisErrorCodes.UnencryptedConnectorThroughLowTrustlevel);
errorCodes.add(MontiSecArcAnalysisErrorCodes.FilterWithHigherTrust);
assertEquals(5, handler.getWarnings().size());
assertEquals(7, handler.getWarnings().size());
for(ProblemReport error : handler.getErrors()) {
assertTrue(errorCodes.contains(error.getErrorcode()));
}
......@@ -113,7 +113,7 @@ public class MontiSecArcAnalysisWhatIfTrustlevelTest extends TestWithSymtabAnaly
tool.init();
assertTrue(tool.run());
assertEquals(3, handler.getWarnings().size());
assertEquals(5, handler.getWarnings().size());
for(ProblemReport error : handler.getErrors()) {
assertTrue(errorCodes.contains(error.getErrorcode()));
}
......@@ -135,7 +135,7 @@ public class MontiSecArcAnalysisWhatIfTrustlevelTest extends TestWithSymtabAnaly
errorCodes.add(MontiSecArcAnalysisErrorCodes.ReviewedConfiguration);
errorCodes.add(MontiSecArcAnalysisErrorCodes.ListThirdPartyComponents);
assertEquals(4, handler.getWarnings().size());
assertEquals(6, handler.getWarnings().size());
for(ProblemReport error : handler.getErrors()) {
assertTrue(errorCodes.contains(error.getErrorcode()));
}
......@@ -150,7 +150,7 @@ public class MontiSecArcAnalysisWhatIfTrustlevelTest extends TestWithSymtabAnaly
errorCodes.add(MontiSecArcAnalysisErrorCodes.ListThirdPartyComponents);
assertEquals(2, handler.getWarnings().size());
assertEquals(4, handler.getWarnings().size());
for(ProblemReport error : handler.getErrors()) {
assertTrue(errorCodes.contains(error.getErrorcode()));
}
......@@ -175,7 +175,7 @@ public class MontiSecArcAnalysisWhatIfTrustlevelTest extends TestWithSymtabAnaly
errorCodes.add(MontiSecArcAnalysisErrorCodes.RoleAccess);
errorCodes.add(MontiSecArcAnalysisErrorCodes.ListThirdPartyComponents);
assertEquals(13, handler.getWarnings().size());
assertEquals(15, handler.getWarnings().size());
for(ProblemReport error : handler.getErrors()) {
assertTrue(errorCodes.contains(error.getErrorcode()));
}
......@@ -197,7 +197,7 @@ public class MontiSecArcAnalysisWhatIfTrustlevelTest extends TestWithSymtabAnaly
errorCodes.add(MontiSecArcAnalysisErrorCodes.ListOutgoingPorts);
errorCodes.add(MontiSecArcAnalysisErrorCodes.ListAllCriticalPorts);
assertEquals(2, handler.getWarnings().size());
assertEquals(4, handler.getWarnings().size());
for(ProblemReport error : handler.getErrors()) {
assertTrue(errorCodes.contains(error.getErrorcode()));
}
......@@ -210,7 +210,7 @@ public class MontiSecArcAnalysisWhatIfTrustlevelTest extends TestWithSymtabAnaly
tool.init();
assertTrue(tool.run());
assertEquals(2, handler.getWarnings().size());
assertEquals(4, handler.getWarnings().size());
for(ProblemReport error : handler.getErrors()) {
assertTrue(errorCodes.contains(error.getErrorcode()));
}
......@@ -223,7 +223,7 @@ public class MontiSecArcAnalysisWhatIfTrustlevelTest extends TestWithSymtabAnaly
tool.init();
assertTrue(tool.run());
assertEquals(2, handler.getWarnings().size());
assertEquals(4, handler.getWarnings().size());
for(ProblemReport error : handler.getErrors()) {
assertTrue(errorCodes.contains(error.getErrorcode()));
}
......@@ -246,7 +246,7 @@ public class MontiSecArcAnalysisWhatIfTrustlevelTest extends TestWithSymtabAnaly
errorCodes.add(MontiSecArcAnalysisErrorCodes.DerivedRolesPort);
errorCodes.add(MontiSecArcAnalysisErrorCodes.RoleAccess);
assertEquals(8, handler.getWarnings().size());
assertEquals(10, handler.getWarnings().size());
for(ProblemReport error : handler.getErrors()) {
assertTrue(errorCodes.contains(error.getErrorcode()));
}
......@@ -259,7 +259,7 @@ public class MontiSecArcAnalysisWhatIfTrustlevelTest extends TestWithSymtabAnaly
tool.init();
assertTrue(tool.run());
assertEquals(10, handler.getWarnings().size());
assertEquals(12, handler.getWarnings().size());
for(ProblemReport error : handler.getErrors()) {
assertTrue(errorCodes.contains(error.getErrorcode()));
}
......@@ -272,7 +272,7 @@ public class MontiSecArcAnalysisWhatIfTrustlevelTest extends TestWithSymtabAnaly
tool.init();
assertTrue(tool.run());
assertEquals(2, handler.getWarnings().size());
assertEquals(4, handler.getWarnings().size());
for(ProblemReport error : handler.getErrors()) {
assertTrue(errorCodes.contains(error.getErrorcode()));
}
......@@ -295,7 +295,7 @@ public class MontiSecArcAnalysisWhatIfTrustlevelTest extends TestWithSymtabAnaly
errorCodes.add(MontiSecArcAnalysisErrorCodes.ReasonDifferingTrustlevel);
errorCodes.add(MontiSecArcAnalysisErrorCodes.DerivedTrustlevel);
assertEquals(2, handler.getWarnings().size());
assertEquals(4, handler.getWarnings().size());
for (ProblemReport error : handler.getErrors()) {
assertTrue(errorCodes.contains(error.getErrorcode()));
}
......@@ -310,7 +310,7 @@ public class MontiSecArcAnalysisWhatIfTrustlevelTest extends TestWithSymtabAnaly
tool.init();
assertTrue(tool.run());
assertEquals(2, handler.getWarnings().size());
assertEquals(4, handler.getWarnings().size());
for (ProblemReport error : handler.getErrors()) {
assertTrue(errorCodes.contains(error.getErrorcode()));
}
......@@ -331,7 +331,7 @@ public class MontiSecArcAnalysisWhatIfTrustlevelTest extends TestWithSymtabAnaly
errorCodes.add(MontiSecArcAnalysisErrorCodes.TrustlevelForTrustlevelrelation);
errorCodes.add(MontiSecArcAnalysisErrorCodes.DerivedTrustlevel);
assertEquals(7, handler.getWarnings().size());
assertEquals(9, handler.getWarnings().size());
for(ProblemReport error : handler.getErrors()) {
assertTrue(errorCodes.contains(error.getErrorcode()));
}
......
......@@ -61,6 +61,7 @@ public class TestWithSymtabAnalysis<T extends ETSTool> extends
ARG_SYNTHESIS, "arcd", WF_PRE_CHECK_TRAFO,
ARG_SYNTHESIS, Parameters.ALL, WF_RUN_CHECK,
//Uses analysis workflow
MontiSecArcConstants.ARG_ANALYSISCONFPATH, "/home/user/workspace/MA-Paff/03.Implementierung/montiSecArcAnalysis/src/main/conf/Analysis_Conf.txt",
ARG_SYNTHESIS, "secarc", MontiSecArcConstants.ANALYSIS_WORKFLOW_BEGINNERS,};
List<String> argsAsList = new LinkedList<String>();
argsAsList.addAll(Arrays.asList(args));
......
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