Skip to content

Commit 7641206

Browse files
committed
Remove tests with EmbeddedCassandra
Testing using EmbeddedCassandra is no longer recommended. Starting with spark connector 2.5.x tests should use ccm instead. This change is removing both the Spec and test dependencies from all scala example projects.
1 parent 962ad32 commit 7641206

File tree

9 files changed

+2
-258
lines changed

9 files changed

+2
-258
lines changed

java/sbt/dse/build.sbt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
name := "writeRead"
2-
32
version := "0.1"
43

54
crossPaths := false

java/sbt/oss/build.sbt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
name := "writeRead"
2-
32
version := "0.1"
43

54
crossPaths := false

scala/gradle/dse/build.gradle

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ repositories {
1414
}
1515
}
1616

17-
1817
// The assembly configuration will cause jar to be included in assembled fat-jar
1918
configurations {
2019
assembly
@@ -31,23 +30,11 @@ configurations {
3130

3231
def dseVersion = "6.8.1"
3332

34-
def scalaVersion = "2.11"
35-
def scalaTestVersion = "3.0.0"
36-
def connectorVersion = "2.0.10"
37-
def cassandraVersion = "3.2"
38-
def jUnitVersion = "4.12"
39-
4033
// Please make sure that following DSE version matches your DSE cluster version.
4134
dependencies {
4235
provided("com.datastax.dse:dse-spark-dependencies:$dseVersion")
4336
// assembly "org.apache.commons:commons-math3:3.6.1"
4437
// assembly "org.apache.commons:commons-csv:1.0"
45-
46-
// Test Dependencies
47-
testCompile "com.datastax.spark:spark-cassandra-connector-embedded_$scalaVersion:$connectorVersion"
48-
testCompile "org.scalatest:scalatest_$scalaVersion:$scalaTestVersion"
49-
testCompile "org.apache.cassandra:cassandra-all:$cassandraVersion"
50-
testCompile "junit:junit:$jUnitVersion"
5138
}
5239

5340
shadowJar {

scala/gradle/oss/build.gradle

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,6 @@ repositories {
1313
def sparkVersion = "2.2.2"
1414
def connectorVersion = "2.0.10"
1515
def scalaVersion = "2.11"
16-
def scalaTestVersion = "3.0.0"
17-
def cassandraVersion = "3.2"
18-
def jUnitVersion = "4.12"
1916

2017
// The assembly configuration will cause jar to be included in assembled fat-jar
2118
configurations {
@@ -39,16 +36,6 @@ dependencies {
3936
provided "com.datastax.spark:spark-cassandra-connector_$scalaVersion:$connectorVersion"
4037
// assembly "org.apache.commons:commons-math3:3.6.1"
4138
// assembly "org.apache.commons:commons-csv:1.0"
42-
43-
//Test Dependencies
44-
testCompile ("com.datastax.spark:spark-cassandra-connector-embedded_$scalaVersion:$connectorVersion") {
45-
exclude group: 'com.datastax.cassandra', module: 'cassandra-driver-core'
46-
}
47-
testCompile "org.scalatest:scalatest_$scalaVersion:$scalaTestVersion"
48-
testCompile("org.apache.cassandra:cassandra-all:$cassandraVersion") {
49-
exclude group: 'org.slf4j', module: 'log4j-over-slf4j' // Excluded to allow for Cassandra to run embedded
50-
}
51-
testCompile "junit:junit:$jUnitVersion"
5239
}
5340

5441
shadowJar {

scala/maven/dse/pom.xml

Lines changed: 0 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -36,32 +36,6 @@
3636
<!--<artifactId>commons-csv</artifactId>-->
3737
<!--<version>1.0</version>-->
3838
<!--</dependency>-->
39-
40-
<!-- Test Dependencies -->
41-
<dependency>
42-
<groupId>com.datastax.spark</groupId>
43-
<artifactId>spark-cassandra-connector-embedded_${scala.main.version}</artifactId>
44-
<version>${connector.version}</version>
45-
<scope>test</scope>
46-
</dependency>
47-
<dependency>
48-
<groupId>org.scalatest</groupId>
49-
<artifactId>scalatest_${scala.main.version}</artifactId>
50-
<version>${scalatest.version}</version>
51-
<scope>test</scope>
52-
</dependency>
53-
<dependency>
54-
<groupId>junit</groupId>
55-
<artifactId>junit</artifactId>
56-
<version>${junit.version}</version>
57-
<scope>test</scope>
58-
</dependency>
59-
<dependency>
60-
<groupId>org.apache.cassandra</groupId>
61-
<artifactId>cassandra-all</artifactId>
62-
<version>${cassandra.version}</version>
63-
<scope>test</scope>
64-
</dependency>
6539
</dependencies>
6640

6741
<repositories>
@@ -111,35 +85,6 @@
11185
</execution>
11286
</executions>
11387
</plugin>
114-
<!-- Instructions from http://www.scalatest.org/user_guide/using_the_scalatest_maven_plugin -->
115-
<!-- disable surefire -->
116-
<plugin>
117-
<groupId>org.apache.maven.plugins</groupId>
118-
<artifactId>maven-surefire-plugin</artifactId>
119-
<version>2.7</version>
120-
<configuration>
121-
<skipTests>true</skipTests>
122-
</configuration>
123-
</plugin>
124-
<!-- enable scalatest -->
125-
<plugin>
126-
<groupId>org.scalatest</groupId>
127-
<artifactId>scalatest-maven-plugin</artifactId>
128-
<version>1.0</version>
129-
<configuration>
130-
<reportsDirectory>${project.build.directory}/surefire-reports</reportsDirectory>
131-
<junitxml>.</junitxml>
132-
<filereports>WDF TestSuite.txt</filereports>
133-
</configuration>
134-
<executions>
135-
<execution>
136-
<id>test</id>
137-
<goals>
138-
<goal>test</goal>
139-
</goals>
140-
</execution>
141-
</executions>
142-
</plugin>
14388
</plugins>
14489
</build>
14590
</project>

scala/maven/oss/pom.xml

Lines changed: 0 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,7 @@
1212
<scala.version>2.11.8</scala.version>
1313
<scala.main.version>2.11</scala.main.version>
1414
<spark.version>2.2.2</spark.version>
15-
<scalatest.version>3.0.0</scalatest.version>
1615
<connector.version>2.0.10</connector.version>
17-
<cassandra.version>3.2</cassandra.version>
18-
<junit.version>4.12</junit.version>
1916
</properties>
2017

2118
<!--
@@ -64,52 +61,6 @@
6461
<!--<artifactId>commons-csv</artifactId>-->
6562
<!--<version>1.0</version>-->
6663
<!--</dependency>-->
67-
68-
<!-- Test Dependencies -->
69-
<dependency>
70-
<groupId>com.datastax.spark</groupId>
71-
<artifactId>spark-cassandra-connector-embedded_${scala.main.version}</artifactId>
72-
<version>${connector.version}</version>
73-
<scope>test</scope>
74-
<exclusions>
75-
<exclusion>
76-
<groupId>com.datastax.cassandra</groupId>
77-
<artifactId>cassandra-driver-core</artifactId>
78-
</exclusion>
79-
</exclusions>
80-
</dependency>
81-
<dependency>
82-
<groupId>org.scalatest</groupId>
83-
<artifactId>scalatest_${scala.main.version}</artifactId>
84-
<version>${scalatest.version}</version>
85-
<scope>test</scope>
86-
</dependency>
87-
<dependency>
88-
<groupId>junit</groupId>
89-
<artifactId>junit</artifactId>
90-
<version>${junit.version}</version>
91-
<scope>test</scope>
92-
</dependency>
93-
<dependency>
94-
<groupId>org.apache.cassandra</groupId>
95-
<artifactId>cassandra-all</artifactId>
96-
<version>${cassandra.version}</version>
97-
<scope>test</scope>
98-
<exclusions>
99-
<!-- Excluded to allow for Cassandra to run embedded -->
100-
<exclusion>
101-
<groupId>org.slf4j</groupId>
102-
<artifactId>log4j-over-slf4j</artifactId>
103-
</exclusion>
104-
</exclusions>
105-
</dependency>
106-
<!-- Force Guava 18 on Test CP, Required for Cassandra -->
107-
<dependency>
108-
<groupId>com.google.guava</groupId>
109-
<artifactId>guava</artifactId>
110-
<version>18.0</version>
111-
<scope>test</scope>
112-
</dependency>
11364
</dependencies>
11465

11566
<build>
@@ -152,35 +103,6 @@
152103
</execution>
153104
</executions>
154105
</plugin>
155-
<!-- Instructions from http://www.scalatest.org/user_guide/using_the_scalatest_maven_plugin -->
156-
<!-- disable surefire -->
157-
<plugin>
158-
<groupId>org.apache.maven.plugins</groupId>
159-
<artifactId>maven-surefire-plugin</artifactId>
160-
<version>2.7</version>
161-
<configuration>
162-
<skipTests>true</skipTests>
163-
</configuration>
164-
</plugin>
165-
<!-- enable scalatest -->
166-
<plugin>
167-
<groupId>org.scalatest</groupId>
168-
<artifactId>scalatest-maven-plugin</artifactId>
169-
<version>1.0</version>
170-
<configuration>
171-
<reportsDirectory>${project.build.directory}/surefire-reports</reportsDirectory>
172-
<junitxml>.</junitxml>
173-
<filereports>WDF TestSuite.txt</filereports>
174-
</configuration>
175-
<executions>
176-
<execution>
177-
<id>test</id>
178-
<goals>
179-
<goal>test</goal>
180-
</goals>
181-
</execution>
182-
</executions>
183-
</plugin>
184106
</plugins>
185107
</build>
186108
</project>

scala/sbt/dse/build.sbt

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
21
name := "writeRead"
3-
42
version := "0.1"
53

64
scalaVersion := "2.11.8"
@@ -16,29 +14,6 @@ val dseVersion = "6.8.1"
1614
libraryDependencies += "com.datastax.dse" % "dse-spark-dependencies" % dseVersion % "provided" exclude(
1715
"org.slf4j", "log4j-over-slf4j")
1816

19-
// Test Dependencies
20-
// The 'test/resources' Directory in should match the resources directory in the `it` directory
21-
// for the version of the Spark Cassandra Connector in use.
22-
val scalaTestVersion = "3.0.0"
23-
val connectorVersion = "2.0.10"
24-
val jUnitVersion = "4.12"
25-
val cassandraVersion = "3.2"
26-
27-
libraryDependencies ++= Seq(
28-
"com.datastax.spark" %% "spark-cassandra-connector-embedded" % connectorVersion % "test" exclude(
29-
"com.datastax.cassandra", "*"),
30-
"org.apache.cassandra" % "cassandra-all" % cassandraVersion % "test",
31-
"org.scalatest" %% "scalatest" % scalaTestVersion % "test",
32-
"junit" % "junit" % "4.12" % "test"
33-
).map(_.excludeAll(
34-
ExclusionRule("org.slf4j","log4j-over-slf4j"),
35-
ExclusionRule("org.slf4j","slf4j-log4j12"))
36-
) // Excluded to allow for Cassandra to run embedded
37-
38-
//Forking is required for the Embedded Cassandra
39-
fork in Test := true
40-
41-
4217
//Your dependencies
4318
//libraryDependencies += "org.apache.commons" % "commons-math3" % "3.6.1"
4419
//libraryDependencies += "org.apache.commons" % "commons-csv" % "1.0"

scala/sbt/dse/src/test/scala/com/datastax/spark/example/WriteReadSpec.scala

Lines changed: 0 additions & 51 deletions
This file was deleted.

scala/sbt/oss/build.sbt

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,19 @@
11
name := "writeRead"
2-
32
version := "0.1"
43

54
scalaVersion := "2.11.8"
65

76
val sparkVersion = "2.2.2"
87
val connectorVersion = "2.0.10"
9-
//The 'test/resources' Directory in should match the resources directory in the `it` directory
10-
//for the version of the Spark Cassandra Connector in use.
11-
12-
13-
val cassandraVersion = "3.2"
14-
val scalaTestVersion = "3.0.0"
15-
val jUnitVersion = "4.12"
16-
178

189
// Please make sure that following dependencies have versions corresponding to the ones in your cluster.
1910
// Note that spark-cassandra-connector should be provided with '--packages' flag to spark-submit command.
2011
libraryDependencies ++= Seq(
2112
"org.apache.spark" %% "spark-core" % sparkVersion % "provided",
2213
"org.apache.spark" %% "spark-sql" % sparkVersion % "provided",
2314
"org.apache.spark" %% "spark-hive" % sparkVersion % "provided",
24-
"com.datastax.spark" %% "spark-cassandra-connector" % connectorVersion % "provided",
25-
26-
//Test Dependencies
27-
"com.datastax.spark" %% "spark-cassandra-connector-embedded" % connectorVersion % "test"
28-
exclude("com.datastax.cassandra", "cassandra-driver-core"),
29-
"org.scalatest" %% "scalatest" % scalaTestVersion % "test",
30-
"org.apache.cassandra" % "cassandra-all" % cassandraVersion % "test",
31-
"junit" % "junit" % jUnitVersion % "test"
32-
).map(_.exclude("org.slf4j", "log4j-over-slf4j")) // Excluded to allow for Cassandra to run embedded
33-
34-
//Forking is required for the Embedded Cassandra
35-
fork in Test := true
15+
"com.datastax.spark" %% "spark-cassandra-connector" % connectorVersion % "provided"
16+
)
3617

3718
//Your dependencies
3819
//libraryDependencies += "org.apache.commons" % "commons-math3" % "3.6.1"

0 commit comments

Comments
 (0)