@Test @Category(LongRun.class) public void testInstallationOfCoffeeScript() throws IOException, ParseException { manager.installIfNotInstalled(); AbstractWisdomMojo mojo = mock(AbstractWisdomMojo.class); when(mojo.getLog()).thenReturn(log); when(mojo.getNodeManager()).thenReturn(manager); NPM npm = NPM.npm(mojo, "coffee-script", CoffeeScriptCompilerMojo.COFFEESCRIPT_VERSION); assertThat(npm).isNotNull(); assertThat(npm.findExecutable("coffee")).isFile(); }
public void installIfNotInstalled() throws IOException { try { factory.getNodeAndNPMInstaller(proxy()) .install(mojo.getNodeVersion(), mojo.getNPMVersion(), mojo.getNodeDistributionRootUrl(), mojo.getNpmRegistryRootUrl() + "/npm/-/"); if (!getNodeExecutable().isFile()) { throw new IOException("Node installation failed - " + getNodeExecutable().getAbsolutePath() + " does not exist"); } } catch (InstallationException e) { throw new IOException(e); } }
NodeManager { public void installIfNotInstalled() throws IOException { try { factory.getNodeAndNPMInstaller(proxy()) .install(mojo.getNodeVersion(), mojo.getNPMVersion(), mojo.getNodeDistributionRootUrl(), mojo.getNpmRegistryRootUrl() + "/npm/-/"); if (!getNodeExecutable().isFile()) { throw new IOException("Node installation failed - " + getNodeExecutable().getAbsolutePath() + " does not exist"); } } catch (InstallationException e) { throw new IOException(e); } } }
NodeManager { public void installIfNotInstalled() throws IOException { try { factory.getNodeAndNPMInstaller(proxy()) .install(mojo.getNodeVersion(), mojo.getNPMVersion(), mojo.getNodeDistributionRootUrl(), mojo.getNpmRegistryRootUrl() + "/npm/-/"); if (!getNodeExecutable().isFile()) { throw new IOException("Node installation failed - " + getNodeExecutable().getAbsolutePath() + " does not exist"); } } catch (InstallationException e) { throw new IOException(e); } } NodeManager(AbstractWisdomMojo mojo);  NodeManager(Log log, File nodeDirectory, AbstractWisdomMojo mojo); }
NodeManager { public void installIfNotInstalled() throws IOException { try { factory.getNodeAndNPMInstaller(proxy()) .install(mojo.getNodeVersion(), mojo.getNPMVersion(), mojo.getNodeDistributionRootUrl(), mojo.getNpmRegistryRootUrl() + "/npm/-/"); if (!getNodeExecutable().isFile()) { throw new IOException("Node installation failed - " + getNodeExecutable().getAbsolutePath() + " does not exist"); } } catch (InstallationException e) { throw new IOException(e); } } NodeManager(AbstractWisdomMojo mojo);  NodeManager(Log log, File nodeDirectory, AbstractWisdomMojo mojo); FrontendPluginFactory factory(); FrontendPluginFactory factoryForNPMInstallation(); void installIfNotInstalled(); ProxyConfig proxy(); File getNodeExecutable(); File getNodeModulesDirectory(); File getWorkDir(); }
NodeManager { public void installIfNotInstalled() throws IOException { try { factory.getNodeAndNPMInstaller(proxy()) .install(mojo.getNodeVersion(), mojo.getNPMVersion(), mojo.getNodeDistributionRootUrl(), mojo.getNpmRegistryRootUrl() + "/npm/-/"); if (!getNodeExecutable().isFile()) { throw new IOException("Node installation failed - " + getNodeExecutable().getAbsolutePath() + " does not exist"); } } catch (InstallationException e) { throw new IOException(e); } } NodeManager(AbstractWisdomMojo mojo);  NodeManager(Log log, File nodeDirectory, AbstractWisdomMojo mojo); FrontendPluginFactory factory(); FrontendPluginFactory factoryForNPMInstallation(); void installIfNotInstalled(); ProxyConfig proxy(); File getNodeExecutable(); File getNodeModulesDirectory(); File getWorkDir();  }