mirror of https://github.com/apache/jclouds.git
Fix the Jetty start statement used in compute live tests
This commit is contained in:
parent
499e61b80d
commit
8c2e7435da
|
@ -57,14 +57,11 @@ public class JettyStatements {
|
||||||
|
|
||||||
public static Statement start() {
|
public static Statement start() {
|
||||||
return new StatementList(
|
return new StatementList(
|
||||||
literal("cd " + JETTY_HOME),
|
literal(String.format("JETTY_PORT=%d %s/bin/jetty.sh start", port, JETTY_HOME)),
|
||||||
literal("nohup java -jar start.jar jetty.port=" + port + " > start.out 2> start.err < /dev/null &"),
|
|
||||||
literal("test $? && sleep 1")); // in case it is slow starting the proc
|
literal("test $? && sleep 1")); // in case it is slow starting the proc
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Statement stop() {
|
public static Statement stop() {
|
||||||
return new StatementList(
|
return literal(JETTY_HOME + "/bin/jetty.sh stop");
|
||||||
literal("cd " + JETTY_HOME),
|
|
||||||
literal("./bin/jetty.sh stop"));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -303,8 +303,7 @@ public class StubComputeServiceIntegrationTest extends BaseComputeServiceLiveTes
|
||||||
clientNew.disconnect();
|
clientNew.disconnect();
|
||||||
|
|
||||||
String startJetty = new StringBuilder()
|
String startJetty = new StringBuilder()
|
||||||
.append("cd /usr/local/jetty").append('\n')
|
.append("JETTY_PORT=8080 /usr/local/jetty/bin/jetty.sh start").append('\n')
|
||||||
.append("nohup java -jar start.jar jetty.port=8080 > start.out 2> start.err < /dev/null &").append('\n')
|
|
||||||
.append("test $? && sleep 1").append('\n').toString();
|
.append("test $? && sleep 1").append('\n').toString();
|
||||||
|
|
||||||
clientNew.connect();
|
clientNew.connect();
|
||||||
|
@ -312,7 +311,7 @@ public class StubComputeServiceIntegrationTest extends BaseComputeServiceLiveTes
|
||||||
clientNew.disconnect();
|
clientNew.disconnect();
|
||||||
|
|
||||||
clientNew.connect();
|
clientNew.connect();
|
||||||
expect(clientNew.exec("cd /usr/local/jetty\n./bin/jetty.sh stop\n")).andReturn(EXEC_GOOD);
|
expect(clientNew.exec("/usr/local/jetty/bin/jetty.sh stop\n")).andReturn(EXEC_GOOD);
|
||||||
clientNew.disconnect();
|
clientNew.disconnect();
|
||||||
|
|
||||||
clientNew.connect();
|
clientNew.connect();
|
||||||
|
@ -534,4 +533,9 @@ public class StubComputeServiceIntegrationTest extends BaseComputeServiceLiveTes
|
||||||
super.testDestroyNodes();
|
super.testDestroyNodes();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void waitGracePeriodForDestroyedNodes() {
|
||||||
|
// Do not wait
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -684,7 +684,7 @@ public abstract class BaseComputeServiceLiveTest extends BaseComputeServiceConte
|
||||||
int toDestroy = refreshNodes().size();
|
int toDestroy = refreshNodes().size();
|
||||||
Set<? extends NodeMetadata> destroyed = client.destroyNodesMatching(inGroup(group));
|
Set<? extends NodeMetadata> destroyed = client.destroyNodesMatching(inGroup(group));
|
||||||
assertEquals(toDestroy, destroyed.size());
|
assertEquals(toDestroy, destroyed.size());
|
||||||
Uninterruptibles.sleepUninterruptibly(100, TimeUnit.SECONDS);
|
waitGracePeriodForDestroyedNodes();
|
||||||
for (NodeMetadata node : filter(client.listNodesDetailsMatching(all()), inGroup(group))) {
|
for (NodeMetadata node : filter(client.listNodesDetailsMatching(all()), inGroup(group))) {
|
||||||
assert node.getStatus() == Status.TERMINATED : node;
|
assert node.getStatus() == Status.TERMINATED : node;
|
||||||
assert view.utils().credentialStore().get("node#" + node.getId()) == null : "credential should have been null for "
|
assert view.utils().credentialStore().get("node#" + node.getId()) == null : "credential should have been null for "
|
||||||
|
@ -692,6 +692,10 @@ public abstract class BaseComputeServiceLiveTest extends BaseComputeServiceConte
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected void waitGracePeriodForDestroyedNodes() {
|
||||||
|
Uninterruptibles.sleepUninterruptibly(100, TimeUnit.SECONDS);
|
||||||
|
}
|
||||||
|
|
||||||
private Set<? extends NodeMetadata> refreshNodes() {
|
private Set<? extends NodeMetadata> refreshNodes() {
|
||||||
return filter(client.listNodesDetailsMatching(all()), and(inGroup(group), not(TERMINATED)));
|
return filter(client.listNodesDetailsMatching(all()), and(inGroup(group), not(TERMINATED)));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue