Skip to content

Commit 214b157

Browse files
author
Sylvain Lebresne
committed
Merge pull request apache#77 from joaquincasares/new_test_groups
New test groups
2 parents 624ab68 + 6fa85db commit 214b157

14 files changed

Lines changed: 112 additions & 64 deletions

driver-core/pom.xml

Lines changed: 50 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@
109109
</profile>
110110

111111
<profile>
112-
<id>integration</id>
112+
<id>short</id>
113113
<properties>
114114
<env>default</env>
115115
</properties>
@@ -120,7 +120,55 @@
120120
<artifactId>maven-surefire-plugin</artifactId>
121121
<version>2.14</version>
122122
<configuration>
123-
<groups>unit,integration</groups>
123+
<groups>unit,short</groups>
124+
<useFile>false</useFile>
125+
<systemPropertyVariables>
126+
<cassandra.version>${cassandra.version}</cassandra.version>
127+
<ipprefix>${ipprefix}</ipprefix>
128+
</systemPropertyVariables>
129+
</configuration>
130+
</plugin>
131+
</plugins>
132+
</build>
133+
</profile>
134+
135+
<profile>
136+
<id>long</id>
137+
<properties>
138+
<env>default</env>
139+
</properties>
140+
<build>
141+
<plugins>
142+
<plugin>
143+
<groupId>org.apache.maven.plugins</groupId>
144+
<artifactId>maven-surefire-plugin</artifactId>
145+
<version>2.14</version>
146+
<configuration>
147+
<groups>unit,short,long</groups>
148+
<useFile>false</useFile>
149+
<systemPropertyVariables>
150+
<cassandra.version>${cassandra.version}</cassandra.version>
151+
<ipprefix>${ipprefix}</ipprefix>
152+
</systemPropertyVariables>
153+
</configuration>
154+
</plugin>
155+
</plugins>
156+
</build>
157+
</profile>
158+
159+
<profile>
160+
<id>duration</id>
161+
<properties>
162+
<env>default</env>
163+
</properties>
164+
<build>
165+
<plugins>
166+
<plugin>
167+
<groupId>org.apache.maven.plugins</groupId>
168+
<artifactId>maven-surefire-plugin</artifactId>
169+
<version>2.14</version>
170+
<configuration>
171+
<groups>unit,short,long,duration</groups>
124172
<useFile>false</useFile>
125173
<systemPropertyVariables>
126174
<cassandra.version>${cassandra.version}</cassandra.version>

driver-core/src/test/java/com/datastax/driver/core/CCMBridge.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ public static void createCluster() {
227227
}
228228
}
229229

230-
@AfterClass(groups = {"integration"})
230+
@AfterClass(groups = {"short", "long"})
231231
public static void discardCluster() {
232232
if (cluster != null)
233233
cluster.shutdown();
@@ -243,7 +243,7 @@ public static void discardCluster() {
243243
}
244244
}
245245

246-
@BeforeClass(groups = {"integration"})
246+
@BeforeClass(groups = {"short", "long"})
247247
public void beforeClass() {
248248
createCluster();
249249
maybeCreateSchema();

driver-core/src/test/java/com/datastax/driver/core/CustomTypeTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ private ByteBuffer serializeForDynamicType(Object... params) {
7474
return res;
7575
}
7676

77-
@Test(groups = "integration")
77+
@Test(groups = "short")
7878
public void DynamicCompositeTypeTest() {
7979

8080
session.execute("INSERT INTO test(k, c, v) VALUES (0, 's@foo:i@32', 1)");

driver-core/src/test/java/com/datastax/driver/core/DataTypeTest.java

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,7 @@ public void primitiveSelectTest() throws Throwable {
415415
/**
416416
* Test simple statement inserts and selects for all primitive data types
417417
*/
418-
@Test(groups = "integration")
418+
@Test(groups = "long")
419419
public void primitiveTests() throws Throwable {
420420
primitiveInsertTest();
421421
primitiveSelectTest();
@@ -475,7 +475,7 @@ public void collectionSelectTest() throws Throwable {
475475
/**
476476
* Test simple statement inserts and selects for all collection data types
477477
*/
478-
@Test(groups = "integration")
478+
@Test(groups = "long")
479479
public void collectionTest() throws Throwable {
480480
collectionInsertTest();
481481
collectionSelectTest();
@@ -484,23 +484,23 @@ public void collectionTest() throws Throwable {
484484
/**
485485
* Test TTLs.
486486
*/
487-
// TODO: @Test(groups = "integration")
487+
// TODO: @Test(groups = "long")
488488
public void ttlTest() throws Throwable {
489489

490490
}
491491

492492
/**
493493
* Test Counters in an isolated format.
494494
*/
495-
// TODO: @Test(groups = "integration")
495+
// TODO: @Test(groups = "long")
496496
public void countersTest() throws Throwable {
497497

498498
}
499499

500500
/**
501501
* Test tombstones.
502502
*/
503-
// TODO: @Test(groups = "integration")
503+
// TODO: @Test(groups = "long")
504504
public void tombstonesTest() throws Throwable {
505505

506506
}
@@ -514,7 +514,7 @@ public void tombstonesTest() throws Throwable {
514514
* Prints the table definitions that will be used in testing
515515
* (for exporting purposes)
516516
*/
517-
@Test(groups = { "doc" })
517+
@Test(groups = "doc")
518518
public void printTableDefinitions() {
519519
String objective = "Table Definitions";
520520
System.out.println(String.format("Printing %s...", objective));
@@ -531,7 +531,7 @@ public void printTableDefinitions() {
531531
* Prints the sample data that will be used in testing
532532
* (for exporting purposes)
533533
*/
534-
@Test(groups = { "doc" })
534+
@Test(groups = "doc")
535535
public void printSampleData() {
536536
String objective = "Sample Data";
537537
System.out.println(String.format("Printing %s...", objective));
@@ -548,7 +548,7 @@ public void printSampleData() {
548548
* Prints the sample collections that will be used in testing
549549
* (for exporting purposes)
550550
*/
551-
@Test(groups = { "doc" })
551+
@Test(groups = "doc")
552552
public void printSampleCollections() {
553553
String objective = "Sample Collections";
554554
System.out.println(String.format("Printing %s...", objective));
@@ -578,7 +578,7 @@ public void printSampleCollections() {
578578
* Prints the simple insert statements that will be used in testing
579579
* (for exporting purposes)
580580
*/
581-
@Test(groups = { "doc" })
581+
@Test(groups = "doc")
582582
public void printPrimitiveInsertStatements() {
583583
String objective = "Primitive Insert Statements";
584584
System.out.println(String.format("Printing %s...", objective));
@@ -594,7 +594,7 @@ public void printPrimitiveInsertStatements() {
594594
* Prints the simple select statements that will be used in testing
595595
* (for exporting purposes)
596596
*/
597-
@Test(groups = { "doc" })
597+
@Test(groups = "doc")
598598
public void printPrimitiveSelectStatements() {
599599
String objective = "Primitive Select Statements";
600600
System.out.println(String.format("Printing %s...", objective));
@@ -610,7 +610,7 @@ public void printPrimitiveSelectStatements() {
610610
* Prints the simple insert statements that will be used in testing
611611
* (for exporting purposes)
612612
*/
613-
@Test(groups = { "doc" })
613+
@Test(groups = "doc")
614614
public void printCollectionInsertStatements() {
615615
String objective = "Collection Insert Statements";
616616
System.out.println(String.format("Printing %s...", objective));
@@ -626,7 +626,7 @@ public void printCollectionInsertStatements() {
626626
* Prints the simple insert statements that will be used in testing
627627
* (for exporting purposes)
628628
*/
629-
@Test(groups = { "doc" })
629+
@Test(groups = "doc")
630630
public void printCollectionSelectStatements() {
631631
String objective = "Collection Select Statements";
632632
System.out.println(String.format("Printing %s...", objective));

driver-core/src/test/java/com/datastax/driver/core/ExceptionsTest.java

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public class ExceptionsTest{
3434
* Create a keyspace twice and a table twice.
3535
* Catch and test all the exception methods.
3636
*/
37-
@Test(groups = "integration")
37+
@Test(groups = "short")
3838
public void alreadyExistsException() throws Throwable {
3939
Cluster.Builder builder = Cluster.builder();
4040
CCMBridge.CCMCluster cluster = CCMBridge.buildCluster(1, builder);
@@ -96,7 +96,7 @@ public void authenticationException() throws Exception {
9696
* Tests DriverInternalError.
9797
* Tests basic message, rethrow, and copy abilities.
9898
*/
99-
@Test(groups = "integration")
99+
@Test(groups = "unit")
100100
public void driverInternalError() throws Exception {
101101
String errorMessage = "Test Message";
102102

@@ -118,7 +118,7 @@ public void driverInternalError() throws Exception {
118118
* Tests InvalidConfigurationInQueryException.
119119
* Tests basic message abilities.
120120
*/
121-
@Test(groups = "integration")
121+
@Test(groups = "unit")
122122
public void invalidConfigurationInQueryException() throws Exception {
123123
String errorMessage = "Test Message";
124124

@@ -133,7 +133,7 @@ public void invalidConfigurationInQueryException() throws Exception {
133133
* Tests InvalidQueryException.
134134
* Tests basic message and copy abilities.
135135
*/
136-
@Test(groups = "integration")
136+
@Test(groups = "unit")
137137
public void invalidQueryException() throws Exception {
138138
String errorMessage = "Test Message";
139139

@@ -151,7 +151,7 @@ public void invalidQueryException() throws Exception {
151151
* Tests InvalidTypeException.
152152
* Tests basic message and copy abilities.
153153
*/
154-
@Test(groups = "integration")
154+
@Test(groups = "unit")
155155
public void invalidTypeException() throws Exception {
156156
String errorMessage = "Test Message";
157157

@@ -170,14 +170,14 @@ public void invalidTypeException() throws Exception {
170170
* by attempting to build a cluster using the IP address "255.255.255.255"
171171
* and test all available exception methods.
172172
*/
173-
@Test(groups = "integration")
173+
@Test(groups = "short")
174174
public void noHostAvailableException() throws Exception {
175175
String ipAddress = "255.255.255.255";
176176
HashMap<InetAddress, String> errorsHashMap = new HashMap<InetAddress, String>();
177177
errorsHashMap.put(InetAddress.getByName(ipAddress), "[/255.255.255.255] Cannot connect");
178178

179179
try {
180-
Cluster cluster = Cluster.builder().addContactPoints("255.255.255.255").build();
180+
Cluster.builder().addContactPoints("255.255.255.255").build();
181181
} catch (NoHostAvailableException e) {
182182
assertEquals(e.getMessage(), String.format("All host(s) tried for query failed (tried: [/%s])", ipAddress));
183183
assertEquals(e.getErrors(), errorsHashMap);
@@ -194,7 +194,7 @@ public void noHostAvailableException() throws Exception {
194194
* Then forcibly kill single node and attempt a read of the key at CL.ALL.
195195
* Catch and test all available exception methods.
196196
*/
197-
@Test(groups = "integration")
197+
@Test(groups = "long")
198198
public void readTimeoutException() throws Throwable {
199199
Cluster.Builder builder = Cluster.builder();
200200
CCMBridge.CCMCluster cluster = CCMBridge.buildCluster(3, builder);
@@ -238,7 +238,7 @@ public void readTimeoutException() throws Throwable {
238238
* Tests SyntaxError.
239239
* Tests basic message and copy abilities.
240240
*/
241-
@Test(groups = "integration")
241+
@Test(groups = "unit")
242242
public void syntaxError() throws Exception {
243243
String errorMessage = "Test Message";
244244

@@ -256,7 +256,7 @@ public void syntaxError() throws Exception {
256256
* Tests TraceRetrievalException.
257257
* Tests basic message and copy abilities.
258258
*/
259-
@Test(groups = "integration")
259+
@Test(groups = "unit")
260260
public void traceRetrievalException() throws Exception {
261261
String errorMessage = "Test Message";
262262

@@ -274,7 +274,7 @@ public void traceRetrievalException() throws Exception {
274274
* Tests TruncateException.
275275
* Tests basic message and copy abilities.
276276
*/
277-
@Test(groups = "integration")
277+
@Test(groups = "unit")
278278
public void truncateException() throws Exception {
279279
String errorMessage = "Test Message";
280280

@@ -292,7 +292,7 @@ public void truncateException() throws Exception {
292292
* Tests UnauthorizedException.
293293
* Tests basic message and copy abilities.
294294
*/
295-
@Test(groups = "integration")
295+
@Test(groups = "unit")
296296
public void unauthorizedException() throws Exception {
297297
String errorMessage = "Test Message";
298298

@@ -313,7 +313,7 @@ public void unauthorizedException() throws Exception {
313313
* and attempt to read and write the same key at CL.ALL.
314314
* Catch and test all available exception methods.
315315
*/
316-
@Test(groups = "integration")
316+
@Test(groups = "long")
317317
public void unavailableException() throws Throwable {
318318
Cluster.Builder builder = Cluster.builder();
319319
CCMBridge.CCMCluster cluster = CCMBridge.buildCluster(3, builder);
@@ -369,7 +369,7 @@ public void unavailableException() throws Throwable {
369369
* Then forcibly kill single node and attempt to write the same key at CL.ALL.
370370
* Catch and test all available exception methods.
371371
*/
372-
@Test(groups = "integration")
372+
@Test(groups = "long")
373373
public void writeTimeoutException() throws Throwable {
374374
Cluster.Builder builder = Cluster.builder();
375375
CCMBridge.CCMCluster cluster = CCMBridge.buildCluster(3, builder);

driver-core/src/test/java/com/datastax/driver/core/LoadBalancingPolicyTest.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public class LoadBalancingPolicyTest extends AbstractPoliciesTest {
3232

3333
private PreparedStatement prepared;
3434

35-
@Test(groups = "integration")
35+
@Test(groups = "long")
3636
public void roundRobinTest() throws Throwable {
3737

3838
Cluster.Builder builder = Cluster.builder().withLoadBalancingPolicy(new RoundRobinPolicy());
@@ -74,7 +74,7 @@ public void roundRobinTest() throws Throwable {
7474
}
7575
}
7676

77-
@Test(groups = "integration")
77+
@Test(groups = "long")
7878
public void roundRobinWith2DCsTest() throws Throwable {
7979

8080
Cluster.Builder builder = Cluster.builder().withLoadBalancingPolicy(new RoundRobinPolicy());
@@ -113,7 +113,7 @@ public void roundRobinWith2DCsTest() throws Throwable {
113113
}
114114
}
115115

116-
@Test(groups = "integration")
116+
@Test(groups = "long")
117117
public void DCAwareRoundRobinTest() throws Throwable {
118118

119119
Cluster.Builder builder = Cluster.builder().withLoadBalancingPolicy(new DCAwareRoundRobinPolicy("dc2"));
@@ -138,7 +138,7 @@ public void DCAwareRoundRobinTest() throws Throwable {
138138
}
139139
}
140140

141-
@Test(groups = "integration")
141+
@Test(groups = "long")
142142
public void dcAwareRoundRobinTestWithOneRemoteHost() throws Throwable {
143143

144144
Cluster.Builder builder = Cluster.builder().withLoadBalancingPolicy(new DCAwareRoundRobinPolicy("dc2", 1));
@@ -225,12 +225,12 @@ public void dcAwareRoundRobinTestWithOneRemoteHost() throws Throwable {
225225
}
226226
}
227227

228-
@Test(groups = "integration")
228+
@Test(groups = "long")
229229
public void tokenAwareTest() throws Throwable {
230230
tokenAwareTest(false);
231231
}
232232

233-
@Test(groups = "integration")
233+
@Test(groups = "long")
234234
public void tokenAwarePreparedTest() throws Throwable {
235235
tokenAwareTest(true);
236236
}
@@ -295,7 +295,7 @@ public void tokenAwareTest(boolean usePrepared) throws Throwable {
295295
}
296296
}
297297

298-
@Test(groups = "integration")
298+
@Test(groups = "long")
299299
public void tokenAwareWithRF2Test() throws Throwable {
300300
Cluster.Builder builder = Cluster.builder().withLoadBalancingPolicy(new TokenAwarePolicy(new RoundRobinPolicy()));
301301
CCMBridge.CCMCluster c = CCMBridge.buildCluster(2, builder);

0 commit comments

Comments
 (0)