package a4_p01_JS_MJ_test;

public class a4Test {

}

@@ -25,29 +25,2004 @@
 t;%0A%0A
-public class a4Test %7B%0A
+import static org.junit.Assert.assertTrue;%0Aimport static org.junit.Assert.fail;%0A%0Aimport java.util.ArrayList;%0Aimport java.util.List;%0A%0Aimport org.jgrapht.Graph;%0Aimport org.jgrapht.WeightedGraph;%0Aimport org.jgrapht.graph.DefaultEdge;%0Aimport org.jgrapht.graph.DefaultWeightedEdge;%0Aimport org.jgrapht.graph.Pseudograph;%0Aimport org.junit.BeforeClass;%0Aimport org.junit.Test;%0A%0Aimport a1_p01_JS_MJ.GraphParser;%0Aimport a1_p01_JS_MJ.GraphvizAdapter;%0Aimport a1_p01_JS_MJ.SearchResult;%0Aimport a2_p01_JS_MJ.AttributedNode;%0Aimport a2_p01_JS_MJ.GraphGenerator;%0Aimport a3_p01_JS_MJ.Kruskal;%0Aimport a4_p01_JS_MJ.Fleury;%0Aimport a4_p01_JS_MJ.Hierholzer;%0A%0Apublic class a4Test %7B%0A%0A%09static Graph graphk5;%0A%09static WeightedGraph%3CAttributedNode%3CString%3E, DefaultWeightedEdge%3E genGraph;%0A%09%0A%09@BeforeClass%0A%09public static void init() %7B%09%09%0A%09%09try %7B%0A%09%09%09graphk5 = GraphParser.parseGraphFile(%22GraphK5.gka%22);%0A%09%09%7D catch(Exception ex) %7B%0A%09%09%09ex.printStackTrace();%0A%09%09%7D%0A%09%09genGraph = GraphGenerator.generateAttributedWeightedGraph(150, 30);%0A%09%7D%0A%09%0A%09@Test%0A%09public void fleury_test()%7B%0A%09%09Fleury%3CString%3E fleury = new Fleury%3CString%3E();%0A%09%09SearchResult result = fleury.search((Pseudograph%3CString, DefaultEdge%3E) graphk5);%0A%09%09printTestResult(%22Test 1: Fleury - Graph K5%22, result);%0A%09%09System.out.println(%22Test Green.%22);%0A%09%09System.out.println(%22%22);%0A%09%7D%0A%09%0A%09@Test%0A%09public void hierholzer_test()%7B%0A%09%09Hierholzer%3CString%3E hierholzer = new Hierholzer%3CString%3E();%0A%09%09SearchResult result = hierholzer.algorithm((Pseudograph%3CString, DefaultEdge%3E) graphk5);%0A%09%09printTestResult(%22Test 1: Fleury - Graph K5%22, result);%0A%09%09System.out.println(%22Test Green.%22);%0A%09%09System.out.println(%22%22);%0A%09%7D%0A%09%0A%09public void printTestResult(String testname, SearchResult result)%7B%0A%09%09System.out.println(testname);%0A%09%09System.out.print(%22Path: %22);%0A%09%09for(DefaultEdge s : (ArrayList%3CDefaultEdge%3E) result.getPath())%7B%0A%09%09%09System.out.print(s+%22, %22);%0A%09%09%7D%0A%09%09System.out.println(%22%22);%0A%09%09System.out.println(%22Path Length %22 + result.getPathLength()+1);%0A%09%09System.out.println(%22Accssess Counter: %22 + result.getAccsessCounter());%0A%09%7D
 %0A%7D%0A

Test with K5 graph for fleury and hierholzer added.