Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #77 from joaquincasares/new_test_groups

New test groups
  • Loading branch information...
commit 214b157a41e030473bc7cb5c8cfc13a4a4a5a830 2 parents 624ab68 + 6fa85db
@pcmanus pcmanus authored
View
52 driver-core/pom.xml
@@ -109,7 +109,7 @@
</profile>
<profile>
- <id>integration</id>
+ <id>short</id>
<properties>
<env>default</env>
</properties>
@@ -120,7 +120,55 @@
<artifactId>maven-surefire-plugin</artifactId>
<version>2.14</version>
<configuration>
- <groups>unit,integration</groups>
+ <groups>unit,short</groups>
+ <useFile>false</useFile>
+ <systemPropertyVariables>
+ <cassandra.version>${cassandra.version}</cassandra.version>
+ <ipprefix>${ipprefix}</ipprefix>
+ </systemPropertyVariables>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+
+ <profile>
+ <id>long</id>
+ <properties>
+ <env>default</env>
+ </properties>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <version>2.14</version>
+ <configuration>
+ <groups>unit,short,long</groups>
+ <useFile>false</useFile>
+ <systemPropertyVariables>
+ <cassandra.version>${cassandra.version}</cassandra.version>
+ <ipprefix>${ipprefix}</ipprefix>
+ </systemPropertyVariables>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+
+ <profile>
+ <id>duration</id>
+ <properties>
+ <env>default</env>
+ </properties>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <version>2.14</version>
+ <configuration>
+ <groups>unit,short,long,duration</groups>
<useFile>false</useFile>
<systemPropertyVariables>
<cassandra.version>${cassandra.version}</cassandra.version>
View
4 driver-core/src/test/java/com/datastax/driver/core/CCMBridge.java
@@ -227,7 +227,7 @@ public static void createCluster() {
}
}
- @AfterClass(groups = {"integration"})
+ @AfterClass(groups = {"short", "long"})
public static void discardCluster() {
if (cluster != null)
cluster.shutdown();
@@ -243,7 +243,7 @@ public static void discardCluster() {
}
}
- @BeforeClass(groups = {"integration"})
+ @BeforeClass(groups = {"short", "long"})
public void beforeClass() {
createCluster();
maybeCreateSchema();
View
2  driver-core/src/test/java/com/datastax/driver/core/CustomTypeTest.java
@@ -74,7 +74,7 @@ private ByteBuffer serializeForDynamicType(Object... params) {
return res;
}
- @Test(groups = "integration")
+ @Test(groups = "short")
public void DynamicCompositeTypeTest() {
session.execute("INSERT INTO test(k, c, v) VALUES (0, 's@foo:i@32', 1)");
View
24 driver-core/src/test/java/com/datastax/driver/core/DataTypeTest.java
@@ -415,7 +415,7 @@ public void primitiveSelectTest() throws Throwable {
/**
* Test simple statement inserts and selects for all primitive data types
*/
- @Test(groups = "integration")
+ @Test(groups = "long")
public void primitiveTests() throws Throwable {
primitiveInsertTest();
primitiveSelectTest();
@@ -475,7 +475,7 @@ public void collectionSelectTest() throws Throwable {
/**
* Test simple statement inserts and selects for all collection data types
*/
- @Test(groups = "integration")
+ @Test(groups = "long")
public void collectionTest() throws Throwable {
collectionInsertTest();
collectionSelectTest();
@@ -484,7 +484,7 @@ public void collectionTest() throws Throwable {
/**
* Test TTLs.
*/
- // TODO: @Test(groups = "integration")
+ // TODO: @Test(groups = "long")
public void ttlTest() throws Throwable {
}
@@ -492,7 +492,7 @@ public void ttlTest() throws Throwable {
/**
* Test Counters in an isolated format.
*/
- // TODO: @Test(groups = "integration")
+ // TODO: @Test(groups = "long")
public void countersTest() throws Throwable {
}
@@ -500,7 +500,7 @@ public void countersTest() throws Throwable {
/**
* Test tombstones.
*/
- // TODO: @Test(groups = "integration")
+ // TODO: @Test(groups = "long")
public void tombstonesTest() throws Throwable {
}
@@ -514,7 +514,7 @@ public void tombstonesTest() throws Throwable {
* Prints the table definitions that will be used in testing
* (for exporting purposes)
*/
- @Test(groups = { "doc" })
+ @Test(groups = "doc")
public void printTableDefinitions() {
String objective = "Table Definitions";
System.out.println(String.format("Printing %s...", objective));
@@ -531,7 +531,7 @@ public void printTableDefinitions() {
* Prints the sample data that will be used in testing
* (for exporting purposes)
*/
- @Test(groups = { "doc" })
+ @Test(groups = "doc")
public void printSampleData() {
String objective = "Sample Data";
System.out.println(String.format("Printing %s...", objective));
@@ -548,7 +548,7 @@ public void printSampleData() {
* Prints the sample collections that will be used in testing
* (for exporting purposes)
*/
- @Test(groups = { "doc" })
+ @Test(groups = "doc")
public void printSampleCollections() {
String objective = "Sample Collections";
System.out.println(String.format("Printing %s...", objective));
@@ -578,7 +578,7 @@ public void printSampleCollections() {
* Prints the simple insert statements that will be used in testing
* (for exporting purposes)
*/
- @Test(groups = { "doc" })
+ @Test(groups = "doc")
public void printPrimitiveInsertStatements() {
String objective = "Primitive Insert Statements";
System.out.println(String.format("Printing %s...", objective));
@@ -594,7 +594,7 @@ public void printPrimitiveInsertStatements() {
* Prints the simple select statements that will be used in testing
* (for exporting purposes)
*/
- @Test(groups = { "doc" })
+ @Test(groups = "doc")
public void printPrimitiveSelectStatements() {
String objective = "Primitive Select Statements";
System.out.println(String.format("Printing %s...", objective));
@@ -610,7 +610,7 @@ public void printPrimitiveSelectStatements() {
* Prints the simple insert statements that will be used in testing
* (for exporting purposes)
*/
- @Test(groups = { "doc" })
+ @Test(groups = "doc")
public void printCollectionInsertStatements() {
String objective = "Collection Insert Statements";
System.out.println(String.format("Printing %s...", objective));
@@ -626,7 +626,7 @@ public void printCollectionInsertStatements() {
* Prints the simple insert statements that will be used in testing
* (for exporting purposes)
*/
- @Test(groups = { "doc" })
+ @Test(groups = "doc")
public void printCollectionSelectStatements() {
String objective = "Collection Select Statements";
System.out.println(String.format("Printing %s...", objective));
View
28 driver-core/src/test/java/com/datastax/driver/core/ExceptionsTest.java
@@ -34,7 +34,7 @@
* Create a keyspace twice and a table twice.
* Catch and test all the exception methods.
*/
- @Test(groups = "integration")
+ @Test(groups = "short")
public void alreadyExistsException() throws Throwable {
Cluster.Builder builder = Cluster.builder();
CCMBridge.CCMCluster cluster = CCMBridge.buildCluster(1, builder);
@@ -96,7 +96,7 @@ public void authenticationException() throws Exception {
* Tests DriverInternalError.
* Tests basic message, rethrow, and copy abilities.
*/
- @Test(groups = "integration")
+ @Test(groups = "unit")
public void driverInternalError() throws Exception {
String errorMessage = "Test Message";
@@ -118,7 +118,7 @@ public void driverInternalError() throws Exception {
* Tests InvalidConfigurationInQueryException.
* Tests basic message abilities.
*/
- @Test(groups = "integration")
+ @Test(groups = "unit")
public void invalidConfigurationInQueryException() throws Exception {
String errorMessage = "Test Message";
@@ -133,7 +133,7 @@ public void invalidConfigurationInQueryException() throws Exception {
* Tests InvalidQueryException.
* Tests basic message and copy abilities.
*/
- @Test(groups = "integration")
+ @Test(groups = "unit")
public void invalidQueryException() throws Exception {
String errorMessage = "Test Message";
@@ -151,7 +151,7 @@ public void invalidQueryException() throws Exception {
* Tests InvalidTypeException.
* Tests basic message and copy abilities.
*/
- @Test(groups = "integration")
+ @Test(groups = "unit")
public void invalidTypeException() throws Exception {
String errorMessage = "Test Message";
@@ -170,14 +170,14 @@ public void invalidTypeException() throws Exception {
* by attempting to build a cluster using the IP address "255.255.255.255"
* and test all available exception methods.
*/
- @Test(groups = "integration")
+ @Test(groups = "short")
public void noHostAvailableException() throws Exception {
String ipAddress = "255.255.255.255";
HashMap<InetAddress, String> errorsHashMap = new HashMap<InetAddress, String>();
errorsHashMap.put(InetAddress.getByName(ipAddress), "[/255.255.255.255] Cannot connect");
try {
- Cluster cluster = Cluster.builder().addContactPoints("255.255.255.255").build();
+ Cluster.builder().addContactPoints("255.255.255.255").build();
} catch (NoHostAvailableException e) {
assertEquals(e.getMessage(), String.format("All host(s) tried for query failed (tried: [/%s])", ipAddress));
assertEquals(e.getErrors(), errorsHashMap);
@@ -194,7 +194,7 @@ public void noHostAvailableException() throws Exception {
* Then forcibly kill single node and attempt a read of the key at CL.ALL.
* Catch and test all available exception methods.
*/
- @Test(groups = "integration")
+ @Test(groups = "long")
public void readTimeoutException() throws Throwable {
Cluster.Builder builder = Cluster.builder();
CCMBridge.CCMCluster cluster = CCMBridge.buildCluster(3, builder);
@@ -238,7 +238,7 @@ public void readTimeoutException() throws Throwable {
* Tests SyntaxError.
* Tests basic message and copy abilities.
*/
- @Test(groups = "integration")
+ @Test(groups = "unit")
public void syntaxError() throws Exception {
String errorMessage = "Test Message";
@@ -256,7 +256,7 @@ public void syntaxError() throws Exception {
* Tests TraceRetrievalException.
* Tests basic message and copy abilities.
*/
- @Test(groups = "integration")
+ @Test(groups = "unit")
public void traceRetrievalException() throws Exception {
String errorMessage = "Test Message";
@@ -274,7 +274,7 @@ public void traceRetrievalException() throws Exception {
* Tests TruncateException.
* Tests basic message and copy abilities.
*/
- @Test(groups = "integration")
+ @Test(groups = "unit")
public void truncateException() throws Exception {
String errorMessage = "Test Message";
@@ -292,7 +292,7 @@ public void truncateException() throws Exception {
* Tests UnauthorizedException.
* Tests basic message and copy abilities.
*/
- @Test(groups = "integration")
+ @Test(groups = "unit")
public void unauthorizedException() throws Exception {
String errorMessage = "Test Message";
@@ -313,7 +313,7 @@ public void unauthorizedException() throws Exception {
* and attempt to read and write the same key at CL.ALL.
* Catch and test all available exception methods.
*/
- @Test(groups = "integration")
+ @Test(groups = "long")
public void unavailableException() throws Throwable {
Cluster.Builder builder = Cluster.builder();
CCMBridge.CCMCluster cluster = CCMBridge.buildCluster(3, builder);
@@ -369,7 +369,7 @@ public void unavailableException() throws Throwable {
* Then forcibly kill single node and attempt to write the same key at CL.ALL.
* Catch and test all available exception methods.
*/
- @Test(groups = "integration")
+ @Test(groups = "long")
public void writeTimeoutException() throws Throwable {
Cluster.Builder builder = Cluster.builder();
CCMBridge.CCMCluster cluster = CCMBridge.buildCluster(3, builder);
View
14 driver-core/src/test/java/com/datastax/driver/core/LoadBalancingPolicyTest.java
@@ -32,7 +32,7 @@
private PreparedStatement prepared;
- @Test(groups = "integration")
+ @Test(groups = "long")
public void roundRobinTest() throws Throwable {
Cluster.Builder builder = Cluster.builder().withLoadBalancingPolicy(new RoundRobinPolicy());
@@ -74,7 +74,7 @@ public void roundRobinTest() throws Throwable {
}
}
- @Test(groups = "integration")
+ @Test(groups = "long")
public void roundRobinWith2DCsTest() throws Throwable {
Cluster.Builder builder = Cluster.builder().withLoadBalancingPolicy(new RoundRobinPolicy());
@@ -113,7 +113,7 @@ public void roundRobinWith2DCsTest() throws Throwable {
}
}
- @Test(groups = "integration")
+ @Test(groups = "long")
public void DCAwareRoundRobinTest() throws Throwable {
Cluster.Builder builder = Cluster.builder().withLoadBalancingPolicy(new DCAwareRoundRobinPolicy("dc2"));
@@ -138,7 +138,7 @@ public void DCAwareRoundRobinTest() throws Throwable {
}
}
- @Test(groups = "integration")
+ @Test(groups = "long")
public void dcAwareRoundRobinTestWithOneRemoteHost() throws Throwable {
Cluster.Builder builder = Cluster.builder().withLoadBalancingPolicy(new DCAwareRoundRobinPolicy("dc2", 1));
@@ -225,12 +225,12 @@ public void dcAwareRoundRobinTestWithOneRemoteHost() throws Throwable {
}
}
- @Test(groups = "integration")
+ @Test(groups = "long")
public void tokenAwareTest() throws Throwable {
tokenAwareTest(false);
}
- @Test(groups = "integration")
+ @Test(groups = "long")
public void tokenAwarePreparedTest() throws Throwable {
tokenAwareTest(true);
}
@@ -295,7 +295,7 @@ public void tokenAwareTest(boolean usePrepared) throws Throwable {
}
}
- @Test(groups = "integration")
+ @Test(groups = "long")
public void tokenAwareWithRF2Test() throws Throwable {
Cluster.Builder builder = Cluster.builder().withLoadBalancingPolicy(new TokenAwarePolicy(new RoundRobinPolicy()));
CCMBridge.CCMCluster c = CCMBridge.buildCluster(2, builder);
View
22 driver-core/src/test/java/com/datastax/driver/core/PreparedStatementTest.java
@@ -100,7 +100,7 @@ private boolean exclude(DataType t) {
return defs;
}
- @Test(groups = "integration")
+ @Test(groups = "short")
public void preparedNativeTest() {
// Test preparing/bounding for all native types
for (DataType type : DataType.allPrimitiveTypes()) {
@@ -121,7 +121,7 @@ public void preparedNativeTest() {
/**
* Almost the same as preparedNativeTest, but it uses getFixedValue2() instead.
*/
- @Test(groups = "integration")
+ @Test(groups = "short")
public void preparedNativeTest2() {
// Test preparing/bounding for all native types
for (DataType type : DataType.allPrimitiveTypes()) {
@@ -139,7 +139,7 @@ public void preparedNativeTest2() {
}
}
- @Test(groups = "integration")
+ @Test(groups = "short")
public void prepareListTest() {
// Test preparing/bounding for all possible list types
for (DataType rawType : DataType.allPrimitiveTypes()) {
@@ -162,7 +162,7 @@ public void prepareListTest() {
/**
* Almost the same as prepareListTest, but it uses getFixedValue2() instead.
*/
- @Test(groups = "integration")
+ @Test(groups = "short")
public void prepareListTest2() {
// Test preparing/bounding for all possible list types
for (DataType rawType : DataType.allPrimitiveTypes()) {
@@ -182,7 +182,7 @@ public void prepareListTest2() {
}
}
- @Test(groups = "integration")
+ @Test(groups = "short")
public void prepareSetTest() {
// Test preparing/bounding for all possible set types
for (DataType rawType : DataType.allPrimitiveTypes()) {
@@ -205,7 +205,7 @@ public void prepareSetTest() {
/**
* Almost the same as prepareSetTest, but it uses getFixedValue2() instead.
*/
- @Test(groups = "integration")
+ @Test(groups = "short")
public void prepareSetTest2() {
// Test preparing/bounding for all possible set types
for (DataType rawType : DataType.allPrimitiveTypes()) {
@@ -225,7 +225,7 @@ public void prepareSetTest2() {
}
}
- @Test(groups = "integration")
+ @Test(groups = "short")
public void prepareMapTest() {
// Test preparing/bounding for all possible map types
for (DataType rawKeyType : DataType.allPrimitiveTypes()) {
@@ -254,7 +254,7 @@ public void prepareMapTest() {
/**
* Almost the same as prepareMapTest, but it uses getFixedValue2() instead.
*/
- @Test(groups = "integration")
+ @Test(groups = "short")
public void prepareMapTest2() {
// Test preparing/bounding for all possible map types
for (DataType rawKeyType : DataType.allPrimitiveTypes()) {
@@ -308,12 +308,12 @@ private void reprepareOnNewlyUpNodeTest(String ks, Session session) throws Excep
}
}
- @Test(groups = "integration")
+ @Test(groups = "long")
public void reprepareOnNewlyUpNodeTest() throws Exception {
reprepareOnNewlyUpNodeTest(null, session);
}
- @Test(groups = "integration")
+ @Test(groups = "long")
public void reprepareOnNewlyUpNodeNoKeyspaceTest() throws Exception {
// This is the same test than reprepareOnNewlyUpNodeTest, except that the
@@ -321,7 +321,7 @@ public void reprepareOnNewlyUpNodeNoKeyspaceTest() throws Exception {
reprepareOnNewlyUpNodeTest(TestUtils.SIMPLE_KEYSPACE, cluster.connect());
}
- @Test(groups = "integration")
+ @Test(groups = "short")
public void prepareWithNullValuesTest() throws Exception {
PreparedStatement ps = session.prepare("INSERT INTO " + SIMPLE_TABLE2 + "(k, v) VALUES (?, ?)");
View
4 driver-core/src/test/java/com/datastax/driver/core/ReconnectionPolicyTest.java
@@ -29,7 +29,7 @@
/*
* Test the ExponentialReconnectionPolicy.
*/
- @Test(groups = "integration")
+ @Test(groups = "long")
public void exponentialReconnectionPolicyTest() throws Throwable {
Cluster.Builder builder = Cluster.builder().withReconnectionPolicy(new ExponentialReconnectionPolicy(2 * 1000, 5 * 60 * 1000));
@@ -85,7 +85,7 @@ public void exponentialReconnectionPolicyTest() throws Throwable {
/*
* Test the ConstantReconnectionPolicy.
*/
- @Test(groups = "integration")
+ @Test(groups = "long")
public void constantReconnectionPolicyTest() throws Throwable {
Cluster.Builder builder = Cluster.builder().withReconnectionPolicy(new ConstantReconnectionPolicy(10 * 1000));
View
4 driver-core/src/test/java/com/datastax/driver/core/SchemaTest.java
@@ -113,7 +113,7 @@ private static String stripOptions(String def, boolean keepFirst) {
// way to check we correctly handle schemas so it's probably not so bad.
// In particular, exportAsString *does not* guarantee that you'll get
// exactly the same string than the one used to create the table.
- @Test(groups = "integration")
+ @Test(groups = "short")
public void schemaExportTest() {
KeyspaceMetadata metadata = cluster.getMetadata().getKeyspace(TestUtils.SIMPLE_KEYSPACE);
@@ -132,7 +132,7 @@ public void schemaExportTest() {
}
// Same remark as the preceding test
- @Test(groups = "integration")
+ @Test(groups = "short")
public void schemaExportOptionsTest() {
TableMetadata metadata = cluster.getMetadata().getKeyspace(TestUtils.SIMPLE_KEYSPACE).getTable("with_options");
assertEquals(metadata.exportAsString(), withOptions);
View
10 driver-core/src/test/java/com/datastax/driver/core/SessionTest.java
@@ -38,7 +38,7 @@
String.format("CREATE TABLE %s (k text PRIMARY KEY, c counter)", COUNTER_TABLE));
}
- @Test(groups = "integration")
+ @Test(groups = "short")
public void executeTest() throws Exception {
// Simple calls to all versions of the execute/executeAsync methods
String key = "execute_test";
@@ -54,7 +54,7 @@ public void executeTest() throws Exception {
checkExecuteResultSet(session.executeAsync(new SimpleStatement(String.format(TestUtils.SELECT_ALL_FORMAT, TABLE1)).setConsistencyLevel(ConsistencyLevel.ONE)).getUninterruptibly(), key);
}
- @Test(groups = "integration")
+ @Test(groups = "short")
public void executePreparedTest() throws Exception {
// Simple calls to all versions of the execute/executeAsync methods for prepared statements
// 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) {
// That test is currently disabled because we actually want to assume drop
// doesn't "delog" from a keyspace as this is what Cassandra does. We
// may change that depending on the resulotion of CASSANDRA-5358
- //@Test(groups = "integration")
+ //@Test(groups = "short")
//public void setAndDropKeyspaceTest() throws Exception {
// // Check that if someone set a keyspace and then drop it, we recognize
// // 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) {
// }
//}
- @Test(groups = "integration")
+ @Test(groups = "short")
public void executePreparedCounterTest() throws Exception {
PreparedStatement p = session.prepare("UPDATE " + COUNTER_TABLE + " SET c = c + ? WHERE k = ?");
@@ -117,7 +117,7 @@ public void executePreparedCounterTest() throws Exception {
assertEquals(rows.get(0).getLong("c"), 2L);
}
- @Test(groups = "integration")
+ @Test(groups = "short")
public void compressionTest() throws Exception {
// Same as executeTest, but with compression enabled
View
2  driver-core/src/test/java/com/datastax/driver/core/TestListener.java
@@ -64,7 +64,7 @@ public void onTestStart(ITestResult tr) {
if (totalTests == 0)
totalTests = tr.getTestContext().getAllTestMethods().length;
- System.out.println("Starting " + tr.getName() + " [" + ++test_index + "/" + totalTests + "]...");
+ System.out.println("Starting " + tr.getTestClass().getName() + "." + tr.getName() + " [" + ++test_index + "/" + totalTests + "]...");
}
static String formatIntoHHMMSS(long secondsTotal) {
View
2  driver-core/src/test/java/com/datastax/driver/core/querybuilder/QueryBuilderITest.java
@@ -36,7 +36,7 @@
String.format("CREATE TABLE %s (k int PRIMARY KEY, a int, b int)", TABLE_INT));
}
- @Test(groups = "integration")
+ @Test(groups = "short")
public void remainingDeleteTests() throws Exception {
Statement query;
View
6 ...-core/src/test/java/com/datastax/driver/core/querybuilder/QueryBuilderRoutingKeyTest.java
@@ -35,7 +35,7 @@
String.format("CREATE TABLE %s (k int PRIMARY KEY, a int, b int)", TABLE_INT));
}
- @Test(groups = "integration")
+ @Test(groups = "short")
public void textRoutingKeyTest() throws Exception {
Statement query;
@@ -55,7 +55,7 @@ public void textRoutingKeyTest() throws Exception {
assertEquals(row.getInt("b"), 2);
}
- @Test(groups = "integration")
+ @Test(groups = "short")
public void intRoutingKeyTest() throws Exception {
Statement query;
@@ -76,7 +76,7 @@ public void intRoutingKeyTest() throws Exception {
assertEquals(row.getInt("b"), 2);
}
- @Test(groups = "integration")
+ @Test(groups = "short")
public void intRoutingBatchKeyTest() throws Exception {
Statement query;
View
2  testing/bin/coverage
@@ -142,7 +142,7 @@ def main():
if args.samplecode:
cobertura_build_command += ' -Pdoc' # Runs the docs "tests" and prints sample code
else:
- cobertura_build_command += ' -Pintegration' # Runs the integration tests, not just tests
+ cobertura_build_command += ' -Plong' # Runs the integration tests, not just tests
# Use a specific Cassandra version, if asked
if args.cassandra_version:
Please sign in to comment.
Something went wrong with that request. Please try again.