Package org.jboss.forge.addon.ui.controller

Examples of org.jboss.forge.addon.ui.controller.CommandController.execute()


      command.setValueFor("userName", "sa");
      command.setValueFor("userPassword", "");
      command.setValueFor("hibernateDialect", HibernateDialect.fromClassName("org.hibernate.dialect.H2Dialect"));
      command.setValueFor("driverLocation", resolveH2DriverJarResource());
      command.setValueFor("driverClass", "org.h2.Driver");
      command.execute();
      Map<String, ConnectionProfile> profiles = manager.loadConnectionProfiles();
      Assert.assertEquals(1, profiles.size());
      ConnectionProfile profile = profiles.get("test");
      Assert.assertNotNull(profile);
      Assert.assertEquals("org.h2.Driver", profile.getDriver());
View Full Code Here


   public void testRemoveConnectionProfileCommand() throws Exception
   {
      CommandController command = testHarness.createCommandController(RemoveConnectionProfileCommand.class);
      command.initialize();
      command.setValueFor("names", "dummy");
      command.execute();
      Map<String, ConnectionProfile> profiles = manager.loadConnectionProfiles();
      Assert.assertEquals(0, profiles.size());
   }

}
View Full Code Here

   {
      project = projectFactory.createTempProject();
      CommandController gitSetupCommandTester = testHarness.createCommandController(GitSetupCommand.class,
               project.getRootDirectory());
      gitSetupCommandTester.initialize();
      gitSetupCommandTester.execute();

      CommandController gitIgnoreSetupTester = testHarness.createCommandController(GitIgnoreSetupCommand.class,
               project.getRootDirectory());
      gitIgnoreSetupTester.initialize();
      gitIgnoreSetupTester.setValueFor("templateRepoDir", getCloneDir());
View Full Code Here

      CommandController gitIgnoreSetupTester = testHarness.createCommandController(GitIgnoreSetupCommand.class,
               project.getRootDirectory());
      gitIgnoreSetupTester.initialize();
      gitIgnoreSetupTester.setValueFor("templateRepoDir", getCloneDir());
      gitIgnoreSetupTester.execute();

      Resource<?> cloneDir = getCloneDir();
      boolean templateFound = false;
      for (Resource<?> resource : cloneDir.listResources())
      {
View Full Code Here

   public void testGitIgnoreUpdateRepo() throws Exception
   {
      CommandController gitIgnoreUpdateRepoTester = testHarness.createCommandController(
               GitIgnoreUpdateRepoCommand.class, project.getRootDirectory());
      gitIgnoreUpdateRepoTester.initialize();
      Result result = gitIgnoreUpdateRepoTester.execute();
      assertTrue(result.getMessage().contains("Local gitignore repository updated"));
   }

   @Test
   public void testGitIgnoreListTemplates() throws Exception
View Full Code Here

   public void testGitIgnoreListTemplates() throws Exception
   {
      CommandController gitIgnoreListTemplatesTester = testHarness.createCommandController(
               GitIgnoreListTemplatesCommand.class, project.getRootDirectory());
      gitIgnoreListTemplatesTester.initialize();
      Result result = gitIgnoreListTemplatesTester.execute();
      String listOutput = result.getMessage().substring(result.getMessage().indexOf("==="));
      assertFalse(listOutput.contains(".gitignore"));
      assertTrue(listOutput.contains("= Languages ="));
      assertTrue(listOutput.contains("= Globals ="));
      assertTrue(listOutput.contains("Java"));
View Full Code Here

      CommandController gitIgnoreAddPatternTester = testHarness.createCommandController(
               GitIgnoreAddPatternCommand.class, project.getRootDirectory());
      gitIgnoreAddPatternTester.initialize();
      gitIgnoreAddPatternTester.setValueFor("pattern", "*.forge");
      gitIgnoreAddPatternTester.execute();

      GitIgnoreResource gitignore = gitIgnoreResource();
      String content = Streams.toString(gitignore.getResourceInputStream());
      assertTrue(content.contains("*.forge"));
   }
View Full Code Here

      CommandController gitIgnoreRemovePatternTester = testHarness.createCommandController(
               GitIgnoreRemovePatternCommand.class, project.getRootDirectory());
      gitIgnoreRemovePatternTester.initialize();
      gitIgnoreRemovePatternTester.setValueFor("pattern", "target/");
      gitIgnoreRemovePatternTester.execute();

      GitIgnoreResource gitignore = gitIgnoreResource();
      String content = Streams.toString(gitignore.getResourceInputStream());
      assertFalse(content.contains("target/"));
   }
View Full Code Here

      executeGitIgnoreCreate();

      CommandController gitIgnoreListPatternsTester = testHarness.createCommandController(
               GitIgnoreListPatternsCommand.class, project.getRootDirectory());
      gitIgnoreListPatternsTester.initialize();
      Result result = gitIgnoreListPatternsTester.execute();

      assertTrue(result.getMessage().contains("target/"));
      assertTrue(result.getMessage().contains(".settings/"));
   }
View Full Code Here

   {
      CommandController gitIgnoreCreateTester = testHarness.createCommandController(GitIgnoreCreateCommand.class,
               project.getRootDirectory());
      gitIgnoreCreateTester.initialize();
      gitIgnoreCreateTester.setValueFor("templates", "Eclipse Maven");
      gitIgnoreCreateTester.execute();
   }

   @After
   public void tearDown() throws Exception
   {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.