Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

rfe10008: java events test: should not require Xterm

Added command line option
--monitor true|false Try to start monitor.sh or not. Default: true.

Tests added for: none
make test-suite run? no - make prepush

Change-Id: I61fa152fd0028b5bd46a57785a209e9113543c5b
Reviewed-on: https://gerrit.franz.com:9080/676
Tested-by: Kevin Layer <layer@franz.com>
Reviewed-by: Kevin Layer <layer@franz.com>
  • Loading branch information...
commit bee4f49f661afbe6dc533424dd35b39479653a80 1 parent f0d75d2
@mikehinchey mikehinchey authored dklayer committed
Showing with 29 additions and 12 deletions.
  1. +29 −12 src/test/stress/Events.java
View
41 src/test/stress/Events.java
@@ -82,6 +82,8 @@
// OPEN OR RENEW
static private final boolean OPEN = false;
+ static private boolean MONITOR = true;
+
}
public static void trace(String format, Object... values) {
@@ -740,20 +742,24 @@ public Integer call() {
public static class Monitor {
static public void start(String phase) {
- try {
- String[] commands = new String[]{"monitor.sh", "start", phase};
- Runtime.getRuntime().exec(commands);
- } catch (IOException e) {
- trace("./monitor.sh was not started.");
+ if (Defaults.MONITOR) {
+ try {
+ String[] commands = new String[]{"monitor.sh", "start", phase};
+ Runtime.getRuntime().exec(commands);
+ } catch (IOException e) {
+ trace("./monitor.sh was not started.");
+ }
}
}
static public void stop() {
- try {
- String[] commands = new String[]{"monitor.sh", "end"};
- Runtime.getRuntime().exec(commands);
- } catch (IOException e) {
- trace("./monitor.sh was not stopped.");
+ if (Defaults.MONITOR) {
+ try {
+ String[] commands = new String[]{"monitor.sh", "end"};
+ Runtime.getRuntime().exec(commands);
+ } catch (IOException e) {
+ trace("./monitor.sh was not stopped.");
+ }
}
}
}
@@ -764,8 +770,19 @@ static public void stop() {
public static void main(String[] args) throws RepositoryException {
Thread.currentThread().setName("./events");
- if (args.length >= 2 && args[0].equals("--seed")) {
- RANDOM.setSeed(Long.parseLong(args[1]));
+ if (args.length > 0) {
+ if (args.length >= 2 && args[0].equals("--seed")) {
+ RANDOM.setSeed(Long.parseLong(args[1]));
+ }
+ if (args.length >= 4 && args[2].equals("--seed")) {
+ RANDOM.setSeed(Long.parseLong(args[3]));
+ }
+ if (args.length >= 2 && args[0].equals("--monitor")) {
+ Defaults.MONITOR = Boolean.parseBoolean(args[1]);
+ }
+ if (args.length >= 4 && args[2].equals("--monitor")) {
+ Defaults.MONITOR = Boolean.parseBoolean(args[3]);
+ }
}
if (Defaults.OPEN) {
Please sign in to comment.
Something went wrong with that request. Please try again.