コード例 #1
0
 public void testDevWarWithCustomEnv() throws Exception {
   project = ensureProject("bork");
   GrailsCommand cmd =
       GrailsCommandFactory.war(project, "somethingSpecial", new File("/tmp/crud123.war"));
   assertEquals("war /tmp/crud123.war", cmd.getCommand());
   assertEquals("somethingSpecial", cmd.getSystemProperties().get("grails.env"));
 }
コード例 #2
0
 public void testUpgrade() throws Exception {
   project = ensureProject("bork");
   GrailsCommand cmd =
       GrailsCommandFactory.upgrade(
           project,
           GrailsCoreActivator.getDefault().getInstallManager().getGrailsInstall(project));
   assertEquals("upgrade --non-interactive", cmd.getCommand());
 }
コード例 #3
0
 /**
  * Basic test to make sure every registered command has a name and a non-empty list of parameter
  * descriptors
  *
  * @throws Exception
  */
 public void testBasicCommandDefinition() throws Exception {
   Collection<IFrameworkCommandDescriptor> registeredDescriptors =
       GrailsCommandFactory.getAllCommands();
   for (IFrameworkCommandDescriptor descriptor : registeredDescriptors) {
     assertNotNull(descriptor.getName());
     assertNotNull(descriptor.getParameters());
   }
 }
コード例 #4
0
 public void testDownloadSourceJars() throws Exception {
   project = ensureProject("bork");
   String sourceFileLocation = GrailsClasspathUtils.getDependencySourcesDescriptorName(project);
   if (sourceFileLocation.contains(" ")) {
     sourceFileLocation = QUOTE + sourceFileLocation + QUOTE;
   }
   GrailsCommand cmd = GrailsCommandFactory.downloadSourceJars(project);
   assertEquals("refresh-dependencies --include-source " + sourceFileLocation, cmd.getCommand());
 }
コード例 #5
0
 public void testRefreshDependencyFile() throws Exception {
   project = ensureProject("bork");
   GrailsCommand cmd = GrailsCommandFactory.refreshDependencyFile(project);
   String expect = "compile --non-interactive";
   if (GrailsVersion.MOST_RECENT.compareTo(GrailsVersion.V_2_0_0) >= 0) {
     expect = expect + " --refresh-dependencies";
   }
   assertEquals(expect, cmd.getCommand());
 }
コード例 #6
0
 public void testInstallPlugin() throws Exception {
   project = ensureProject("bork");
   BasePluginData data = new BasePluginData();
   data.setName("plugThat");
   data.setVersion("1.2.3");
   PluginVersion pluginVersion = new PluginVersion(data);
   GrailsCommand cmd = GrailsCommandFactory.installPlugin(project, pluginVersion);
   assertEquals("install-plugin --non-interactive plugThat 1.2.3", cmd.getCommand());
 }
コード例 #7
0
 public void testDevWarWithFile() throws Exception {
   project = ensureProject("bork");
   GrailsCommand cmd = GrailsCommandFactory.war(project, "dev", new File("/tmp/crud123.war"));
   assertEquals("dev war /tmp/crud123.war", cmd.getCommand());
 }
コード例 #8
0
 public void testDevWar() throws Exception {
   project = ensureProject("bork");
   GrailsCommand cmd = GrailsCommandFactory.war(project, "dev", null);
   assertEquals("dev war", cmd.getCommand());
 }
コード例 #9
0
 public void testCreateDomainClass() throws Exception {
   project = ensureProject("bork");
   assertEquals(
       "create-domain-class MyDomain",
       GrailsCommandFactory.createDomainClass(project, "MyDomain").getCommand());
 }
コード例 #10
0
 public void testCreatePlugin2() throws Exception {
   GrailsCommand cmd =
       GrailsCommandFactory.createPlugin(
           GrailsCoreActivator.getDefault().getInstallManager().getDefaultGrailsInstall(), "foo");
   assertEquals("create-plugin foo", cmd.getCommand());
 }
コード例 #11
0
 public void testCreatePlugin() throws Exception {
   assertEquals("create-plugin foo", GrailsCommandFactory.createPlugin("foo").getCommand());
 }
コード例 #12
0
 public void testCreateApp() throws Exception {
   assertEquals("create-app foo", GrailsCommandFactory.createApp("foo").getCommand());
 }
コード例 #13
0
 public void testListPlugins() throws Exception {
   project = ensureProject("bork");
   GrailsCommand cmd = GrailsCommandFactory.listPlugins(project);
   assertEquals("list-plugins", cmd.getCommand());
 }
コード例 #14
0
 public void testClean() throws Exception {
   project = ensureProject("bork");
   GrailsCommand cmd = GrailsCommandFactory.clean(project);
   assertEquals("clean", cmd.getCommand());
 }
コード例 #15
0
 public void testInstallPlugin2() throws Exception {
   project = ensureProject("bork");
   GrailsCommand cmd = GrailsCommandFactory.installPlugin(project, "plugger");
   assertEquals("install-plugin --non-interactive plugger", cmd.getCommand());
 }
コード例 #16
0
 public void testWarWithSpaces() throws Exception {
   project = ensureProject("bork");
   GrailsCommand cmd = GrailsCommandFactory.war(project, null, new File("/tmp/has space.war"));
   assertEquals("prod war " + QUOTE + "/tmp/has space.war" + QUOTE, cmd.getCommand());
 }