Пример #1
0
  @Test
  public void upperAndLowerBoundsTest() {

    graphExample2.createBounds();

    Map<Long, Integer> realValueUpper =
        new SimpleMap<Long, Integer>(2l, 2, 6l, 11, 3l, 11, 1l, 10, 5l, 13, 4l, 10, 0l, 4, 7l, 15);
    Map<Long, Integer> realValueLower =
        new SimpleMap<Long, Integer>(2l, 1, 6l, 3, 3l, 4, 1l, 2, 5l, 2, 4l, 1, 0l, 2, 7l, 2);

    assertEquals(true, MapUtils.equalMaps(realValueUpper, graphExample2.getEdgesUpperBound()));
    assertEquals(true, MapUtils.equalMaps(realValueLower, graphExample2.getEdgesLowerBound()));

    // Upper cost test
    assertEquals(10, graphExample2.getEdgeUpperCost(1l));
    assertEquals(2, graphExample2.getEdgeUpperCost(2l));
    assertEquals(15, graphExample2.getEdgeUpperCost(7l));

    // Lower cost test
    assertEquals(2, graphExample2.getEdgeLowerCost(1l));
    assertEquals(1, graphExample2.getEdgeLowerCost(2l));
    assertEquals(2, graphExample2.getEdgeLowerCost(7l));
  }
Пример #2
0
 @Test
 public void generateExample2Test() {
   assertEquals(7, graphExample2.getNumberOfNodes());
   assertEquals(8, graphExample2.getNumberOfEdges());
 }
Пример #3
0
 @Test
 public void generateMonacoTest() {
   assertEquals(751, graphMonaco.getNumberOfNodes());
   assertEquals(1306, graphMonaco.getNumberOfEdges());
 }