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()); }
/** * Repeat the above check, but instead of using the "nuts and bolts" just use * enableRefreshDependencyFile(). This should do the same thing (so the generated dependency file * should pass the same checks). */ public void testBuildListener2() throws Exception { ensureDefaultGrailsVersion(GrailsVersion.MOST_RECENT); IProject proj = ensureProject(TEST_PROJECT_NAME); GrailsCommand cmd = GrailsCommand.forTest(proj, "compile"); cmd.enableRefreshDependencyFile(); File tmpFile = GrailsClasspathUtils.getDependencyDescriptor(proj); if (tmpFile.exists()) { tmpFile.delete(); } assertFalse(tmpFile.exists()); cmd.synchExec(); checkDependencyFile(proj, tmpFile); }