Comparar commits

...

2 commits

Ver fichero

@ -15,6 +15,7 @@ import org.insa.graphs.model.io.BinaryGraphReader;
import org.insa.graphs.model.io.BinaryPathReader; import org.insa.graphs.model.io.BinaryPathReader;
import org.insa.graphs.model.io.GraphReader; import org.insa.graphs.model.io.GraphReader;
import org.insa.graphs.model.io.PathReader; import org.insa.graphs.model.io.PathReader;
import org.junit.BeforeClass;
import org.junit.Test; import org.junit.Test;
public class DijkstraAlgorithmTest { public class DijkstraAlgorithmTest {
@ -26,7 +27,7 @@ public class DijkstraAlgorithmTest {
public Path path; public Path path;
//@Before @BeforeClass
public void init() { public void init() {
// Visit these directory to see the list of available files on Commetud. // Visit these directory to see the list of available files on Commetud.
// When running with VSC, paths are relative to the BE_Graphes directory. // When running with VSC, paths are relative to the BE_Graphes directory.
@ -40,9 +41,13 @@ public class DijkstraAlgorithmTest {
// Read the graph. X // Read the graph. X
this.graph = reader.read(); this.graph = reader.read();
// free resources
reader.close();
// Create a PathReader. // Create a PathReader.
final PathReader pathReader = new BinaryPathReader(new DataInputStream(new BufferedInputStream(new FileInputStream(pathName)))); final PathReader pathReader = new BinaryPathReader(new DataInputStream(new BufferedInputStream(new FileInputStream(pathName))));
// free resources
pathReader.close();
// Read the path. // Read the path.
this.path = pathReader.readPath(graph); this.path = pathReader.readPath(graph);