Commit f3b2ceaf authored by legoc's avatar legoc

Renamed test error

parent 959c1d08
......@@ -50,6 +50,11 @@ target_link_libraries(result PUBLIC cameo zmq)
add_executable(testresult src/tests/TestResult.cpp)
target_link_libraries(testresult PUBLIC cameo zmq)
add_executable(error src/tests/Error.cpp)
target_link_libraries(error PUBLIC cameo zmq)
add_executable(testerror src/tests/TestError.cpp)
target_link_libraries(testerror PUBLIC cameo zmq)
......@@ -97,11 +102,6 @@ target_link_libraries(testnonsyncsubscribersandpublisher PUBLIC cameo zmq)
add_executable(testerror src/tests/TestErrorApplication.cpp)
target_link_libraries(testerror PUBLIC cameo zmq)
add_executable(teststartwitherror src/tests/TestStartWithErrorApplication.cpp)
target_link_libraries(teststartwitherror PUBLIC cameo zmq)
add_executable(testpublisherloop src/tests/TestPublisherLoopApplication.cpp)
target_link_libraries(testpublisherloop PUBLIC cameo zmq)
......
......@@ -136,7 +136,7 @@ public class TestSelector {
apps.add("testveryfastjava");
apps.add("teststopjava");
apps.add("testresultjava");
apps.add("starterrorjava");
apps.add("testerrorjava");
apps.add("startstoragejava");
apps.add("startpubjava");
apps.add("startnpubjava");
......@@ -148,7 +148,7 @@ public class TestSelector {
apps.add("testveryfastcpp");
apps.add("teststopcpp");
apps.add("testresultcpp");
apps.add("starterrorcpp");
apps.add("testerrorcpp");
apps.add("startstoragecpp");
apps.add("startpubcpp");
apps.add("startnpubcpp");
......@@ -159,13 +159,14 @@ public class TestSelector {
apps.add("testveryfastpy");
apps.add("teststoppy");
apps.add("testresultpy");
apps.add("testerrorpy");
}
else if (appName.equals("java")) {
apps.add("testsimplejava");
apps.add("testveryfastjava");
apps.add("teststopjava");
apps.add("testresultjava");
apps.add("starterrorjava");
apps.add("testerrorjava");
apps.add("startstoragejava");
apps.add("startpubjava");
apps.add("startnpubjava");
......@@ -178,7 +179,7 @@ public class TestSelector {
apps.add("testveryfastcpp");
apps.add("teststopcpp");
apps.add("testresultcpp");
apps.add("starterrorcpp");
apps.add("testerrorcpp");
apps.add("startstoragecpp");
apps.add("startpubcpp");
apps.add("startnpubcpp");
......@@ -190,6 +191,7 @@ public class TestSelector {
apps.add("testveryfastpy");
apps.add("teststoppy");
apps.add("testresultpy");
apps.add("testerrorpy");
}
else {
apps.add(appName);
......
......@@ -16,7 +16,7 @@
package fr.ill.ics.cameo.test;
public class TestErrorApplication {
public class Error {
public static void main(String[] args) {
......@@ -25,7 +25,7 @@ public class TestErrorApplication {
} catch (InterruptedException e) {
}
System.err.println("error");
System.err.println("Error");
System.exit(123);
}
......
......@@ -22,7 +22,7 @@ import fr.ill.ics.cameo.Application;
import fr.ill.ics.cameo.Server;
public class TestStartWithErrorApplication {
public class TestError {
public static void main(String[] args) {
......@@ -45,9 +45,9 @@ public class TestStartWithErrorApplication {
Application.Instance application = server.start("errorjava");
// the getString is blocking until the application finishes
application.waitFor();
int state = application.waitFor();
System.out.println("finished application " + application + " with exit code " + application.getExitCode());
System.out.println("Finished application " + application + " with state " + Application.State.toString(state) + " with exit code " + application.getExitCode());
}
} finally {
......@@ -55,7 +55,7 @@ public class TestStartWithErrorApplication {
Application.This.terminate();
}
System.out.println("finished the application after " + ((new Date()).getTime() - d.getTime()) + "ms");
System.out.println("Finished the application after " + ((new Date()).getTime() - d.getTime()) + "ms");
}
}
\ No newline at end of file
......@@ -65,14 +65,18 @@
<start executable="java" args="-classpath cameo-tests-jzmq/target/cameo-tests-jzmq-full.jar fr.ill.ics.cameo.test.TestResult"/>
</application>
<application name="errorjava" starting_time="0" stopping_time="1" multiple="no" restart="no" info_arg="no">
<start executable="java" args="-classpath cameo-tests-jzmq/target/cameo-tests-jzmq-full.jar fr.ill.ics.cameo.test.Error"/>
</application>
<application name="testerrorjava" starting_time="0" stopping_time="1" output_stream="yes" multiple="no" restart="no">
<start executable="java" args="-classpath cameo-tests-jzmq/target/cameo-tests-jzmq-full.jar fr.ill.ics.cameo.test.TestError"/>
</application>
<application name="errorjava" starting_time="0" stopping_time="1" multiple="no" restart="no" info_arg="no">
<start executable="java" args="-classpath cameo-tests-jzmq/target/cameo-tests-jzmq-full.jar fr.ill.ics.cameo.test.TestErrorApplication"/>
</application>
<application name="fastres" starting_time="0" stopping_time="1" multiple="yes" restart="no">
<start executable="java" args="-classpath cameo-tests-jzmq/target/cameo-tests-jzmq-full.jar fr.ill.ics.cameo.test.FastResultApplication"/>
......@@ -117,10 +121,6 @@
<application name="starterrorjava" starting_time="0" stopping_time="1" output_stream="yes" multiple="no" restart="no">
<start executable="java" args="-classpath cameo-tests-jzmq/target/cameo-tests-jzmq-full.jar fr.ill.ics.cameo.test.TestStartWithErrorApplication"/>
</application>
<application name="canceljava" starting_time="0" stopping_time="1" output_stream="yes" multiple="no" restart="no">
<start executable="java" args="-classpath cameo-tests-jzmq/target/cameo-tests-jzmq-full.jar fr.ill.ics.cameo.test.TestCancelApplication"/>
</application>
......@@ -223,14 +223,18 @@
<start executable="testresult"/>
</application>
<application name="errorcpp" starting_time="inf" stopping_time="1" output_stream="yes" log_directory="logs" multiple="no" restart="no">
<start executable="error"/>
</application>
<application name="testerrorcpp" starting_time="0" stopping_time="1" output_stream="yes" multiple="no" restart="no">
<start executable="testerror"/>
</application>
<application name="errorcpp" starting_time="inf" stopping_time="1" output_stream="yes" log_directory="logs" multiple="no" restart="no">
<start executable="testerror"/>
</application>
<application name="storagecpp" starting_time="0" stopping_time="1" output_stream="yes" log_directory="logs" multiple="no" restart="no">
<start executable="teststorage"/>
......@@ -268,10 +272,6 @@
<start executable="testnonsyncsubscribersandpublisher"/>
</application>
<application name="starterrorcpp" starting_time="0" stopping_time="1" output_stream="yes" multiple="no" restart="no">
<start executable="teststartwitherror"/>
</application>
<application name="cancelcpp" starting_time="0" stopping_time="1" output_stream="yes" log_directory="logs" multiple="no" restart="no">
<start executable="testcancel"/>
</application>
......@@ -382,6 +382,14 @@
<start executable="testresult.py"/>
</application>
<application name="errorpy" starting_time="0" stopping_time="1" output_stream="yes" log_directory="logs" multiple="no" restart="no">
<start executable="error.py"/>
</application>
<application name="testerrorpy" starting_time="0" stopping_time="1" output_stream="yes" log_directory="logs" multiple="no" restart="no">
<start executable="testerror.py"/>
</application>
<!-- Test apps -->
......
#!/usr/bin/python3 -u
import time
import sys
time.sleep(0.05)
print("Error")
sys.exit(123)
\ No newline at end of file
#!/usr/bin/python3 -u
import sys
import cameopy
numberOfTimes = 1 if len(sys.argv) < 3 else int(sys.argv[1])
print("Number of times:", numberOfTimes)
this = cameopy.This
this.init(sys.argv)
server = this.getServer()
for i in range(numberOfTimes):
app = server.start("errorpy", 0)
state = app.waitFor()
print("Finished the application", app.getNameId(),
"with state", state,
"and code", app.getExitCode())
......@@ -25,7 +25,7 @@ int main(int argc, char *argv[]) {
this_thread::sleep_for(chrono::milliseconds(50));
cout << "error" << endl;
cout << "Error" << endl;
return 123;
}
......@@ -14,11 +14,9 @@
* limitations under the Licence.
*/
#include <iostream>
#include <string>
#include <vector>
#include <sstream>
#include <cameo/cameo.h>
#include <iostream>
using namespace std;
using namespace cameo;
......@@ -37,15 +35,15 @@ int main(int argc, char *argv[]) {
{
Server& server = application::This::getServer();
// loop the number of times.
// Loop the number of times.
for (int i = 0; i < numberOfTimes; ++i) {
// start the application.
// Start the application.
unique_ptr<application::Instance> app = server.start("errorcpp");
application::State state = app->waitFor();
cout << "finished the application " << *app << " with state " << application::toString(state) << " and code " << app->getExitCode() << endl;
cout << "Finished the application " << *app << " with state " << application::toString(state) << " and code " << app->getExitCode() << endl;
}
}
......
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