package ch.zhaw.ads;

import org.junit.Test;
import org.junit.Before;
import static org.junit.Assert.*;
import java.util.*;
import java.io.*;

public class RouteServerTest {

    RouteServer routeServer;
    String input;

    @Before
    public void setUp() throws Exception {
        routeServer = new RouteServer();
        input = openFile("./build/resources/main/Swiss.txt");
    }

    @Test
    public void test1() {
        System.out.println(routeServer.execute(input));
    }

    // helper functions
    private String openFile(String name) throws Exception {
		BufferedReader br = new BufferedReader(
				new InputStreamReader(new FileInputStream(name), "ISO-8859-1"));
		StringBuffer b = new StringBuffer();
		String line;
		while ((line = br.readLine()) != null) {
			b.append(line);
			b.append('\n');
		}
		return b.toString();
    }
}

