fixed more tests

parent 6e11cf14
Pipeline #197624 failed with stage
in 35 seconds
......@@ -22,8 +22,10 @@ package de.monticore.lang.embeddedmontiarc.embeddedmontiarc;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.EMAComponentSymbol;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.IEmbeddedMontiArcScope;
import de.monticore.lang.monticar.stream._symboltable.IStreamScope;
import de.monticore.lang.monticar.stream._symboltable.StreamLanguage;
import de.monticore.lang.monticar.streamunits._symboltable.ComponentStreamUnitsSymbol;
import de.monticore.lang.monticar.streamunits._symboltable.IStreamUnitsScope;
import de.monticore.symboltable.Scope;
import de.se_rwth.commons.Names;
import de.se_rwth.commons.logging.Log;
......@@ -47,10 +49,14 @@ public final class StreamScanner {
private final Path basePath;
private final IEmbeddedMontiArcScope symTab;
private final IStreamScope symTabStream;
private final IStreamUnitsScope symTabStreamUnits;
public StreamScanner(Path basePath, IEmbeddedMontiArcScope symTab) {
public StreamScanner(Path basePath, IEmbeddedMontiArcScope symTab, IStreamScope symTabStream, IStreamUnitsScope symTabStreamUnits) {
this.basePath = Log.errorIfNull(basePath);
this.symTab = Log.errorIfNull(symTab);
this.symTabStream = Log.errorIfNull(symTabStream);
this.symTabStreamUnits = Log.errorIfNull(symTabStreamUnits);
}
public Map<EMAComponentSymbol, Set<ComponentStreamUnitsSymbol>> scan() {
......@@ -87,9 +93,8 @@ public final class StreamScanner {
}
Path relativePath = scanner.basePath.relativize(file);
String streamModelName = getStreamModelName(relativePath);
ComponentStreamUnitsSymbol s = null;
//TODO IMPLEMENT ME!F
//ComponentStreamUnitsSymbol s = scanner.symTab.<ComponentStreamUnitsSymbol>resolve(streamModelName, ComponentStreamUnitsSymbol.KIND).orElse(null);
//TODO IMPLEMENT ME!D
ComponentStreamUnitsSymbol s = scanner.symTabStreamUnits.resolveComponentStreamUnits(streamModelName).orElse(null);
if (s != null) {
processComponentStreamUnitsSymbol(s, f);
} else {
......@@ -99,9 +104,9 @@ public final class StreamScanner {
}
private void processComponentStreamUnitsSymbol(ComponentStreamUnitsSymbol s, File f) {
EMAComponentSymbol relatedComponent = null;
//TODO IMPLEMENT ME!F
//EMAComponentSymbol relatedComponent = s.<EMAComponentSymbol>getComponentSymbol(EMAComponentSymbol.KIND).orElse(null);
//TODO IMPLEMENT ME!D
EMAComponentSymbol relatedComponent = scanner.symTab.resolveEMAComponent(s.getPackageName() +"." + s.getComponentName()).orElse(null);
//s.<Symbol>getComponentSymbol(EMAComponentSymbol.KIND).orElse(null);
if (relatedComponent == null) {
Log.warn("could not resolve component for which stream is defined in " + f.getAbsolutePath());
return;
......
......@@ -109,7 +109,7 @@ public class ASTEMAConnector extends ASTEMAConnectorTOP {
public void addTarget(String name) {
if (targets == null) {
targets = new ASTConnectorTargets();
targets = EmbeddedMontiArcMill.connectorTargetsBuilder().build();
}
try {
if (name.equals(
......@@ -130,6 +130,9 @@ public class ASTEMAConnector extends ASTEMAConnectorTOP {
}
public void addTargets(Collection<String> names) {
if(targets == null){
targets = EmbeddedMontiArcMill.connectorTargetsBuilder().build();
}
for (String name : names) {
try {
targets.qualifiedNameWithArrayAndStars.add(
......
......@@ -62,7 +62,8 @@ public class EMAComponentInstantiationSymbolBuilder
return ret;
}
//TODO IMPLEMENT ME!F clone needs to handle additional information like genericParameters
//TODO IMPLEMENT ME!D cloning is not supported anymore as this would modify enclosing scope symbol amount
@Deprecated
public static EMAComponentInstantiationSymbol clone(EMAComponentInstantiationSymbol inst) {
Collection<EMAComponentInstantiationSymbol> subcomps =
inst.getSubComponents().stream().map(EMAComponentInstantiationSymbolBuilder::clone)
......@@ -73,7 +74,7 @@ public class EMAComponentInstantiationSymbolBuilder
Collection<EMAPortSymbol> ports =
inst.getPortInstanceList().stream().map(EMAPortBuilder::clone).collect(Collectors.toList());
EMAComponentInstantiationSymbolBuilder res = (new EMAComponentInstantiationSymbolBuilder());
EMAComponentInstantiationSymbolBuilder res = EmbeddedMontiArcSymTabMill.eMAComponentInstantiationSymbolBuilder();
res.setEnclosingScope(inst.getEnclosingScope());
res.setName(inst.getName()).setSymbolReference(inst.getComponentType()).addPorts(ports)
......@@ -348,14 +349,14 @@ public class EMAComponentInstantiationSymbolBuilder
for (ASTEMAConnector connector : connectors) {
sym.addConnector(EMAConnectorBuilder.instantiate(connector, sym.getSpannedScope()));
}
//TODO IMPLEMENT ME!F
//TODO IMPLEMENT ME!D
//subComponents.stream().forEachOrdered(s -> {scope.add(s);});
for (EMAComponentInstantiationSymbol subComponent : subComponents) {
if (subComponent.enclosingScope != scope) {
subComponent.setEnclosingScope(scope);//sets enclosing scope variable fo sym
scope.add(subComponent);
subComponent.getSpannedScope()
.setEnclosingScope(scope);//sets enclosing scope variable fo sym
/*subComponent.getSpannedScope()
.setEnclosingScope(scope);//sets enclosing scope variable fo sym*/
}
}
......
......@@ -70,13 +70,15 @@ public class EMAConnectorBuilder {
}
public ASTEMAConnector build() {
if (source.isPresent() && target.isPresent() && definingScope != null) {
if (source.isPresent() && (target.isPresent() || targets.size() > 0)&& definingScope != null) {
ASTEMAConnector con = new ASTEMAConnector();
con.setSource(this.source.get());
if (target.isPresent()) {
con.addTarget(target.get());
}
con.addTargets(this.targets);
if(targets.size() > 0) {
con.addTargets(this.targets);
}
if (portSymbol.orElse(null) != null) {
//TODO IMPLEMENT ME!D
//con.setConstantPortSymbol(portSymbol.get());
......
......@@ -23,7 +23,12 @@ package de.monticore.lang.embeddedmontiarc;
import de.monticore.ModelingLanguageFamily;
import de.monticore.io.paths.ModelPath;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.*;
import de.monticore.lang.monticar.stream._symboltable.IStreamScope;
import de.monticore.lang.monticar.stream._symboltable.StreamGlobalScope;
import de.monticore.lang.monticar.stream._symboltable.StreamLanguage;
import de.monticore.lang.monticar.streamunits._symboltable.IStreamUnitsScope;
import de.monticore.lang.monticar.streamunits._symboltable.StreamUnitsGlobalScope;
import de.monticore.lang.monticar.streamunits._symboltable.StreamUnitsLanguage;
import de.monticore.lang.monticar.struct._symboltable.IStructScope;
import de.monticore.lang.monticar.struct._symboltable.StructGlobalScope;
import de.monticore.lang.monticar.struct._symboltable.StructLanguage;
......@@ -62,6 +67,33 @@ public class AbstractSymtabTest {
return scope;
}
protected static IStreamScope createSymTabStream(String... modelPath) {
final ModelPath mp = new ModelPath();
for (String m : modelPath) {
mp.addEntry(Paths.get(m));
}
StreamGlobalScope scope = new StreamGlobalScope(mp,
new StreamLanguage());
//TODO IMPLEMENT ME!D
//de.monticore.lang.monticar.Utils.addBuiltInTypes(scope);
return scope;
}
protected static IStreamUnitsScope createSymTabStreamUnits(String... modelPath) {
final ModelPath mp = new ModelPath();
for (String m : modelPath) {
mp.addEntry(Paths.get(m));
}
StreamUnitsGlobalScope scope = new StreamUnitsGlobalScope(mp,
new StreamUnitsLanguage());
//TODO IMPLEMENT ME!D
//de.monticore.lang.monticar.Utils.addBuiltInTypes(scope);
return scope;
}
public static StructGlobalScope createStructSymTab(String... modelPath) {
//TODO IMPLEMENT ME!F create general class which combines these
/*ModelingLanguageFamily fam = new ModelingLanguageFamily();
......
......@@ -52,6 +52,9 @@ public class ExpandedComponentInstanceTest extends AbstractSymtabTest {
Log.enableFailQuick(false);
}
//Cloning is not supported anymore as this would modify enclosing scope
@Ignore
@Deprecated
@Test
public void testClone() {
IEmbeddedMontiArcScope symTab = createSymTab("src/test/resources");
......@@ -59,12 +62,20 @@ public class ExpandedComponentInstanceTest extends AbstractSymtabTest {
".subComponentConnector2").orElse(null);
assertNotNull(inst);
//TODO IMPLEMENT ME!
/*EMAComponentInstantiationSymbol inst2 = EMAComponentInstantiationSymbolBuilder.clone(inst);
assertEquals(2, inst.getConnectors().size());
assertEquals(1, inst.getSubComponents().size());
Iterator<ASTEMAConnector> iter = inst.getConnectors().iterator();
while(iter.hasNext()){
ASTEMAConnector connector = iter.next();
}
//TODO IMPLEMENT ME!D
EMAComponentInstantiationSymbol inst2 = EMAComponentInstantiationSymbolBuilder.clone(inst);
assertEquals(inst.toString().trim(), inst2.toString().trim());
*/
}
//TODO IMPLEMENT ME!
......@@ -660,24 +671,24 @@ public class ExpandedComponentInstanceTest extends AbstractSymtabTest {
private void testConnectorCorrectnessForComponent(EMAComponentInstantiationSymbol inst) {
inst.getConnectorInstances().forEach(connectorSymbol -> {
assertNotNull(connectorSymbol.getSourcePort());
//TODO IMPLEMENT ME!
//TODO IMPLEMENT ME!D
assertNotNull(connectorSymbol.getTargetPortSymbols());
EMAPortSymbol sourcePort = connectorSymbol.getSourcePort();
//TODO IMPLEMENT ME!
//TODO IMPLEMENT ME!D
for (EMAPortSymbol targetPort : connectorSymbol
.getTargetPortSymbols()) {
System.out.println("source: " + sourcePort.getFullName());
//TODO IMPLEMENT ME!
//TODO IMPLEMENT ME!D
System.out.println("target: " + targetPort.getFullName() + "\n");
//TODO IMPLEMENT ME!
//TODO IMPLEMENT ME!D
assertNotEquals(sourcePort.getFullName(), targetPort.getFullName());
}
});
//TODO IMPLEMENT ME!
//TODO IMPLEMENT ME!D
inst.getSubComponents().forEach((a) -> {
testConnectorCorrectnessForComponent(a);
});
......
......@@ -26,7 +26,9 @@ import de.monticore.lang.embeddedmontiarc.embeddedmontiarc.StreamScanner;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.EMAComponentSymbol;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.EmbeddedMontiArcLanguage;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.IEmbeddedMontiArcScope;
import de.monticore.lang.monticar.stream._symboltable.IStreamScope;
import de.monticore.lang.monticar.streamunits._symboltable.ComponentStreamUnitsSymbol;
import de.monticore.lang.monticar.streamunits._symboltable.IStreamUnitsScope;
import de.monticore.lang.monticar.streamunits._symboltable.StreamUnitsLanguage;
import de.monticore.lang.monticar.struct._symboltable.StructLanguage;
import de.monticore.symboltable.GlobalScope;
......@@ -44,11 +46,13 @@ public class StreamScannerTest extends AbstractSymtabTest{
private static final Path BASE_PATH = Paths.get("src/test/resources");
@Ignore //TODO IMPLEMENT ME! NEEDS TO BE ENABLED
//TODO IMPLEMENT ME!D Is ENABLED Again
@Test
public void testMySuperNiceComponent() {
IEmbeddedMontiArcScope symTab = createSymTab(BASE_PATH.toString());
StreamScanner scanner = new StreamScanner(BASE_PATH, symTab);
IStreamScope symTabStream = createSymTabStream(BASE_PATH.toString());
IStreamUnitsScope symTabStreamUnits = createSymTabStreamUnits(BASE_PATH.toString());
StreamScanner scanner = new StreamScanner(BASE_PATH, symTab, symTabStream, symTabStreamUnits);
Map<EMAComponentSymbol, Set<ComponentStreamUnitsSymbol>> result = scanner.scan();
Assert.assertNotNull(result);
Assert.assertFalse(result.isEmpty());
......@@ -71,7 +75,7 @@ public class StreamScannerTest extends AbstractSymtabTest{
Assert.assertEquals(6, mySuperNiceStream1.getNamedStreams().size());
Assert.assertEquals(6, mySuperNiceStream2.getNamedStreams().size());
}
//TODO IMPLEMENT ME! different to abstractsymtabtest?, just extending abstractsymtab test for now
//TODO IMPLEMENT ME!D not different to abstractsymtabtest, just extending abstractsymtab test for now
/*private static IEmbeddedMontiArcScope createSymTab(String... modelPath) {
ModelingLanguageFamily fam = new ModelingLanguageFamily();
fam.addModelingLanguage(new EmbeddedMontiArcLanguage());
......
......@@ -25,6 +25,7 @@ import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.*;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc.unit.constant.EMAConstantSIUnit;
import de.monticore.lang.monticar.rangesg._ast.ASTRanges;
import de.monticore.lang.monticar.resolutions._ast.ASTResolutionDeclaration;
import de.monticore.lang.monticar.resolutions._ast.ASTUnitNumberExpression;
import de.monticore.lang.monticar.struct._symboltable.IStructScope;
import de.monticore.lang.monticar.struct._symboltable.StructGlobalScope;
import de.monticore.lang.monticar.struct._symboltable.StructSymbol;
......@@ -308,18 +309,15 @@ public class SymtabTest extends AbstractSymtabTest {
assertEquals(1, cs.getAllOutgoingPorts().size());
EMAPortSymbol port1 = cs.getOutgoingPort("steering").orElse(null);
assertNotNull(port1);
//TODO IMPLEMENT ME! Replace instanceof with visitor
System.out.println(port1.getTypeReference().getClass().getSimpleName());
Log.debug(port1.getTypeReference().getClass().getSimpleName(), "Class");
assertTrue(port1.getTypeReference() instanceof ASTNamedType);
assertEquals("B", ((ASTNamedType) port1.getTypeReference()).getName());
//TODO IMPLEMENT ME!D
//Log.debug(port1.getTypeReference().getReferencedSymbol().toString() + "", "TypeReference");
assertEquals(1, cs.getConnectors().size());
assertTrue(cs.getConnector("steering").isPresent());
ASTEMAConnector emaConnectorSymbol = cs.getConnector("steering").get();
//check that this is a constant connector
//TODO IMPLEMENT ME!
//TODO IMPLEMENT ME!D
Log.debug(emaConnectorSymbol.getSourcePort().toString(), "SourcePort: ");
assertTrue(emaConnectorSymbol.isConstant());
assertTrue(emaConnectorSymbol.getSourcePort().isConstant());
......@@ -345,8 +343,7 @@ public class SymtabTest extends AbstractSymtabTest {
EMAPortSymbol ps = symTab.resolveEMAPort("testing.PortArray.lightsIn[1]").orElse(null);
assertNotNull("EMAPortSymbol is null", ps);
//TODO IMPLEMENT ME!
//Log.debug(ps.getTypeReference().getReferencedSymbol().toString() + "", "TypeName");
//TODO IMPLEMENT ME!D
//check for all names
assertEquals(5, cs.getAllIncomingPorts().size());
assertEquals(5, cs.getAllOutgoingPorts().size());
......@@ -367,7 +364,7 @@ public class SymtabTest extends AbstractSymtabTest {
.orElse(null);
assertNotNull(componentSymbol);
//TODO IMPLEMENT ME! was portArray
//TODO IMPLEMENT ME!D was portArray
EMAPortArraySymbol pas = (EMAPortArraySymbol) symTab.resolveEMAPort("testing.PortArray"
+ ".lightsIn").orElse(null);
assertNotNull("EMAPortArraySymbol is null", pas);
......@@ -464,7 +461,7 @@ public class SymtabTest extends AbstractSymtabTest {
Log.debug("" + cs.getConnectors().size(), "Connectors");
assertEquals(50, cs.getConnectors().size());
Iterator<ASTEMAConnector> iter = cs.getConnectors().iterator();
//TODO IMPLEMENT ME!F
//TODO IMPLEMENT ME!D
//loop to check everything
int counter = 1;
while (iter.hasNext()) {
......@@ -489,7 +486,7 @@ public class SymtabTest extends AbstractSymtabTest {
portIndex -= 5;
}
assertEquals("target name is not correct", target.getName(), "lightsIn[" + portIndex + "]");
//TODO IMPLEMENT ME!
//TODO IMPLEMENT ME!D
assertEquals("target type is not Boolean",
((ASTNamedType) target.getTypeReference()).getName(),
"B");
......@@ -541,15 +538,15 @@ public class SymtabTest extends AbstractSymtabTest {
assertEquals("testing.ConnectorArraymn", target.getComponent().getFullName());
conn = (ASTEMAConnector) iter.next();
//TODO IMPLEMENT ME!
//TODO IMPLEMENT ME!D no link from connector to component anymore
//assertEquals("ConnectorSymbols not equal", conn.getComponent(), cs);
//for loop to check everything
source = conn.getSourcePort();
assertNotNull("EMAPortSymbol source is null", source);
assertTrue("EMAPortSymbol source is notIncoming", source.isIncoming());
assertEquals("EMAPortSymbol source name is not correct2", source.getName(), "sIn[2]");
//TODO IMPLEMENT ME!
//assertEquals("EMAPortSymbol sourceType is not correct", source.getTypeReference().getName(), "B");
//TODO IMPLEMENT ME!D
assertEquals("EMAPortSymbol sourceType is not correct", ((ASTNamedType)source.getTypeReference()).getName(), "B");
assertEquals("EMAPortSymbol connector is not correct", source.getComponent(), cs);
assertEquals(1, conn.getTargetPortSymbols().size());
......@@ -557,20 +554,20 @@ public class SymtabTest extends AbstractSymtabTest {
assertNotNull("target is null", target);
assertTrue("target is not outcoming", target.isOutgoing());
assertEquals("target name is not correct3", target.getName(), "sOut[3]");
//TODO IMPLEMENT ME!
//assertEquals("target type is not Boolean", target.getTypeReference().getName(), "B");
//TODO IMPLEMENT ME!D
assertEquals("target type is not Boolean", ((ASTNamedType)target.getTypeReference()).getName(), "B");
assertEquals("testing.ConnectorArraymn", target.getComponent().getFullName());
conn = (ASTEMAConnector) iter.next();
//TODO IMPLEMENT ME!
//TODO IMPLEMENT ME!D no link from connector to component anymore
//assertEquals("ConnectorSymbols not equal", conn.getComponent(), cs);
//for loop to check everything
source = conn.getSourcePort();
assertNotNull("EMAPortSymbol source is null", source);
assertTrue("EMAPortSymbol source is notIncoming", source.isIncoming());
assertEquals("EMAPortSymbol source name is not correct4", source.getName(), "sIn[3]");
//TODO IMPLEMENT ME!
//assertEquals("EMAPortSymbol sourceType is not correct", source.getTypeReference().getName(), "B");
//TODO IMPLEMENT ME!D
assertEquals("EMAPortSymbol sourceType is not correct", ((ASTNamedType)source.getTypeReference()).getName(), "B");
assertEquals("EMAPortSymbol connector is not correct", source.getComponent(), cs);
assertEquals(1, conn.getTargetPortSymbols().size());
......@@ -578,8 +575,8 @@ public class SymtabTest extends AbstractSymtabTest {
assertNotNull("target is null", target);
assertTrue("target is not outcoming", target.isOutgoing());
assertEquals("target name is not correct5", target.getName(), "sOut[4]");
//TODO IMPLEMENT ME!
//assertEquals("target type is not Boolean", target.getTypeReference().getName(), "B");
//TODO IMPLEMENT ME!D
assertEquals("target type is not Boolean", ((ASTNamedType)target.getTypeReference()).getName(), "B");
assertEquals("testing.ConnectorArraymn", target.getComponent().getFullName());
}
......@@ -761,15 +758,16 @@ public class SymtabTest extends AbstractSymtabTest {
}
assertEquals(2, inst.getSubComponents().size());
Iterator<EMAComponentInstantiationSymbol> iterator = inst.getSubComponents().iterator();
//TODO IMPLEMENT ME!
/*UnitNumberExpressionSymbol symbol1 =
(UnitNumberExpressionSymbol) iterator.next().getComponentType().getArguments().get(0).getSymbolOpt().get();
UnitNumberExpressionSymbol symbol2 =
(UnitNumberExpressionSymbol) iterator.next().getComponentType().getArguments().get(0).getSymbolOpt().get();
assertEquals("5", symbol1.getTextualRepresentation());
assertEquals("1", symbol2.getTextualRepresentation());
*/
//TODO IMPLEMENT ME!D
ASTExpression symbol1 = iterator.next()
.getArguments().get(0);
ASTExpression symbol2 = iterator.next()
.getArguments().get(0);
assertTrue(symbol1 instanceof ASTUnitNumberExpression);
assertTrue(symbol2 instanceof ASTUnitNumberExpression);
assertEquals((Double)5.0, ((ASTUnitNumberExpression)symbol1).getNumberWithUnit().getNumber().get());
assertEquals((Double)1.0, ((ASTUnitNumberExpression)symbol2).getNumberWithUnit().getNumber().get());
}
@Test
......@@ -802,38 +800,38 @@ public class SymtabTest extends AbstractSymtabTest {
cur = connectorSymbolIter.next();
assertEquals("in1[2]", cur.getSource().getQualifedNameAsString(true));
//TODO IMPLEMENT ME!
//assertEquals("pass.pin1[2]", cur.getTargetsAsString(false).stream().iterator().next());
//TODO IMPLEMENT ME!D
assertEquals("pass.pin1[2]", cur.getTargetsAsString(false).stream().iterator().next());
cur = connectorSymbolIter.next();
assertEquals("in1[1]", cur.getSource().getQualifedNameAsString(true));
//TODO IMPLEMENT ME!
//assertEquals("pass.pin1[3]", cur.getTargetsAsString(false).stream().iterator().next());
//TODO IMPLEMENT ME!D
assertEquals("pass.pin1[3]", cur.getTargetsAsString(false).stream().iterator().next());
cur = connectorSymbolIter.next();
assertEquals("in1[2]", cur.getSource().getQualifedNameAsString(true));
//TODO IMPLEMENT ME!
//assertEquals("pass.pin1[4]", cur.getTargetsAsString(false).stream().iterator().next());
//TODO IMPLEMENT ME!D
assertEquals("pass.pin1[4]", cur.getTargetsAsString(false).stream().iterator().next());
cur = connectorSymbolIter.next();
assertEquals("pass.pout1[1]", cur.getSource().getQualifedNameAsString(true));
//TODO IMPLEMENT ME!
//assertEquals("out1[1]", cur.getTargetsAsString(false).stream().iterator().next());
//TODO IMPLEMENT ME!D
assertEquals("out1[1]", cur.getTargetsAsString(false).stream().iterator().next());
cur = connectorSymbolIter.next();
assertEquals("pass.pout1[2]", cur.getSource().getQualifedNameAsString(true));
//TODO IMPLEMENT ME!
//assertEquals("out1[2]", cur.getTargetsAsString(false).stream().iterator().next());
//TODO IMPLEMENT ME!D
assertEquals("out1[2]", cur.getTargetsAsString(false).stream().iterator().next());
cur = connectorSymbolIter.next();
assertEquals("pass.pout1[3]", cur.getSource().getQualifedNameAsString(true));
//TODO IMPLEMENT ME!
//assertEquals("out1[3]", cur.getTargetsAsString(false).stream().iterator().next());
//TODO IMPLEMENT ME!D
assertEquals("out1[3]", cur.getTargetsAsString(false).stream().iterator().next());
cur = connectorSymbolIter.next();
assertEquals("pass.pout1[4]", cur.getSource().getQualifedNameAsString(true));
//TODO IMPLEMENT ME!
//assertEquals("out1[4]", cur.getTargetsAsString(false).stream().iterator().next());
//TODO IMPLEMENT ME!D
assertEquals("out1[4]", cur.getTargetsAsString(false).stream().iterator().next());
}
@Ignore //TODO IMPLEMENT ME! NEEDS TO BE ENABLED
@Ignore //TODO IMPLEMENT ME!F NEEDS TO BE ENABLED
@Test
public void testComponentWithStructPorts() {
IEmbeddedMontiArcScope symTab = createSymTab("src/test/resources");
......@@ -855,22 +853,22 @@ public class SymtabTest extends AbstractSymtabTest {
//TODO IMPLEMENT ME!F Resolve Struct Symbol based on imports in EmbeddedMontiArcScope
assertTrue(false);
//assertEquals("structures.S1", );
//TODO IMPLEMENT ME!
//assertTrue(s1 instanceof StructSymbol);
//TODO IMPLEMENT ME!F
assertTrue(s1 instanceof StructSymbol);
List<EMAPortSymbol> outPorts = new ArrayList<>(cmp.getAllOutgoingPorts());
assertEquals(1, outPorts.size());
EMAPortSymbol out1 = cmp.getOutgoingPort("out1").orElse(null);
assertNotNull(out1);
ASTType s2 = out1.getTypeReference();
assertTrue(s2 instanceof ASTResolvedType);
//TODO IMPLEMENT ME! StructSymbolResolve
//TODO IMPLEMENT ME!F StructSymbolResolve
assertEquals("structures.S2", ((ASTResolvedType) s2).getResolvedTypeSymbol().getFullName());
//TODO IMPLEMENT ME!
//TODO IMPLEMENT ME!F
//assertTrue(s2 instanceof StructSymbol);
}
//TODO IMPLEMENT ME!
@Ignore
//TODO IMPLEMENT ME!D
//@Ignore
@Test
public void testSymtabFAS() {
IEmbeddedMontiArcScope symTab = createSymTab("src/test/resources");
......
......@@ -38,7 +38,7 @@ public class InRosPortRosSenderTest extends AbstractTaggingCoCoTest {
Log.getFindings().clear();
}
//TODO IMPLEMENT ME!
//TODO IMPLEMENT ME!F
/*@Test
public void testValidRosToRos() {
testCoCosOnComponent("middleware.ros.cocos.RosToRosComp");
......
......@@ -35,7 +35,7 @@ import static org.junit.Assert.*;
public class TaggingTest extends AbstractTaggingResolverTest {
//TODO IMPLEMENT ME!
//TODO IMPLEMENT ME!F
/*@Test
public void testRosConnectionParsing() {
TaggingResolver symtab = createSymTabAndTaggingResolver("src/test/resources");
......
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