Search in sources :

Example 16 with AeshTestConnection

use of org.infinispan.server.test.core.AeshTestConnection in project infinispan by infinispan.

the class RollingUpgradeDynamicStoreCliIT method doRollingUpgrade.

@Override
protected void doRollingUpgrade(RestClient client) {
    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 synchronize --cache=" + CACHE_NAME);
    }
}
Also used : AeshDelegatingShell(org.infinispan.cli.impl.AeshDelegatingShell) AeshTestConnection(org.infinispan.server.test.core.AeshTestConnection)

Example 17 with AeshTestConnection

use of org.infinispan.server.test.core.AeshTestConnection in project infinispan by infinispan.

the class ManagedConnectionOperations method testDataSourceCLI.

@Test
public void testDataSourceCLI() {
    try (AeshTestConnection terminal = new AeshTestConnection()) {
        CLI.main(new AeshDelegatingShell(terminal), new String[] {}, new Properties());
        terminal.send("connect " + SERVERS.getTestServer().getDriver().getServerAddress(0).getHostAddress() + ":11222");
        terminal.assertContains("//containers/default]>");
        terminal.clear();
        terminal.send("server datasource ls");
        terminal.assertContains(database.getType());
        terminal.clear();
        terminal.send("server datasource test " + database.getType());
        terminal.assertContains("ISPN012502: Connection to data source '" + database.getType() + "' successful");
    }
}
Also used : AeshDelegatingShell(org.infinispan.cli.impl.AeshDelegatingShell) AeshTestConnection(org.infinispan.server.test.core.AeshTestConnection) Properties(java.util.Properties) Test(org.junit.Test)

Example 18 with AeshTestConnection

use of org.infinispan.server.test.core.AeshTestConnection in project infinispan by infinispan.

the class RollingUpgradeCliIT method doRollingUpgrade.

protected void doRollingUpgrade(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 synchronize --cache=" + CACHE_NAME);
    }
}
Also used : AeshDelegatingShell(org.infinispan.cli.impl.AeshDelegatingShell) AeshTestConnection(org.infinispan.server.test.core.AeshTestConnection)

Example 19 with AeshTestConnection

use of org.infinispan.server.test.core.AeshTestConnection in project infinispan by infinispan.

the class RollingUpgradeDynamicStoreCliIT method disconnectSource.

@Override
protected void disconnectSource(RestClient client) {
    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 disconnect --cache=" + CACHE_NAME);
    }
}
Also used : AeshDelegatingShell(org.infinispan.cli.impl.AeshDelegatingShell) AeshTestConnection(org.infinispan.server.test.core.AeshTestConnection)

Example 20 with AeshTestConnection

use of org.infinispan.server.test.core.AeshTestConnection in project infinispan by infinispan.

the class CliIT method testCliCredentials.

@Test
public void testCliCredentials() {
    try (AeshTestConnection terminal = new AeshTestConnection()) {
        CLI.main(new AeshDelegatingShell(terminal), new String[] {}, properties);
        String keyStore = Paths.get(System.getProperty("build.directory", ""), "key.store").toAbsolutePath().toString();
        terminal.send("credentials add --path=" + keyStore + " --password=secret --credential=credential password");
        terminal.send("credentials add --path=" + keyStore + " --password=secret --credential=credential another");
        terminal.clear();
        terminal.send("credentials ls --path=" + keyStore + " --password=secret");
        terminal.assertContains("password");
        terminal.assertContains("another");
    }
}
Also used : AeshDelegatingShell(org.infinispan.cli.impl.AeshDelegatingShell) AeshTestConnection(org.infinispan.server.test.core.AeshTestConnection) Test(org.junit.Test)

Aggregations

AeshTestConnection (org.infinispan.server.test.core.AeshTestConnection)23 AeshDelegatingShell (org.infinispan.cli.impl.AeshDelegatingShell)19 Test (org.junit.Test)14 File (java.io.File)3 Path (java.nio.file.Path)3 Properties (java.util.Properties)3 ZipFile (java.util.zip.ZipFile)2 IOException (java.io.IOException)1 List (java.util.List)1 Consumer (java.util.function.Consumer)1 Matcher (java.util.regex.Matcher)1 Pattern (java.util.regex.Pattern)1 Collectors (java.util.stream.Collectors)1 Stream (java.util.stream.Stream)1 Config (org.aesh.terminal.utils.Config)1 CLI (org.infinispan.cli.commands.CLI)1 CommonsTestingUtil (org.infinispan.commons.test.CommonsTestingUtil)1 Util (org.infinispan.commons.util.Util)1 BackupConfiguration (org.infinispan.configuration.cache.BackupConfiguration)1 CacheMode (org.infinispan.configuration.cache.CacheMode)1