Commit 039f9fd2 authored by Markus Georg Bendel's avatar Markus Georg Bendel
Browse files

Merge branch 'integrate-someip' into 'master'

# Conflicts:
#   pom.xml
#   src/main/java/de/monticore/lang/monticar/generator/middleware/cli/DistributedTargetGeneratorCli.java
parents 59868f08 231f6e4c
Pipeline #188880 failed with stages
in 3 minutes and 11 seconds
/* (c) https://github.com/MontiCore/monticore */
package de.monticore.lang.monticar.generator.middleware;
/*
* Copyright (c) 2015 RWTH Aachen. All rights reserved.
*
* http://www.se-rwth.de/
*/
import de.monticore.lang.monticar.generator.order.simulator.AbstractSymtab;
import org.junit.Assert;
......@@ -64,8 +60,10 @@ public class AbstractSymtabTest extends AbstractSymtab {
}
lines1 = discardEmptyLines(lines1);
lines1 = discardCommentLines(lines1);
lines1 = discardCopyrightNotice(lines1);
lines2 = discardEmptyLines(lines2);
lines2 = discardCommentLines(lines2);
lines2 = discardCopyrightNotice(lines2);
if (lines1.size() != lines2.size()) {
Assert.fail(
"files have different number of lines: "
......@@ -90,6 +88,12 @@ public class AbstractSymtabTest extends AbstractSymtab {
return true;
}
private static List<String> discardCopyrightNotice(List<String> lines) {
return lines.stream()
.filter(l -> !l.contains("(c) https://github.com/MontiCore/monticore"))
.collect(Collectors.toList());
}
private static List<String> discardEmptyLines(List<String> lines) {
return lines.stream()
.map(String::trim)
......
/* (c) https://github.com/MontiCore/monticore */
package de.monticore.lang.monticar.generator.middleware;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.instanceStructure.EMAComponentInstanceSymbol;
......
/* (c) https://github.com/MontiCore/monticore */
package de.monticore.lang.monticar.generator.middleware;
import de.monticore.lang.embeddedmontiarc.LogConfig;
......@@ -5,10 +6,7 @@ import de.monticore.lang.monticar.generator.middleware.cli.DistributedTargetGene
import de.se_rwth.commons.logging.Finding;
import de.se_rwth.commons.logging.Log;
import org.apache.commons.lang3.ArrayUtils;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.*;
import java.nio.file.Files;
import java.nio.file.Paths;
......
/* (c) https://github.com/MontiCore/monticore */
package de.monticore.lang.monticar.generator.middleware;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.instanceStructure.EMAComponentInstanceSymbol;
......
/* (c) https://github.com/MontiCore/monticore */
package de.monticore.lang.monticar.generator.middleware;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.instanceStructure.EMAComponentInstanceSymbol;
......
/* (c) https://github.com/MontiCore/monticore */
package de.monticore.lang.monticar.generator.middleware;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.cncModel.EMAComponentSymbol;
......@@ -10,6 +11,7 @@ import de.monticore.lang.monticar.emadl.generator.EMADLAbstractSymtab;
import de.monticore.lang.monticar.generator.middleware.impls.*;
import de.monticore.lang.monticar.generator.roscpp.helper.TagHelper;
import de.monticore.lang.tagging._symboltable.TaggingResolver;
import de.se_rwth.commons.logging.Finding;
import de.se_rwth.commons.logging.Log;
import freemarker.template.TemplateException;
import org.junit.Before;
......@@ -298,7 +300,7 @@ public class GenerationTest extends AbstractSymtabTest {
middlewareGenerator.add(new RosCppGenImpl(), "roscpp");
middlewareGenerator.generate(componentInstanceSymbol, taggingResolver);
assertTrue(Log.getFindings().isEmpty());
assertTrue(Log.getFindings().stream().filter(Finding::isError).collect(Collectors.toList()).isEmpty());
}
@Test
......
/* (c) https://github.com/MontiCore/monticore */
package de.monticore.lang.monticar.generator.middleware;
import de.monticore.lang.monticar.generator.middleware.cli.DistributedTargetGeneratorCli;
......
/* (c) https://github.com/MontiCore/monticore */
package de.monticore.lang.monticar.generator.middleware;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.instanceStructure.EMAComponentInstanceSymbol;
......
package de.monticore.lang.monticar.generator.middleware;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.instanceStructure.EMAComponentInstanceSymbol;
import de.monticore.lang.embeddedmontiarc.tagging.middleware.mqtt.MqttToEmamTagSchema;
import de.monticore.lang.monticar.generator.middleware.impls.CPPGenImpl;
import de.monticore.lang.monticar.generator.middleware.impls.MqttGenImpl;
import de.monticore.lang.monticar.generator.mqtt.helper.MqttTagHelper;
import de.monticore.lang.tagging._symboltable.TaggingResolver;
import org.junit.Test;
import java.io.File;
import java.io.IOException;
import java.util.List;
import static org.junit.Assert.assertNotNull;
public class MqttGenerationTest extends AbstractSymtabTest {
private static final String TEST_PATH = "src/test/resources/";
private static final String OUT_BASE = "./target/generated-sources-mqtt/";
@Test
public void testMqttGeneration() throws IOException {
TaggingResolver taggingResolver = createSymTabAndTaggingResolver(TEST_PATH);
MqttToEmamTagSchema.registerTagTypes(taggingResolver);
EMAComponentInstanceSymbol componentInstanceSymbol = taggingResolver.<EMAComponentInstanceSymbol>resolve("tests.mqtt.testComp", EMAComponentInstanceSymbol.KIND).orElse(null);
assertNotNull(componentInstanceSymbol);
MqttTagHelper.resolveTags(taggingResolver, componentInstanceSymbol);
DistributedTargetGenerator distributedTargetGenerator = new DistributedTargetGenerator();
distributedTargetGenerator.setGenerationTargetPath(OUT_BASE + "compA/src");
distributedTargetGenerator.add(new CPPGenImpl(TEST_PATH),"cpp"); // Cpp implementation for the component
distributedTargetGenerator.add(new MqttGenImpl(), "mqtt");
List<File> files = distributedTargetGenerator.generate(componentInstanceSymbol, taggingResolver);
}
}
/* (c) https://github.com/MontiCore/monticore */
package de.monticore.lang.monticar.generator.middleware;
import de.monticore.lang.monticar.clustering.cli.algorithms.*;
......@@ -185,5 +186,4 @@ public class ParameterLoadingTest {
Log.enableFailQuick(true);
}
}
/* (c) https://github.com/MontiCore/monticore */
package de.monticore.lang.monticar.generator.middleware;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.instanceStructure.EMAComponentInstanceSymbol;
......
/* (c) https://github.com/MontiCore/monticore */
package de.monticore.lang.monticar.generator.middleware.templates.compile;
import de.monticore.lang.monticar.generator.FileContent;
......@@ -61,4 +62,4 @@ public class CompilationGeneratorTest extends AbstractSymtabTest {
testFilesAreEqual(Arrays.asList(f1, f2), "compileScripts/Ros2/");
}
}
\ No newline at end of file
}
#!/usr/bin/env bash
# (c) https://github.com/MontiCore/monticore
# via config file
java -jar target/embedded-montiarc-math-middleware-generator-0.0.13-SNAPSHOT-jar-with-dependencies.jar src/test/resources/config/valid.json
# via raw json string
java -jar target/embedded-montiarc-math-middleware-generator-0.0.13-SNAPSHOT-jar-with-dependencies.jar -r "{'modelsDir': 'src/test/resources/','outputDir': 'target/cliTest/validConfigFile','rootModel':'tests.a.addComp','generators': ['cpp','roscpp']}"
\ No newline at end of file
java -jar target/embedded-montiarc-math-middleware-generator-0.0.13-SNAPSHOT-jar-with-dependencies.jar -r "{'modelsDir': 'src/test/resources/','outputDir': 'target/cliTest/validConfigFile','rootModel':'tests.a.addComp','generators': ['cpp','roscpp']}"
#!/usr/bin/env bash
# (c) https://github.com/MontiCore/monticore
#run from project root!
#make sure all ros packages have been sourced!
function quitOnError {
......@@ -47,4 +48,4 @@ then
else
echo "Success!"
exit 0
fi
\ No newline at end of file
fi
#!/usr/bin/env bash
# (c) https://github.com/MontiCore/monticore
#starts all 4 components
targetFolder=target/generated-sources-cmake/system/build
......@@ -7,4 +8,4 @@ sleepTime=100
(${targetFolder}/ba_system_collisionDetection/coordinator/Coordinator_ba_system_collisionDetection -t $sleepTime) & \
(${targetFolder}/ba_system_intersectionController/coordinator/Coordinator_ba_system_intersectionController -t $sleepTime) & \
(${targetFolder}/ba_system_velocityController_1_/coordinator/Coordinator_ba_system_velocityController_1_ -t $sleepTime) & \
(${targetFolder}/ba_system_velocityController_2_/coordinator/Coordinator_ba_system_velocityController_2_ -t $sleepTime)
\ No newline at end of file
(${targetFolder}/ba_system_velocityController_2_/coordinator/Coordinator_ba_system_velocityController_2_ -t $sleepTime)
#run from project root!
# (c) https://github.com/MontiCore/monticore
#make sure all ros packages have been sourced!
function quitOnError {
if [ "$?" -ne 0 ]
......@@ -25,4 +26,4 @@ for d in */ ; do
done
echo Success!
exit 0
\ No newline at end of file
exit 0
/* (c) https://github.com/MontiCore/monticore */
package de.rwth.armin.modeling.autopilot;
import de.rwth.armin.modeling.autopilot.common.*;
......
/* (c) https://github.com/MontiCore/monticore */
package de.rwth.armin.modeling.autopilot;
......@@ -128,4 +129,4 @@ view Autopilot {
connect motion -> Steering;
}
}
\ No newline at end of file
}
/* (c) https://github.com/MontiCore/monticore */
package de.rwth.armin.modeling.autopilot;
component Tests {
......
/* (c) https://github.com/MontiCore/monticore */
package de.rwth.armin.modeling.autopilot.basicComp;
component PID{
......
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