kikocis/java-driver public
Changesets · Branches · Tags · Compare
| Changeset | ee4e8586c27877d9a211e350bcb7e02d5e126265cbe23e5b55f0e8e288ce9e9c |
|---|---|
| Author | Andrew Tolbert <andrew.tolbert@datastax.com> · 2015-11-13 10:41 -06:00 |
| Committer | Andrew Tolbert <andrew.tolbert@datastax.com> · 2015-11-13 10:41 -06:00 |
| Parents | e0535ea4aa45, 66fedda017c4 |
6 files changed
modified build.yaml +13 −1
| @@ -11,12 +11,24 @@ | ||
| 11 | 11 | build: |
| 12 | 12 | - type: maven |
| 13 | 13 | version: 3.2.5 |
| 14 | - goals: clean compile test --fail-never -Plong | |
| 14 | + goals: verify --fail-never -Plong | |
| 15 | 15 | properties: | |
| 16 | 16 | com.datastax.driver.TEST_BASE_NODE_WAIT=120 |
| 17 | 17 | com.datastax.driver.NEW_NODE_DELAY_SECONDS=100 |
| 18 | 18 | cassandra.version=$CCM_CASSANDRA_VERSION |
| 19 | 19 | ccm.java.home=$CCM_JAVA_HOME |
| 20 | + failIfNoTests=false | |
| 21 | + maven.test.failure.ignore=true | |
| 22 | + - type: maven | |
| 23 | + version: 3.2.5 | |
| 24 | + goals: verify --fail-never -Pisolated | |
| 25 | + properties: | | |
| 26 | + com.datastax.driver.TEST_BASE_NODE_WAIT=120 | |
| 27 | + com.datastax.driver.NEW_NODE_DELAY_SECONDS=100 | |
| 28 | + cassandra.version=$CCM_CASSANDRA_VERSION | |
| 29 | + ccm.java.home=$CCM_JAVA_HOME | |
| 30 | + failIfNoTests=false | |
| 31 | + maven.test.failure.ignore=true | |
| 20 | 32 | - xunit: |
| 21 | 33 | - "**/target/surefire-reports/TEST-*.xml" |
| 22 | 34 | - "**/target/failsafe-reports/TEST-*.xml" |
modified driver-core/pom.xml +35 −0
| @@ -340,6 +340,41 @@ | ||
| 340 | 340 | </build> |
| 341 | 341 | </profile> |
| 342 | 342 | |
| 343 | + <profile> | |
| 344 | + <id>isolated</id> | |
| 345 | + <properties> | |
| 346 | + <env>default</env> | |
| 347 | + </properties> | |
| 348 | + <build> | |
| 349 | + <plugins> | |
| 350 | + <plugin> | |
| 351 | + <groupId>org.apache.maven.plugins</groupId> | |
| 352 | + <artifactId>maven-surefire-plugin</artifactId> | |
| 353 | + <version>2.16</version> | |
| 354 | + <configuration> | |
| 355 | + <forkCount>1</forkCount> | |
| 356 | + <reuseForks>false</reuseForks> | |
| 357 | + <groups>isolated</groups> | |
| 358 | + <!-- Files containing tests to be included must be added here. | |
| 359 | + this prevents a fork being created for each test class. --> | |
| 360 | + <includes> | |
| 361 | + <include>**/SSL*Test.java</include> | |
| 362 | + </includes> | |
| 363 | + <reportNameSuffix>isolated</reportNameSuffix> | |
| 364 | + <useFile>false</useFile> | |
| 365 | + <systemPropertyVariables> | |
| 366 | + <cassandra.version>${cassandra.version}</cassandra.version> | |
| 367 | + <ipprefix>${ipprefix}</ipprefix> | |
| 368 | + </systemPropertyVariables> | |
| 369 | + <classpathDependencyExcludes> | |
| 370 | + <classpathDependencyExcludes>io.netty:netty-transport-native-epoll</classpathDependencyExcludes> | |
| 371 | + </classpathDependencyExcludes> | |
| 372 | + </configuration> | |
| 373 | + </plugin> | |
| 374 | + </plugins> | |
| 375 | + </build> | |
| 376 | + </profile> | |
| 377 | + | |
| 343 | 378 | <profile> |
| 344 | 379 | <id>long</id> |
| 345 | 380 | <properties> |
modified driver-core/src/test/java/com/datastax/driver/core/CCMBridge.java +2 −2
| @@ -431,13 +431,13 @@ | ||
| 431 | 431 | erroredOut = true; |
| 432 | 432 | } |
| 433 | 433 | |
| 434 | - @BeforeClass(groups = { "short", "long" }) | |
| 434 | + @BeforeClass(groups = { "isolated", "short", "long" }) | |
| 435 | 435 | public void beforeClass() { |
| 436 | 436 | maybeInitCluster(); |
| 437 | 437 | initKeyspace(); |
| 438 | 438 | } |
| 439 | 439 | |
| 440 | - @AfterClass(groups = { "short", "long" }) | |
| 440 | + @AfterClass(groups = { "isolated", "short", "long" }) | |
| 441 | 441 | public void afterClass() { |
| 442 | 442 | try { |
| 443 | 443 | clearSimpleKeyspace(); |
modified driver-core/src/test/java/com/datastax/driver/core/SSLAuthenticatedEncryptionTest.java +6 −10
| @@ -67,17 +67,13 @@ | ||
| 67 | 67 | * @test_category connection:ssl, authentication |
| 68 | 68 | * @expected_result Connection can be established. |
| 69 | 69 | */ |
| 70 | - @Test(groups="short") | |
| 70 | + @Test(groups="isolated") | |
| 71 | 71 | public void should_use_system_properties_with_default_ssl_options() throws Exception { |
| 72 | - try { | |
| 73 | - System.setProperty("javax.net.ssl.keyStore", DEFAULT_CLIENT_KEYSTORE_FILE.getAbsolutePath()); | |
| 74 | - System.setProperty("javax.net.ssl.keyStorePassword", DEFAULT_CLIENT_KEYSTORE_PASSWORD); | |
| 75 | - System.setProperty("javax.net.ssl.trustStore", DEFAULT_CLIENT_TRUSTSTORE_FILE.getAbsolutePath()); | |
| 76 | - System.setProperty("javax.net.ssl.trustStorePassword", DEFAULT_CLIENT_TRUSTSTORE_PASSWORD); | |
| 72 | + System.setProperty("javax.net.ssl.keyStore", DEFAULT_CLIENT_KEYSTORE_FILE.getAbsolutePath()); | |
| 73 | + System.setProperty("javax.net.ssl.keyStorePassword", DEFAULT_CLIENT_KEYSTORE_PASSWORD); | |
| 74 | + System.setProperty("javax.net.ssl.trustStore", DEFAULT_CLIENT_TRUSTSTORE_FILE.getAbsolutePath()); | |
| 75 | + System.setProperty("javax.net.ssl.trustStorePassword", DEFAULT_CLIENT_TRUSTSTORE_PASSWORD); | |
| 77 | 76 | |
| 78 | - connectWithSSL(); | |
| 79 | - } finally { | |
| 80 | - clearSystemProperties(); | |
| 81 | - } | |
| 77 | + connectWithSSL(); | |
| 82 | 78 | } |
| 83 | 79 | } |
modified driver-core/src/test/java/com/datastax/driver/core/SSLEncryptionTest.java +4 −8
| @@ -126,15 +126,11 @@ | ||
| 126 | 126 | * @test_category connection:ssl |
| 127 | 127 | * @expected_result Connection can be established. |
| 128 | 128 | */ |
| 129 | - @Test(groups="short") | |
| 129 | + @Test(groups="isolated") | |
| 130 | 130 | public void should_use_system_properties_with_default_ssl_options() throws Exception { |
| 131 | - try { | |
| 132 | - System.setProperty("javax.net.ssl.trustStore", DEFAULT_CLIENT_TRUSTSTORE_FILE.getAbsolutePath()); | |
| 133 | - System.setProperty("javax.net.ssl.trustStorePassword", DEFAULT_CLIENT_TRUSTSTORE_PASSWORD); | |
| 131 | + System.setProperty("javax.net.ssl.trustStore", DEFAULT_CLIENT_TRUSTSTORE_FILE.getAbsolutePath()); | |
| 132 | + System.setProperty("javax.net.ssl.trustStorePassword", DEFAULT_CLIENT_TRUSTSTORE_PASSWORD); | |
| 134 | 133 | |
| 135 | - connectWithSSL(); | |
| 136 | - } finally { | |
| 137 | - clearSystemProperties(); | |
| 138 | - } | |
| 134 | + connectWithSSL(); | |
| 139 | 135 | } |
| 140 | 136 | } |
modified driver-core/src/test/java/com/datastax/driver/core/SSLTestBase.java +2 −12
| @@ -39,14 +39,14 @@ | ||
| 39 | 39 | this.requireClientAuth = requireClientAuth; |
| 40 | 40 | } |
| 41 | 41 | |
| 42 | - @BeforeClass(groups={"short", "long"}) | |
| 42 | + @BeforeClass(groups={"isolated", "short", "long"}) | |
| 43 | 43 | public void beforeClass() { |
| 44 | 44 | ccm = CCMBridge.builder("test") |
| 45 | 45 | .withSSL(requireClientAuth) |
| 46 | 46 | .build(); |
| 47 | 47 | } |
| 48 | 48 | |
| 49 | - @AfterClass(groups={"short", "long"}) | |
| 49 | + @AfterClass(groups={"isolated", "short", "long"}) | |
| 50 | 50 | public void afterClass() { |
| 51 | 51 | ccm.remove(); |
| 52 | 52 | } |
| @@ -100,16 +100,6 @@ | ||
| 100 | 100 | } |
| 101 | 101 | } |
| 102 | 102 | |
| 103 | - /** | |
| 104 | - * Clears all System properties associated with SSL key and trust stores. | |
| 105 | - */ | |
| 106 | - protected void clearSystemProperties() { | |
| 107 | - System.clearProperty("javax.net.ssl.keyStore"); | |
| 108 | - System.clearProperty("javax.net.ssl.keyStorePassword"); | |
| 109 | - System.clearProperty("javax.net.ssl.trustStore"); | |
| 110 | - System.clearProperty("javax.net.ssl.trustStorePassword"); | |
| 111 | - } | |
| 112 | - | |
| 113 | 103 | /** |
| 114 | 104 | * @param keyStorePath Path to keystore, if absent is not used. |
| 115 | 105 | * @param trustStorePath Path to truststore, if absent is not used. |