Commit d3eb7dc0 authored by legoc's avatar legoc

Added test

parent 50bd3ea4
/*
* Copyright 2015 Institut Laue-Langevin
*
* Licensed under the EUPL, Version 1.1 only (the "License");
* You may not use this work except in compliance with the Licence.
* You may obtain a copy of the Licence at:
*
* http://joinup.ec.europa.eu/software/page/eupl
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the Licence is distributed on an "AS IS" basis,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the Licence for the specific language governing permissions and
* limitations under the Licence.
*/
package fr.ill.ics.cameo.test;
import java.util.Date;
import fr.ill.ics.cameo.Application;
import fr.ill.ics.cameo.Server;
public class TestServerWithSimpleApplication {
public static void main(String[] args) {
int numberOfTimes = Integer.parseInt(args[0]);
Server server = new Server("tcp://localhost:10000");
Date d = new Date();
// loop the number of times.
for (int i = 0; i < numberOfTimes; ++i) {
// start the application.
Application.Instance application = server.start("simplejava");
try {
Thread.sleep(400);
} catch (InterruptedException e) {
}
System.out.println("finished application " + application);
}
server.terminate();
System.out.println("finished the application after " + ((new Date()).getTime() - d.getTime()) + "ms");
}
}
\ No newline at end of file
......@@ -52,7 +52,7 @@ public class TestStartWithSimpleApplication {
// the getString is blocking until the application finishes
application.waitFor();
System.out.println("finished application " + application);
}
......
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