use of org.infinispan.cli.impl.AeshDelegatingShell in project infinispan by infinispan.
the class XSiteCliOperations method doWithTerminal.
private void doWithTerminal(Consumer<AeshTestConnection> consumer) {
try (AeshTestConnection terminal = new AeshTestConnection()) {
CLI.main(new AeshDelegatingShell(terminal), new String[] {}, properties);
consumer.accept(terminal);
}
}
use of org.infinispan.cli.impl.AeshDelegatingShell in project infinispan by infinispan.
the class RollingUpgradeCliIT method disconnectSource.
protected void disconnectSource(RestClient client) {
try (AeshTestConnection terminal = new AeshTestConnection()) {
CLI.main(new AeshDelegatingShell(terminal), new String[] {}, properties);
terminal.send("connect " + target.driver.getServerAddress(0).getHostAddress() + ":" + target.getSinglePort(0));
terminal.assertContains("//containers/default]>");
terminal.clear();
terminal.send("migrate cluster disconnect --cache=" + CACHE_NAME);
}
}
use of org.infinispan.cli.impl.AeshDelegatingShell in project infinispan by infinispan.
the class RollingUpgradeDynamicStoreCliIT method assertSourceDisconnected.
@Override
protected void assertSourceDisconnected() {
try (AeshTestConnection terminal = new AeshTestConnection()) {
CLI.main(new AeshDelegatingShell(terminal), new String[] {}, properties);
connectToCluster(terminal, target);
terminal.assertContains("//containers/default]>");
terminal.clear();
terminal.send("migrate cluster source-connection --cache=" + CACHE_NAME);
terminal.assertContains("Not Found");
}
}
use of org.infinispan.cli.impl.AeshDelegatingShell in project infinispan by infinispan.
the class RollingUpgradeDynamicStoreCliIT method assertSourceConnected.
@Override
protected void assertSourceConnected() {
try (AeshTestConnection terminal = new AeshTestConnection()) {
CLI.main(new AeshDelegatingShell(terminal), new String[] {}, properties);
connectToCluster(terminal, target);
terminal.assertContains("//containers/default]>");
terminal.clear();
terminal.send("migrate cluster source-connection --cache=" + CACHE_NAME);
terminal.assertContains("remote-store");
}
}
use of org.infinispan.cli.impl.AeshDelegatingShell in project infinispan by infinispan.
the class RollingUpgradeDynamicStoreCliIT method connectTargetCluster.
@Override
protected void connectTargetCluster() {
try {
String cfg = new String(Files.readAllBytes(dest), StandardCharsets.UTF_8);
cfg = cfg.replace("127.0.0.1", source.driver.getServerAddress(0).getHostAddress());
cfg = cfg.replace("11222", Integer.toString(source.getSinglePort(0)));
Files.write(dest, cfg.getBytes(StandardCharsets.UTF_8), StandardOpenOption.TRUNCATE_EXISTING);
} catch (IOException e) {
throw new RuntimeException(e);
}
try (AeshTestConnection terminal = new AeshTestConnection()) {
CLI.main(new AeshDelegatingShell(terminal), new String[] {}, properties);
connectToCluster(terminal, target);
terminal.assertContains("//containers/default]>");
terminal.clear();
terminal.send("migrate cluster connect --file=" + dest + " --cache=" + CACHE_NAME);
terminal.clear();
terminal.send("migrate cluster source-connection --cache=" + CACHE_NAME);
terminal.assertContains("remote-store");
}
}
Aggregations