本文整理汇总了Java中org.jboss.forge.addon.ui.controller.CommandController.getCommand方法的典型用法代码示例。如果您正苦于以下问题:Java CommandController.getCommand方法的具体用法?Java CommandController.getCommand怎么用?Java CommandController.getCommand使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.jboss.forge.addon.ui.controller.CommandController
的用法示例。
在下文中一共展示了CommandController.getCommand方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: checkSpringBootVersion
import org.jboss.forge.addon.ui.controller.CommandController; //导入方法依赖的package包/类
@Test
public void checkSpringBootVersion() throws Exception {
CommandController controller = uiTestHarness
.createCommandController(SetupProjectCommand.class, project.getRoot());
controller.initialize();
// Checks the command metadata
assertTrue(controller.getCommand() instanceof SetupProjectCommand);
SetupProjectCommand springBootCommand = (SetupProjectCommand) controller.getCommand();
if (System.getenv("SPRING_BOOT_DEFAULT_VERSION") != null) {
assertEquals("1.5.1", controller.getValueFor("springBootVersion"));
}
else {
controller.getValueFor("springBootVersion");
assertEquals("1.5.4.RELEASE", controller.getValueFor("springBootVersion"));
}
}
示例2: checkCommandMetadata
import org.jboss.forge.addon.ui.controller.CommandController; //导入方法依赖的package包/类
@Test
public void checkCommandMetadata() throws Exception {
CommandController controller = uiTestHarness
.createCommandController(SetupProjectCommand.class, project.getRoot());
controller.initialize();
// Checks the command metadata
assertTrue(controller.getCommand() instanceof SetupProjectCommand);
SetupProjectCommand springBootCommand = (SetupProjectCommand) controller.getCommand();
UICommandMetadata metadata = controller.getMetadata();
assertEquals("Spring Boot: Setup", metadata.getName());
assertEquals("Spring Boot", metadata.getCategory().getName());
Result result = controller.execute();
assertTrue("Created new Spring Boot", result.getMessage().contains("Created new Spring Boot"));
}