Commit f73b5e03 authored by Florian's avatar Florian

Revert previous commit and fix GenerationTest

parent d5db0f13
Pipeline #167512 passed with stages
in 24 minutes and 19 seconds
......@@ -22,11 +22,11 @@ public class SomeIPGenImpl implements GeneratorImpl {
this.generatorSomeIP = generatorSomeIP;
}
//@Override
//public List<File> generate(EMAComponentInstanceSymbol componentInstanceSymbol, TaggingResolver taggingResolver) throws IOException {
// generatorSomeIP.setGenerationTargetPath(generationTargetPath);
// return generatorSomeIP.generateSomeIPAdapter(componentInstanceSymbol);
//}
@Override
public List<File> generate(EMAComponentInstanceSymbol componentInstanceSymbol, TaggingResolver taggingResolver) throws IOException {
generatorSomeIP.setGenerationTargetPath(generationTargetPath);
return generatorSomeIP.generateSomeIPAdapter(componentInstanceSymbol);
}
@Override
public void setGenerationTargetPath(String path) {
......
package de.monticore.lang.monticar.generator.middleware;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.cncModel.EMAPortSymbol;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.instanceStructure.EMAComponentInstanceSymbol;
import de.monticore.lang.embeddedmontiarc.tagging.middleware.ros.RosToEmamTagSchema;
import de.monticore.lang.embeddedmontiarc.tagging.middleware.someip.SomeIPConnectionSymbol;
import de.monticore.lang.monticar.generator.middleware.impls.CPPGenImpl;
import de.monticore.lang.monticar.generator.middleware.impls.SomeIPGenImpl;
import de.monticore.lang.monticar.generator.someip.GeneratorSomeIP;
import de.monticore.lang.monticar.generator.roscpp.helper.TagHelper;
import de.monticore.lang.tagging._symboltable.TagSymbol;
import de.monticore.lang.tagging._symboltable.TaggingResolver;
import org.junit.Test;
import java.io.File;
import java.io.IOException;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import static org.junit.Assert.assertNotNull;
......@@ -28,24 +31,28 @@ public class SomeIPGenerationTest extends AbstractSymtabTest {
assertNotNull(componentInstanceSymbol);
GeneratorSomeIP generatorSomeIP = new GeneratorSomeIP();
//generatorSomeIP.setGenerationTargetPath(OUT_BASE);
//generatorSomeIP.generateSomeIPAdapter(componentInstanceSymbol);
componentInstanceSymbol.getPortInstance("in1").orElse(null).setMiddlewareSymbol(new SomeIPConnectionSymbol(1,2,3));
//componentInstanceSymbol.getPortInstance("in2").orElse(null).setMiddlewareSymbol(new SomeIPConnectionSymbol(4,5,6));
//componentInstanceSymbol.getPortInstance("out1").orElse(null).setMiddlewareSymbol(new SomeIPConnectionSymbol(7,8,9));
//SomeIPGenImpl someIPGenImpl = new SomeIPGenImpl();
//someIPGenImpl.setGeneratorSomeIP(generatorSomeIP);
//someIPGenImpl.setGenerationTargetPath(OUT_BASE);
//someIPGenImpl.generate(componentInstanceSymbol, taggingResolver);
Map<EMAPortSymbol, SomeIPConnectionSymbol> someIPConnectionSymbols = new HashMap<>();
componentInstanceSymbol.getPortInstanceList().forEach(p -> {
Collection<TagSymbol> tmpTags = taggingResolver.getTags(p, SomeIPConnectionSymbol.KIND);
if (tmpTags.size() == 1) {
someIPConnectionSymbols.put(p, (SomeIPConnectionSymbol) tmpTags.iterator().next());
}
});
//EMAPortInstanceSymbol in1 = componentInstanceSymbol.getPortInstance("in1").orElse(null);
//assertNotNull(in1);
//EMAPortInstanceSymbol in2 = componentInstanceSymbol.getPortInstance("in2").orElse(null);
//assertNotNull(in2);
//EMAPortInstanceSymbol out1 = componentInstanceSymbol.getPortInstance("out1").orElse(null);
//assertNotNull(out1);
//in1.setMiddlewareSymbol(new SomeIPConnectionSymbol(1, 2, 3));
//in2.setMiddlewareSymbol(new SomeIPConnectionSymbol(4, 5, 6));
//out1.setMiddlewareSymbol(new SomeIPConnectionSymbol(7, 8, 9));
DistributedTargetGenerator distributedTargetGenerator = new DistributedTargetGenerator();
distributedTargetGenerator.setGenerationTargetPath(OUT_BASE + "addComp/src");
distributedTargetGenerator.add(new CPPGenImpl(TEST_PATH),"cpp");
distributedTargetGenerator.add(new SomeIPGenImpl(), "someip");
List<File> files2 = generatorSomeIP.generateSomeIPAdapter(componentInstanceSymbol);
List<File> files = distributedTargetGenerator.generate(componentInstanceSymbol, taggingResolver);
}
......
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