@Test public void copy_jdbc_driver_if_defined() { prepareResolutionOfPackaging(Edition.COMMUNITY, Version.create(VERSION_4_5_6), SQ_ZIP); when(dbClient.getDriverFile()).thenReturn(FileUtils.toFile(getClass().getResource("ServerInstallerTest/fake-oracle-driver.jar"))); when(dbClient.getDialect()).thenReturn("oracle"); Server server = newInstaller().install(new SonarDistribution().setVersion(VERSION_4_5_6)); assertThat(new File(server.getHome(), "extensions/jdbc-driver/oracle/fake-oracle-driver.jar")).exists().isFile(); }
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);  }