-
Notifications
You must be signed in to change notification settings - Fork 0
/
TestSetter.java
33 lines (28 loc) · 1002 Bytes
/
TestSetter.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package test;
// edit these imports according to your project
import pipelineServer.*;
public class TestSetter {
public static void setClasses(DesignTest dt){
// set the server's Interface, e.g., "Server.class"
// don't forget to import the correct package e.g., "import server.Server"
dt.setServerInteface(Server.class);
// now fill in the other types according to their names
dt.setServerClass(MyServer.class);
dt.setClientHandlerInterface(ClientHandler.class);
dt.setClientHandlerClass(PipeGameClientHandler.class);
dt.setCacheManagerInterface(CacheManager.class);
dt.setCacheManagerClass(SolutionCacheManager.class);
dt.setSolverInterface(Solver.class);
dt.setSolverClass(LevelSolver.class);
}
// run your server here
static Server s;
public static void runServer(int port){
s=new MyServer(port);
s.start(new PipeGameClientHandler(new SolutionCacheManager(), new LevelSolver()));
}
// stop your server here
public static void stopServer(){
s.stop();
}
}