1 package edu.uci.ics.jung.graph;
2
3 import junit.framework.TestCase;
4
5
6 public class SparseGraphAddRemoveAddEdgeTest extends TestCase {
7
8 SparseGraph<String,Integer> g;
9
10
11 @Override
12 protected void setUp() throws Exception {
13 super.setUp();
14 g = new SparseGraph<String,Integer>();
15 }
16
17 public void testAddRemoveAddEdge() {
18 g.addVertex("A"); g.addVertex("B");
19 g.addEdge(1, "A", "B");
20 g.removeEdge(1); // Remove the edge between A and B
21 g.addEdge(2, "A", "B"); // Then add a different edge -> Exception thrown
22
23 }
24
25 }