Skip to content

Commit

Permalink
Use cheese external component in unit test (#478)
Browse files Browse the repository at this point in the history
Signed-off-by: Florian Dupuy <florian.dupuy@rte-france.com>
  • Loading branch information
flo-dup authored Jan 23, 2023
1 parent 1711ab6 commit 5dd9588
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 28 deletions.
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.

0 comments on commit 5dd9588

Please sign in to comment.