test
This commit is contained in:
parent
24012e3afc
commit
632662ee75
1 changed files with 24 additions and 11 deletions
|
@ -24,6 +24,7 @@ import java.awt.Dimension;
|
|||
import java.io.BufferedInputStream;
|
||||
import java.io.DataInputStream;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileNotFoundException;
|
||||
|
||||
import javax.swing.JFrame;
|
||||
import javax.swing.SwingUtilities;
|
||||
|
@ -34,10 +35,16 @@ import org.insa.graphs.model.io.BinaryGraphReader;
|
|||
import org.insa.graphs.model.io.BinaryPathReader;
|
||||
import org.insa.graphs.model.io.GraphReader;
|
||||
import org.insa.graphs.model.io.PathReader;
|
||||
import java.io.IOException;
|
||||
|
||||
public class DijkstraAlgorithmTest {
|
||||
|
||||
// TODO finish this
|
||||
public GraphReader reader;
|
||||
public Graph graph;
|
||||
public PathReader pathReader;
|
||||
public Path path;
|
||||
|
||||
@Before
|
||||
public void init() {
|
||||
// Visit these directory to see the list of available files on Commetud.
|
||||
|
@ -46,22 +53,28 @@ public class DijkstraAlgorithmTest {
|
|||
final String pathName = "./Paths/path_fr31insa_rangueil_r2.path";
|
||||
System.out.println("Working Directory = " + System.getProperty("user.dir"));
|
||||
// Create a graph reader.
|
||||
final GraphReader reader = new BinaryGraphReader(
|
||||
new DataInputStream(new BufferedInputStream(new FileInputStream(mapName))));
|
||||
try {
|
||||
final GraphReader reader = new BinaryGraphReader(
|
||||
new DataInputStream(new BufferedInputStream(new FileInputStream(mapName))));
|
||||
|
||||
// Read the graph. X
|
||||
final Graph graph = reader.read();
|
||||
// Read the graph. X
|
||||
final Graph graph = reader.read();
|
||||
|
||||
// Create a PathReader.
|
||||
final PathReader pathReader = new BinaryPathReader(new DataInputStream(new BufferedInputStream(new FileInputStream(pathName))));
|
||||
|
||||
// Read the path.
|
||||
final Path path = pathReader.readPath(graph);
|
||||
// Create a PathReader.
|
||||
final PathReader pathReader = new BinaryPathReader(new DataInputStream(new BufferedInputStream(new FileInputStream(pathName))));
|
||||
|
||||
// Read the path.
|
||||
final Path path = pathReader.readPath(graph);
|
||||
}
|
||||
catch (IOException e ) {}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testIsEmpty() {
|
||||
assertEquals(parameters.data.length == 0, this.queue.isEmpty());
|
||||
// TODO
|
||||
// fonction pour code au dessus
|
||||
// appeler constructeur dijkstra
|
||||
// donner le path à afficher en renvoyant le path de dijkstra dans path.
|
||||
public void Test_Dijkstra() {
|
||||
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue