Skip to content

Commit b3b58b8

Browse files
Moving to short vs long tests
1 parent 83e7f90 commit b3b58b8

10 files changed

Lines changed: 42 additions & 42 deletions

File tree

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 = "long")
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: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -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: 11 additions & 11 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 = "long")
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 = "long")
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 = "long")
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 = "long")
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 = "long")
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 = "long")
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);
@@ -238,7 +238,7 @@ public void readTimeoutException() throws Throwable {
238238
* Tests SyntaxError.
239239
* Tests basic message and copy abilities.
240240
*/
241-
@Test(groups = "long")
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 = "long")
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 = "long")
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 = "long")
295+
@Test(groups = "unit")
296296
public void unauthorizedException() throws Exception {
297297
String errorMessage = "Test Message";
298298

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

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ protected Collection<String> getTableDefinitions() {
100100
return defs;
101101
}
102102

103-
@Test(groups = "long")
103+
@Test(groups = "short")
104104
public void preparedNativeTest() {
105105
// Test preparing/bounding for all native types
106106
for (DataType type : DataType.allPrimitiveTypes()) {
@@ -121,7 +121,7 @@ public void preparedNativeTest() {
121121
/**
122122
* Almost the same as preparedNativeTest, but it uses getFixedValue2() instead.
123123
*/
124-
@Test(groups = "long")
124+
@Test(groups = "short")
125125
public void preparedNativeTest2() {
126126
// Test preparing/bounding for all native types
127127
for (DataType type : DataType.allPrimitiveTypes()) {
@@ -139,7 +139,7 @@ public void preparedNativeTest2() {
139139
}
140140
}
141141

142-
@Test(groups = "long")
142+
@Test(groups = "short")
143143
public void prepareListTest() {
144144
// Test preparing/bounding for all possible list types
145145
for (DataType rawType : DataType.allPrimitiveTypes()) {
@@ -162,7 +162,7 @@ public void prepareListTest() {
162162
/**
163163
* Almost the same as prepareListTest, but it uses getFixedValue2() instead.
164164
*/
165-
@Test(groups = "long")
165+
@Test(groups = "short")
166166
public void prepareListTest2() {
167167
// Test preparing/bounding for all possible list types
168168
for (DataType rawType : DataType.allPrimitiveTypes()) {
@@ -182,7 +182,7 @@ public void prepareListTest2() {
182182
}
183183
}
184184

185-
@Test(groups = "long")
185+
@Test(groups = "short")
186186
public void prepareSetTest() {
187187
// Test preparing/bounding for all possible set types
188188
for (DataType rawType : DataType.allPrimitiveTypes()) {
@@ -205,7 +205,7 @@ public void prepareSetTest() {
205205
/**
206206
* Almost the same as prepareSetTest, but it uses getFixedValue2() instead.
207207
*/
208-
@Test(groups = "long")
208+
@Test(groups = "short")
209209
public void prepareSetTest2() {
210210
// Test preparing/bounding for all possible set types
211211
for (DataType rawType : DataType.allPrimitiveTypes()) {
@@ -225,7 +225,7 @@ public void prepareSetTest2() {
225225
}
226226
}
227227

228-
@Test(groups = "long")
228+
@Test(groups = "short")
229229
public void prepareMapTest() {
230230
// Test preparing/bounding for all possible map types
231231
for (DataType rawKeyType : DataType.allPrimitiveTypes()) {
@@ -254,7 +254,7 @@ public void prepareMapTest() {
254254
/**
255255
* Almost the same as prepareMapTest, but it uses getFixedValue2() instead.
256256
*/
257-
@Test(groups = "long")
257+
@Test(groups = "short")
258258
public void prepareMapTest2() {
259259
// Test preparing/bounding for all possible map types
260260
for (DataType rawKeyType : DataType.allPrimitiveTypes()) {
@@ -321,7 +321,7 @@ public void reprepareOnNewlyUpNodeNoKeyspaceTest() throws Exception {
321321
reprepareOnNewlyUpNodeTest(TestUtils.SIMPLE_KEYSPACE, cluster.connect());
322322
}
323323

324-
@Test(groups = "long")
324+
@Test(groups = "short")
325325
public void prepareWithNullValuesTest() throws Exception {
326326

327327
PreparedStatement ps = session.prepare("INSERT INTO " + SIMPLE_TABLE2 + "(k, v) VALUES (?, ?)");

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ private static String stripOptions(String def, boolean keepFirst) {
113113
// way to check we correctly handle schemas so it's probably not so bad.
114114
// In particular, exportAsString *does not* guarantee that you'll get
115115
// exactly the same string than the one used to create the table.
116-
@Test(groups = "long")
116+
@Test(groups = "short")
117117
public void schemaExportTest() {
118118

119119
KeyspaceMetadata metadata = cluster.getMetadata().getKeyspace(TestUtils.SIMPLE_KEYSPACE);
@@ -132,7 +132,7 @@ public void schemaExportTest() {
132132
}
133133

134134
// Same remark as the preceding test
135-
@Test(groups = "long")
135+
@Test(groups = "short")
136136
public void schemaExportOptionsTest() {
137137
TableMetadata metadata = cluster.getMetadata().getKeyspace(TestUtils.SIMPLE_KEYSPACE).getTable("with_options");
138138
assertEquals(metadata.exportAsString(), withOptions);

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ protected Collection<String> getTableDefinitions() {
3838
String.format("CREATE TABLE %s (k text PRIMARY KEY, c counter)", COUNTER_TABLE));
3939
}
4040

41-
@Test(groups = "long")
41+
@Test(groups = "short")
4242
public void executeTest() throws Exception {
4343
// Simple calls to all versions of the execute/executeAsync methods
4444
String key = "execute_test";
@@ -54,7 +54,7 @@ public void executeTest() throws Exception {
5454
checkExecuteResultSet(session.executeAsync(new SimpleStatement(String.format(TestUtils.SELECT_ALL_FORMAT, TABLE1)).setConsistencyLevel(ConsistencyLevel.ONE)).getUninterruptibly(), key);
5555
}
5656

57-
@Test(groups = "long")
57+
@Test(groups = "short")
5858
public void executePreparedTest() throws Exception {
5959
// Simple calls to all versions of the execute/executeAsync methods for prepared statements
6060
// Note: the goal is only to exercice the Session methods, PreparedStatementTest have better prepared statement tests.
@@ -87,7 +87,7 @@ private static void checkExecuteResultSet(ResultSet rs, String key) {
8787
// That test is currently disabled because we actually want to assume drop
8888
// doesn't "delog" from a keyspace as this is what Cassandra does. We
8989
// may change that depending on the resulotion of CASSANDRA-5358
90-
//@Test(groups = "long")
90+
//@Test(groups = "short")
9191
//public void setAndDropKeyspaceTest() throws Exception {
9292
// // Check that if someone set a keyspace and then drop it, we recognize
9393
// // that fact and don't assume he is still set to this keyspace
@@ -104,7 +104,7 @@ private static void checkExecuteResultSet(ResultSet rs, String key) {
104104
// }
105105
//}
106106

107-
@Test(groups = "long")
107+
@Test(groups = "short")
108108
public void executePreparedCounterTest() throws Exception {
109109
PreparedStatement p = session.prepare("UPDATE " + COUNTER_TABLE + " SET c = c + ? WHERE k = ?");
110110

@@ -117,7 +117,7 @@ public void executePreparedCounterTest() throws Exception {
117117
assertEquals(rows.get(0).getLong("c"), 2L);
118118
}
119119

120-
@Test(groups = "long")
120+
@Test(groups = "short")
121121
public void compressionTest() throws Exception {
122122

123123
// Same as executeTest, but with compression enabled

driver-core/src/test/java/com/datastax/driver/core/querybuilder/QueryBuilderITest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ protected Collection<String> getTableDefinitions() {
3636
String.format("CREATE TABLE %s (k int PRIMARY KEY, a int, b int)", TABLE_INT));
3737
}
3838

39-
@Test(groups = "long")
39+
@Test(groups = "short")
4040
public void remainingDeleteTests() throws Exception {
4141

4242
Statement query;

driver-core/src/test/java/com/datastax/driver/core/querybuilder/QueryBuilderRoutingKeyTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ protected Collection<String> getTableDefinitions() {
3535
String.format("CREATE TABLE %s (k int PRIMARY KEY, a int, b int)", TABLE_INT));
3636
}
3737

38-
@Test(groups = "long")
38+
@Test(groups = "short")
3939
public void textRoutingKeyTest() throws Exception {
4040

4141
Statement query;
@@ -55,7 +55,7 @@ public void textRoutingKeyTest() throws Exception {
5555
assertEquals(row.getInt("b"), 2);
5656
}
5757

58-
@Test(groups = "long")
58+
@Test(groups = "short")
5959
public void intRoutingKeyTest() throws Exception {
6060

6161
Statement query;
@@ -76,7 +76,7 @@ public void intRoutingKeyTest() throws Exception {
7676
assertEquals(row.getInt("b"), 2);
7777
}
7878

79-
@Test(groups = "long")
79+
@Test(groups = "short")
8080
public void intRoutingBatchKeyTest() throws Exception {
8181

8282
Statement query;

testing/bin/coverage

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ def main():
141141
if args.samplecode:
142142
cobertura_build_command += ' -Pdoc' # Runs the docs "tests" and prints sample code
143143
else:
144-
cobertura_build_command += ' -Pintegration' # Runs the integration tests, not just tests
144+
cobertura_build_command += ' -Plong' # Runs the integration tests, not just tests
145145

146146
# Use a specific Cassandra version, if asked
147147
if args.cassandra_version:

0 commit comments

Comments
 (0)