Commit a1e4c31b authored by hengwen's avatar hengwen
Browse files

Fix test

parent b31ae96e
Pipeline #139853 failed with stage
in 21 seconds
......@@ -12,6 +12,8 @@ dockerCleanUp(){
docker rm zookeeper
docker kill autopilot
docker rm autopilot
docker kill rpc-server
docker rm rpc-server
docker network rm simulation-network
......@@ -32,7 +34,6 @@ docker network create simulation-network
docker run \
--network="simulation-network" \
-d \
-p 2181:2181 \
--name=zookeeper \
zookeeper:latest
......@@ -41,21 +42,30 @@ docker run \
--network="simulation-network" \
--name=autopilot \
-d \
-p 10101:10101 \
-e "ZOO_SERVERS=localhost" \
-e "ZOO_SERVERS=zookeeper" \
registry.git.rwth-aachen.de/monticore/embeddedmontiarc/simulators/rmimodelserver:latest \
java -cp rmi-model-server.jar -Djava.rmi.server.codebase=file:rmi-model-server.jar \
-Djava.rmi.server.hostname=localhost rwth.rmi.model.server.RMIServer 10101 autopilots no_time os_linux
docker run \
--network="simulation-network" \
-d \
-e "ZOO_SERVERS=zookeeper" \
--name=rpc-server \
rpc-server:latest
docker build -t server-test-runner -f TestDockerfile ..
docker run --network="simulation-network" -e "ZOO_SERVERS=zookeeper" server-test-runner sh -c "cd restful && mvn test -s ../settings.xml"
# build simulator
cd $SIMULATOR_DIR
mvn install -s ../settings.xml -DskipTests
#cd $SIMULATOR_DIR
#mvn install -s ../settings.xml -DskipTests
cd "${SIMULATOR_DIR}/target"
#cd "${SIMULATOR_DIR}/target"
# start rpc-server(remote simulator)
java -cp "rpc-1.0.0-SNAPSHOT-jar-with-dependencies.jar:." server.rpc.RpcServer 6000 > /dev/null &
#java -cp "rpc-1.0.0-SNAPSHOT-jar-with-dependencies.jar:." server.rpc.RpcServer 6000 > /dev/null &
cd $CURR_DIR
mvn test -s ../settings.xml
#cd $CURR_DIR
#mvn test -s ../settings.xml
dockerCleanUp
......@@ -18,7 +18,7 @@ public class SimulationServiceTest extends TestCase {
int simID = SimulationDAO.create(scenarioID, 2);
SimulationService sim = new SimulationService(simID);
try {
sim.startSimulation(RegistryFactory.getDefaultRegistry());
sim.startSimulation(RegistryFactory.getZookeeperRegistry());
sim.getResult();
assertEquals(1, sim.getResult().size());
assertTrue(sim.getResult().get(0).getFrames().size() > 0);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment