A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
stringify exception message in java bindings
[simgrid.git]
/
teshsuite
/
java
/
SleepHostOff
/
SleepHostOff.java
diff --git
a/teshsuite/java/SleepHostOff/SleepHostOff.java
b/teshsuite/java/SleepHostOff/SleepHostOff.java
index
5aaef5b
..
c48cca7
100644
(file)
--- a/
teshsuite/java/SleepHostOff/SleepHostOff.java
+++ b/
teshsuite/java/SleepHostOff/SleepHostOff.java
@@
-14,13
+14,15
@@
class Sleeper extends Process {
super(host,name,args);
}
public void main(String[] args) {
super(host,name,args);
}
public void main(String[] args) {
- while (true) {
+ boolean stillAlive = true;
+ while (stillAlive) {
Msg.info("I'm not dead");
try {
Process.sleep(10);
Msg.info("I'm not dead");
try {
Process.sleep(10);
+ stillAlive = true;
} catch (HostFailureException e) {
} catch (HostFailureException e) {
+ stillAlive = false;
Msg.info("catch HostException: "+e.getLocalizedMessage());
Msg.info("catch HostException: "+e.getLocalizedMessage());
- break; //Break is needed to finalize the endless loop
}
}
}
}
}
}
@@
-32,7
+34,7
@@
class TestRunner extends Process {
}
public void main(String[] strings) throws MsgException {
}
public void main(String[] strings) throws MsgException {
- Host host = Host.
all()[1]
;
+ Host host = Host.
getByName("Tremblay")
;
Msg.info("**** **** **** ***** ***** Test Sleep ***** ***** **** **** ****");
Msg.info("Test sleep: Create a process on "+host.getName()+" that simply make periodic sleep, turn off "
Msg.info("**** **** **** ***** ***** Test Sleep ***** ***** **** **** ****");
Msg.info("Test sleep: Create a process on "+host.getName()+" that simply make periodic sleep, turn off "
@@
-60,8
+62,7
@@
public class SleepHostOff {
Msg.createEnvironment(args[0]);
Msg.createEnvironment(args[0]);
- Host[] hosts = Host.all();
- new TestRunner(hosts[0], "TestRunner", null).start();
+ new TestRunner(Host.getByName("Fafard"), "TestRunner", null).start();
Msg.run();
}
Msg.run();
}