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")); }
public void testUpgrade() throws Exception { project = ensureProject("bork"); GrailsCommand cmd = GrailsCommandFactory.upgrade( project, GrailsCoreActivator.getDefault().getInstallManager().getGrailsInstall(project)); assertEquals("upgrade --non-interactive", cmd.getCommand()); }
/** * 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()); } }
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()); }
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()); }
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()); }
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()); }
public void testDevWar() throws Exception { project = ensureProject("bork"); GrailsCommand cmd = GrailsCommandFactory.war(project, "dev", null); assertEquals("dev war", cmd.getCommand()); }
public void testCreateDomainClass() throws Exception { project = ensureProject("bork"); assertEquals( "create-domain-class MyDomain", GrailsCommandFactory.createDomainClass(project, "MyDomain").getCommand()); }
public void testCreatePlugin2() throws Exception { GrailsCommand cmd = GrailsCommandFactory.createPlugin( GrailsCoreActivator.getDefault().getInstallManager().getDefaultGrailsInstall(), "foo"); assertEquals("create-plugin foo", cmd.getCommand()); }
public void testCreatePlugin() throws Exception { assertEquals("create-plugin foo", GrailsCommandFactory.createPlugin("foo").getCommand()); }
public void testCreateApp() throws Exception { assertEquals("create-app foo", GrailsCommandFactory.createApp("foo").getCommand()); }
public void testListPlugins() throws Exception { project = ensureProject("bork"); GrailsCommand cmd = GrailsCommandFactory.listPlugins(project); assertEquals("list-plugins", cmd.getCommand()); }
public void testClean() throws Exception { project = ensureProject("bork"); GrailsCommand cmd = GrailsCommandFactory.clean(project); assertEquals("clean", cmd.getCommand()); }
public void testInstallPlugin2() throws Exception { project = ensureProject("bork"); GrailsCommand cmd = GrailsCommandFactory.installPlugin(project, "plugger"); assertEquals("install-plugin --non-interactive plugger", cmd.getCommand()); }
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()); }