@Test public void throw_ISE_if_fail_to_copy_plugins() throws Exception { expectedException.expect(IllegalStateException.class); expectedException.expectMessage("Can not find the plugin"); prepareResolutionOfPackaging(Edition.COMMUNITY, Version.create(VERSION_4_5_6), SQ_ZIP); SonarDistribution distrib = new SonarDistribution().setVersion(VERSION_4_5_6); File invalidPlugin = temp.newFile("plugin.jar"); invalidPlugin.delete(); distrib.addPluginLocation(FileLocation.of(invalidPlugin)); newInstaller().install(distrib); }
public Server install(SonarDistribution distrib) { Packaging packaging = packagingResolver.resolve(distrib); File homeDir = unzip(packaging); if (!distrib.isKeepBundledPlugins()) { removeBundledPlugins(homeDir); } copyBundledPlugins(distrib.getBundledPluginLocations(), homeDir); copyExternalPlugins(packaging, distrib.getPluginLocations(), homeDir); copyJdbcDriver(homeDir); Properties properties = configureProperties(distrib); writePropertiesFile(properties, homeDir); String host = properties.getProperty(WEB_HOST_PROPERTY); String url = format("http: return new Server(locators, homeDir, packaging.getEdition(), packaging.getVersion(), HttpUrl.parse(url), Integer.parseInt(properties.getProperty(SEARCH_PORT_PROPERTY)), (String) properties.get(SONAR_CLUSTER_NODE_NAME)); }
ServerInstaller { public Server install(SonarDistribution distrib) { Packaging packaging = packagingResolver.resolve(distrib); File homeDir = unzip(packaging); if (!distrib.isKeepBundledPlugins()) { removeBundledPlugins(homeDir); } copyBundledPlugins(distrib.getBundledPluginLocations(), homeDir); copyExternalPlugins(packaging, distrib.getPluginLocations(), homeDir); copyJdbcDriver(homeDir); Properties properties = configureProperties(distrib); writePropertiesFile(properties, homeDir); String host = properties.getProperty(WEB_HOST_PROPERTY); String url = format("http: return new Server(locators, homeDir, packaging.getEdition(), packaging.getVersion(), HttpUrl.parse(url), Integer.parseInt(properties.getProperty(SEARCH_PORT_PROPERTY)), (String) properties.get(SONAR_CLUSTER_NODE_NAME)); } }
ServerInstaller { public Server install(SonarDistribution distrib) { Packaging packaging = packagingResolver.resolve(distrib); File homeDir = unzip(packaging); if (!distrib.isKeepBundledPlugins()) { removeBundledPlugins(homeDir); } copyBundledPlugins(distrib.getBundledPluginLocations(), homeDir); copyExternalPlugins(packaging, distrib.getPluginLocations(), homeDir); copyJdbcDriver(homeDir); Properties properties = configureProperties(distrib); writePropertiesFile(properties, homeDir); String host = properties.getProperty(WEB_HOST_PROPERTY); String url = format("http: return new Server(locators, homeDir, packaging.getEdition(), packaging.getVersion(), HttpUrl.parse(url), Integer.parseInt(properties.getProperty(SEARCH_PORT_PROPERTY)), (String) properties.get(SONAR_CLUSTER_NODE_NAME)); } ServerInstaller(PackagingResolver packagingResolver, Configuration configuration, Locators locators, DatabaseClient databaseClient); }
ServerInstaller { public Server install(SonarDistribution distrib) { Packaging packaging = packagingResolver.resolve(distrib); File homeDir = unzip(packaging); if (!distrib.isKeepBundledPlugins()) { removeBundledPlugins(homeDir); } copyBundledPlugins(distrib.getBundledPluginLocations(), homeDir); copyExternalPlugins(packaging, distrib.getPluginLocations(), homeDir); copyJdbcDriver(homeDir); Properties properties = configureProperties(distrib); writePropertiesFile(properties, homeDir); String host = properties.getProperty(WEB_HOST_PROPERTY); String url = format("http: return new Server(locators, homeDir, packaging.getEdition(), packaging.getVersion(), HttpUrl.parse(url), Integer.parseInt(properties.getProperty(SEARCH_PORT_PROPERTY)), (String) properties.get(SONAR_CLUSTER_NODE_NAME)); } ServerInstaller(PackagingResolver packagingResolver, Configuration configuration, Locators locators, DatabaseClient databaseClient); Server install(SonarDistribution distrib); }
ServerInstaller { public Server install(SonarDistribution distrib) { Packaging packaging = packagingResolver.resolve(distrib); File homeDir = unzip(packaging); if (!distrib.isKeepBundledPlugins()) { removeBundledPlugins(homeDir); } copyBundledPlugins(distrib.getBundledPluginLocations(), homeDir); copyExternalPlugins(packaging, distrib.getPluginLocations(), homeDir); copyJdbcDriver(homeDir); Properties properties = configureProperties(distrib); writePropertiesFile(properties, homeDir); String host = properties.getProperty(WEB_HOST_PROPERTY); String url = format("http: return new Server(locators, homeDir, packaging.getEdition(), packaging.getVersion(), HttpUrl.parse(url), Integer.parseInt(properties.getProperty(SEARCH_PORT_PROPERTY)), (String) properties.get(SONAR_CLUSTER_NODE_NAME)); } ServerInstaller(PackagingResolver packagingResolver, Configuration configuration, Locators locators, DatabaseClient databaseClient); Server install(SonarDistribution distrib);  }