Skip to content

Commit ac8607d

Browse files
committed
Merge branch '4.x' of github.com:apache/cassandra-java-driver into astra-integration
# Conflicts: # test-infra/revapi.json
2 parents 35ce004 + 283d3a7 commit ac8607d

File tree

29 files changed

+1413
-9929
lines changed

29 files changed

+1413
-9929
lines changed

.travis.yml

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

NOTICE_binary.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ and decompression library written by Adrien Grand. It can be obtained at:
100100
* LICENSE:
101101
* license/LICENSE.lz4.txt (Apache License 2.0)
102102
* HOMEPAGE:
103-
* https://github.com/jpountz/lz4-java
103+
* https://github.com/yawkat/lz4-java
104104

105105
This product optionally depends on 'lzma-java', a LZMA Java compression
106106
and decompression library, which can be obtained at:

README.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
# Java Driver for Apache Cassandra®
22

3-
:warning: The java-driver has recently been donated by Datastax to The Apache Software Foundation and the Apache Cassandra project. Bear with us as we move assets and coordinates.
4-
53
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
64
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/org.apache.cassandra/java-driver-core/badge.svg)](https://maven-badges.herokuapp.com/maven-central/org.apache.cassandra/java-driver-core)
75

@@ -67,10 +65,6 @@ remain unchanged, and the new API will look very familiar to 2.x and 3.x users.
6765

6866
See the [upgrade guide](upgrade_guide/) for details.
6967

70-
## Error Handling
71-
72-
See the [Cassandra error handling done right blog](https://www.datastax.com/blog/cassandra-error-handling-done-right) for error handling with the Java Driver for Apache Cassandra™.
73-
7468
## Useful links
7569

7670
* [Manual](manual/)

core-shaded/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474
<optional>true</optional>
7575
</dependency>
7676
<dependency>
77-
<groupId>org.lz4</groupId>
77+
<groupId>at.yawk.lz4</groupId>
7878
<artifactId>lz4-java</artifactId>
7979
<optional>true</optional>
8080
</dependency>

core/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
<optional>true</optional>
7474
</dependency>
7575
<dependency>
76-
<groupId>org.lz4</groupId>
76+
<groupId>at.yawk.lz4</groupId>
7777
<artifactId>lz4-java</artifactId>
7878
<optional>true</optional>
7979
</dependency>

core/revapi.json

Lines changed: 1069 additions & 6919 deletions
Large diffs are not rendered by default.

core/src/main/java/com/datastax/dse/driver/internal/core/data/geometry/DefaultGeometry.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ public boolean equals(Object o) {
176176
return false;
177177
}
178178
DefaultGeometry that = (DefaultGeometry) o;
179-
return this.getOgcGeometry().equals(that.getOgcGeometry());
179+
return this.getOgcGeometry().equals((Object) that.getOgcGeometry());
180180
}
181181

182182
@Override

core/src/main/resources/reference.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1114,7 +1114,7 @@ datastax-java-driver {
11141114
# The name of the algorithm used to compress protocol frames.
11151115
#
11161116
# The possible values are:
1117-
# - lz4: requires net.jpountz.lz4:lz4 in the classpath.
1117+
# - lz4: requires at.yawk.lz4:lz4-java in the classpath.
11181118
# - snappy: requires org.xerial.snappy:snappy-java in the classpath.
11191119
# - the string "none" to indicate no compression (this is functionally equivalent to omitting
11201120
# the option).

core/src/test/java/com/datastax/dse/driver/internal/core/data/geometry/DefaultLineStringTest.java

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,11 @@
2222

2323
import com.datastax.dse.driver.api.core.data.geometry.LineString;
2424
import com.datastax.dse.driver.api.core.data.geometry.Point;
25+
import com.datastax.oss.driver.shaded.guava.common.collect.Streams;
2526
import com.esri.core.geometry.ogc.OGCLineString;
27+
import com.fasterxml.jackson.databind.JsonNode;
28+
import com.fasterxml.jackson.databind.ObjectMapper;
29+
import com.fasterxml.jackson.databind.node.ArrayNode;
2630
import java.nio.ByteBuffer;
2731
import java.nio.ByteOrder;
2832
import org.junit.Test;
@@ -101,8 +105,25 @@ public void should_parse_valid_geo_json() {
101105
}
102106

103107
@Test
104-
public void should_convert_to_geo_json() {
105-
assertThat(lineString.asGeoJson()).isEqualTo(json);
108+
public void should_convert_to_geo_json() throws Exception {
109+
110+
ObjectMapper mapper = new ObjectMapper();
111+
JsonNode root = mapper.readTree(lineString.asGeoJson());
112+
assertThat(root.get("type").toString()).isEqualTo("\"LineString\"");
113+
114+
double expected[][] = {{30.0, 10.0}, {10.0, 30.0}, {40.0, 40.0}};
115+
JsonNode coordinatesNode = root.get("coordinates");
116+
assertThat(coordinatesNode.isArray()).isTrue();
117+
ArrayNode coordinatesArray = (ArrayNode) coordinatesNode;
118+
assertThat(coordinatesArray.size()).isEqualTo(3);
119+
for (int i = 0; i < expected.length; ++i) {
120+
121+
JsonNode elemNode = coordinatesArray.get(i);
122+
assertThat(elemNode.isArray()).isTrue();
123+
ArrayNode elemArray = (ArrayNode) elemNode;
124+
double[] arr = Streams.stream(elemArray.elements()).mapToDouble(JsonNode::asDouble).toArray();
125+
assertThat(arr).isEqualTo(expected[i]);
126+
}
106127
}
107128

108129
@Test

core/src/test/java/com/datastax/dse/driver/internal/core/data/geometry/DefaultPointTest.java

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,11 @@
2121
import static org.assertj.core.api.Fail.fail;
2222

2323
import com.datastax.dse.driver.api.core.data.geometry.Point;
24+
import com.datastax.oss.driver.shaded.guava.common.collect.Streams;
2425
import com.esri.core.geometry.ogc.OGCPoint;
26+
import com.fasterxml.jackson.databind.JsonNode;
27+
import com.fasterxml.jackson.databind.ObjectMapper;
28+
import com.fasterxml.jackson.databind.node.ArrayNode;
2529
import java.nio.ByteBuffer;
2630
import java.nio.ByteOrder;
2731
import org.junit.Test;
@@ -83,8 +87,19 @@ public void should_parse_valid_geo_json() {
8387
}
8488

8589
@Test
86-
public void should_convert_to_geo_json() {
87-
assertThat(point.asGeoJson()).isEqualTo(json);
90+
public void should_convert_to_geo_json() throws Exception {
91+
92+
ObjectMapper mapper = new ObjectMapper();
93+
JsonNode root = mapper.readTree(point.asGeoJson());
94+
assertThat(root.get("type").toString()).isEqualTo("\"Point\"");
95+
96+
double expected[] = {1.1, 2.2};
97+
JsonNode coordinatesNode = root.get("coordinates");
98+
assertThat(coordinatesNode.isArray()).isTrue();
99+
ArrayNode coordinatesArray = (ArrayNode) coordinatesNode;
100+
double[] arr =
101+
Streams.stream(coordinatesArray.elements()).mapToDouble(JsonNode::asDouble).toArray();
102+
assertThat(arr).isEqualTo(expected);
88103
}
89104

90105
@Test

0 commit comments

Comments
 (0)