Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SLD] Use cheese external component in unit test #478

Merged
merged 1 commit into from
Jan 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -25,32 +25,32 @@
* @author Benoit Jeanson <benoit.jeanson at rte-france.com>
*/
public class TestAddExternalComponent extends AbstractTestCaseRaw {
private static final String PACMAN = "PACMAN";
private static final String CHEESE = "CHEESE";

@Before
public void setUp() {
VoltageLevelRawBuilder vlBuilder = rawGraphBuilder.createVoltageLevelBuilder("vl", 380);
BusNode bbs = vlBuilder.createBusBarSection("bbs", 1, 1);
FeederNode load = vlBuilder.createLoad("l", 0, TOP);
SwitchNode d = vlBuilder.createSwitchNode(SwitchNode.SwitchKind.DISCONNECTOR, "d", false, false);
Node pacMan = NodeFactory.createEquipmentNode(vlBuilder.getGraph(), Node.NodeType.INTERNAL, "pacMan", null, null, PACMAN, false);
Node cheese = NodeFactory.createEquipmentNode(vlBuilder.getGraph(), Node.NodeType.INTERNAL, "cheese", null, null, CHEESE, false);
SwitchNode b = vlBuilder.createSwitchNode(SwitchNode.SwitchKind.BREAKER, "b", false, false);
vlBuilder.connectNode(bbs, d);
vlBuilder.connectNode(d, b);
vlBuilder.connectNode(b, pacMan);
vlBuilder.connectNode(pacMan, load);
vlBuilder.connectNode(b, cheese);
vlBuilder.connectNode(cheese, load);
}

@Override
protected ResourcesComponentLibrary getResourcesComponentLibrary() {
return new ResourcesComponentLibrary("pacman", "/ConvergenceLibrary", "/PacmanLibrary");
return new ResourcesComponentLibrary("cheese", "/ConvergenceLibrary", "/CheeseLibrary");
}

@Test
public void test() {
VoltageLevelGraph g = rawGraphBuilder.buildVoltageLevelGraph("vl");
voltageLevelGraphLayout(g);
assertEquals(toString("/TestPacman.svg"),
toSVG(g, "/TestPacman.svg", getRawLabelProvider(), new BasicStyleProvider()));
assertEquals(toString("/TestCheese.svg"),
toSVG(g, "/TestCheese.svg", getRawLabelProvider(), new BasicStyleProvider()));
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* ----------------------------------------------------------------------- */
/* File : components.css ------------------------------------------------- */
/* Stroke black */
.sld-pacman {stroke-width: 1; stroke: blue; fill:white}
.sld-cheese {stroke-width: 2; stroke: blue; fill:white}
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
{
"components" : [ {
"type" : "PACMAN",
"type" : "CHEESE",
"anchorPoints" : [ {
"x" : 0.0,
"y" : -10.0,
"y" : -12.0,
"orientation" : "VERTICAL"
}, {
"x" : 0.0,
"y" : 10.0,
"y" : 12.0,
"orientation" : "VERTICAL"
} ],
"size" : {
"width" : 20.0,
"height" : 20.0
"width" : 24.0,
"height" : 24.0
},
"transformations" : { "LEFT":"ROTATION", "RIGHT":"ROTATION" },
"styleClass" : "sld-pacman",
"styleClass" : "sld-cheese",
"subComponents" : [ {
"name" : "PACMAN",
"fileName" : "pacman.svg"
"name" : "CHEESE",
"fileName" : "cheese.svg"
} ]
} ]
}

This file was deleted.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.