Skip to content

#159 CoCo für Falsch Verbundene Connections#89

Draft
marcelgruen7-art wants to merge 10 commits intorelease/7.8.xfrom
mg/159/missing-cocos
Draft

#159 CoCo für Falsch Verbundene Connections#89
marcelgruen7-art wants to merge 10 commits intorelease/7.8.xfrom
mg/159/missing-cocos

Conversation

@marcelgruen7-art
Copy link
Copy Markdown
Collaborator

Changelog

Changed
  • alle CoCos für Connections zwischen Parent und Subkomponente erstellt (#159)
  • Test der CoCos ohne AST der Subkomponente (#159)

SysMLv2Mill.addCollectionTypes();
Log.clearFindings();
}
/**
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Entweder die Methode entfernen, oder die Sym-Files. Falls zweiteres, dann bietet es sich an die Methode mit "BeforeAll" zu mergen und die Sym-File nach target/ zu generieren

* Ziel: Testen, dass CoCos auch ohne direkten Zugriff auf das AST funktionieren,
* wenn nur die SymbolTable zur Verfügung steht.
*/
public class SymbolTableCreationTest {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Die Klasse testet die CoCo und sollte entsprechend umbenannt werden

var checker = new SysMLv2CoCoChecker();
checker.addCoCo(new ParentSubConnectionCoCo());
checker.checkAll(ast);
assertThat(Log.getFindings()).isEmpty(); //Correkt example
Copy link
Copy Markdown
Contributor

@mathias-pfeiffer mathias-pfeiffer Apr 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
assertThat(Log.getFindings()).isEmpty(); //Correkt example
assertThat(Log.getFindings()).isEmpty(); // Correct example

Ich würde eher den Test treffend benennen: testValidConnections()

checker.addCoCo(new ParentSubConnectionCoCo());
checker.checkAll(ast);
assertThat(Log.getFindings()).isEmpty(); //Correkt example
System.out.println(Log.getFindings());
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Keine Print-Statements

Suggested change
System.out.println(Log.getFindings());


import static org.assertj.core.api.Assertions.assertThat;

public class ParentComponentInputConnectionDirectionCoCoTest {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Es gibt also bereits einen Test zu der CoCo -> keine neuen Klassen erstellen sondern in die existierenden schreiben!

import java.util.List;
import java.util.Optional;

/**
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Kommentare nicht entfernen, höchstens updaten

protected PortUsageSymbol resolvePortOfSubPart(ISysMLPartsScope scope,
String qname) {
// Split "a.out" into part "a" and port "out"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unnötige Änderungen vermeiden

}
}

/**
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/**
/**

// Determine if endpoints reference subcomponents
boolean tgtIsSub = isSubcomponentEndpoint(tgtQName);
boolean srcIsSub = isSubcomponentEndpoint(srcQName);
boolean tgtIsSub = isSubcomp(tgtQName);
Copy link
Copy Markdown
Contributor

@mathias-pfeiffer mathias-pfeiffer Apr 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Brauchen wir diese ganzen Fälle wirklich, oder reicht es zu prüfen, dass beide Seiten der Connections den selben Typen, also die selbe PortDef, angeben, einmal normal und einmal invertiert (die SysML sagt "konjugiert", "~")? Falls beide Enden PortUsages sind, aber die PortDefs nicht passen könnte man noch die Attribute vergleichen, aber das würde ich erstmal auf den nächsten PR schieben.

return portAttributeUsageAST.getModifier();
}

protected boolean portIsInput(PortUsageSymbol symbol) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Siehe oben, diese Methoden sind mir ein Dorn im Auge. Die scheinen eigentlich nur dazu da zu sein die Fehlermeldung anzupassen, der zugrundeliegende Check "sind die Enden kompatibel" braucht diese Information nicht

@mathias-pfeiffer mathias-pfeiffer marked this pull request as draft April 2, 2026 06:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants