本文整理汇总了Java中org.springframework.shell.core.CommandResult类的典型用法代码示例。如果您正苦于以下问题:Java CommandResult类的具体用法?Java CommandResult怎么用?Java CommandResult使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
CommandResult类属于org.springframework.shell.core包,在下文中一共展示了CommandResult类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: test_createAndRemoveVolume
import org.springframework.shell.core.CommandResult; //导入依赖的package包/类
@Test
public void test_createAndRemoveVolume() {
// Create volume
CommandResult result = createVolume(volumeName);
assertThat("Volume created", result, ShellMatchers.isSuccessfulCommand());
assertEquals(volumeName, result.getResult().toString());
// List volumes and check
result = listVolumes();
assertThat("List of volumes contains volume name",
result.getResult().toString(), containsString(volumeName));
// Remove volume
result = removeVolume(volumeName);
assertThat(result, ShellMatchers.isSuccessfulCommand());
}
示例2: test_shouldSelectAnApplication
import org.springframework.shell.core.CommandResult; //导入依赖的package包/类
@Test
public void test_shouldSelectAnApplication() {
connect();
createApplication();
try {
disconnect();
connect();
CommandResult result = useApplication(applicationName);
assertThat(result, isSuccessfulCommand());
assertThat(result.getResult().toString(), containsString(applicationName.toLowerCase()));
} finally {
connect();
removeApplication();
disconnect();
}
}
示例3: test_shouldStopAnApplicationWithArgs
import org.springframework.shell.core.CommandResult; //导入依赖的package包/类
@Test
public void test_shouldStopAnApplicationWithArgs() {
connect();
createApplication();
try {
disconnect();
connect();
CommandResult result = stopApplication();
assertThat(result, isSuccessfulCommand());
assertThat(result.getResult().toString(), containsString("stopped"));
assertThat(result.getResult().toString(), containsString(applicationName.toLowerCase()));
} finally {
removeApplication();
disconnect();
}
}
示例4: test_shouldNotStopAnApplicationBecauseUserIsNotLogged
import org.springframework.shell.core.CommandResult; //导入依赖的package包/类
@Test
public void test_shouldNotStopAnApplicationBecauseUserIsNotLogged() {
connect();
createApplication();
try {
disconnect();
CommandResult result = stopCurrentApplication();
assertThat(result, isFailedCommand());
assertThat(result.getException().getMessage(), containsString("You are not connected"));
} finally {
connect();
removeApplication();
disconnect();
}
}
示例5: test_shouldNotStopAnApplicationBecauseNoApplicationSelected
import org.springframework.shell.core.CommandResult; //导入依赖的package包/类
@Test
public void test_shouldNotStopAnApplicationBecauseNoApplicationSelected() {
connect();
createApplication();
try {
disconnect();
connect();
CommandResult result = stopCurrentApplication();
assertThat(result, isFailedCommand());
assertThat(result.getException().getMessage(), containsString("not selected"));
} finally {
removeApplication();
disconnect();
}
}
示例6: test_shouldStartAnApplicatioWithArgs
import org.springframework.shell.core.CommandResult; //导入依赖的package包/类
@Test
public void test_shouldStartAnApplicatioWithArgs() {
connect();
createApplication();
stopCurrentApplication();
try {
CommandResult result = startApplication();
assertThat(result, isSuccessfulCommand());
assertThat(result.getResult().toString(), containsString("started"));
assertThat(result.getResult().toString(), containsString(applicationName.toLowerCase()));
} finally {
removeApplication();
disconnect();
}
}
示例7: test_shouldNotRemoveEnvironmentVariableEmptyKey
import org.springframework.shell.core.CommandResult; //导入依赖的package包/类
@Test
public void test_shouldNotRemoveEnvironmentVariableEmptyKey() {
connect();
createApplication();
try {
CommandResult result;
result = createEnvironmentVariable("key", "value");
assumeThat(result, isSuccessfulCommand());
result = removeEnvironmentVariable("");
assertThat(result, isFailedCommand());
} finally {
removeApplication();
disconnect();
}
}
示例8: test_shouldListAlias
import org.springframework.shell.core.CommandResult; //导入依赖的package包/类
@Test
public void test_shouldListAlias() {
connect();
createApplication();
try {
addAlias();
CommandResult result = listAliasesCurrentApplication();
assertThat(result, isSuccessfulCommand());
assertThat(result.getResult().toString(), containsString("1"));
assertThat(result.getResult().toString(), containsString("found"));
} finally {
removeApplication();
disconnect();
}
}
示例9: test_shouldListModules
import org.springframework.shell.core.CommandResult; //导入依赖的package包/类
@Test
public void test_shouldListModules() {
connect();
createApplication();
try {
CommandResult result = addModule("mysql-5-5");
Assume.assumeThat(result, isSuccessfulCommand());
result = displayModules();
assertThat(result, isSuccessfulCommand());
assertThat(result.getResult().toString(), containsString("1"));
assertThat(result.getResult().toString(), containsString("found"));
} finally {
removeApplication();
disconnect();
}
}
示例10: test_shouldRemoveAliasWithArgs
import org.springframework.shell.core.CommandResult; //导入依赖的package包/类
@Test
public void test_shouldRemoveAliasWithArgs() {
CommandResult result;
connect();
createApplication();
addAlias();
try {
result = removeAlias();
assertThat(result, isSuccessfulCommand());
assertThat(result.getResult().toString(), containsString("removed"));
assertThat(result.getResult().toString(), containsString(ALIAS));
result = listAliases();
assertThat(result.getResult().toString(), containsString("1 alias found"));
} finally {
removeApplication();
disconnect();
}
}
示例11: test_shouldListAliasWithArgs
import org.springframework.shell.core.CommandResult; //导入依赖的package包/类
@Test
public void test_shouldListAliasWithArgs() {
connect();
createApplication();
try {
addAlias();
CommandResult result = listAliases();
assertThat(result, isSuccessfulCommand());
assertThat(result.getResult().toString(), containsString("1"));
assertThat(result.getResult().toString(), containsString("found"));
} finally {
removeApplication();
disconnect();
}
}
示例12: test_unzip
import org.springframework.shell.core.CommandResult; //导入依赖的package包/类
@Test
public void test_unzip() {
openExplorer();
try {
listFiles();
changeDirectory("/opt/cloudunit");
uploadPath("src/test/resources/compressed.tar");
unzip("/opt/cloudunit/compressed.tar");
CommandResult result = listFiles();
assertThat(result, isSuccessfulCommand());
assertThat("File is unzipped", result.getResult().toString(), containsString("my-beautiful-file.txt"));
} finally {
closeExplorer();
}
}
示例13: test_shouldCreateEnvironmentVariable
import org.springframework.shell.core.CommandResult; //导入依赖的package包/类
@Test
public void test_shouldCreateEnvironmentVariable() {
connect();
createApplication();
try {
CommandResult result = createEnvironmentVariable("key", "value");
Assert.assertThat(result, isSuccessfulCommand());
Assert.assertThat(result.getResult().toString(), containsString("added"));
Assert.assertThat(result.getResult().toString(), containsString("key"));
Assert.assertThat(result.getResult().toString(), containsString(applicationName.toLowerCase()));
} finally {
removeApplication();
disconnect();
}
}
示例14: test_shouldDeployAHelloworldApp
import org.springframework.shell.core.CommandResult; //导入依赖的package包/类
@Test
public void test_shouldDeployAHelloworldApp() {
connect();
createApplication();
try {
CommandResult result = deployWar();
assertThat(result, isSuccessfulCommand());
assertThat(result.getResult().toString(), containsString("deployed"));
} finally {
removeApplication();
disconnect();
}
}
示例15: test_shouldNotDeployBecauseApplicationNotSelected
import org.springframework.shell.core.CommandResult; //导入依赖的package包/类
@Test
public void test_shouldNotDeployBecauseApplicationNotSelected() {
connect();
try {
CommandResult result = deployWar();
assertThat(result, isFailedCommand());
assertThat(result.getException().getMessage(), containsString("not selected"));
} finally {
disconnect();
}
}