You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@datasketches.apache.org by le...@apache.org on 2023/10/16 23:56:18 UTC
[datasketches-java] 02/03: partially updated TupleCrossLanguageTest
This is an automated email from the ASF dual-hosted git repository.
leerho pushed a commit to branch Revert_to_classLoader_getResource
in repository https://gitbox.apache.org/repos/asf/datasketches-java.git
commit 24cc0e37ba03657a186ca8303900388642169dbf
Author: Lee Rhodes <le...@users.noreply.github.com>
AuthorDate: Mon Oct 16 13:57:15 2023 -0700
partially updated TupleCrossLanguageTest
---
.../org/apache/datasketches/tuple/TupleCrossLanguageTest.java | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/src/test/java/org/apache/datasketches/tuple/TupleCrossLanguageTest.java b/src/test/java/org/apache/datasketches/tuple/TupleCrossLanguageTest.java
index eb43dddd..ae3522b5 100644
--- a/src/test/java/org/apache/datasketches/tuple/TupleCrossLanguageTest.java
+++ b/src/test/java/org/apache/datasketches/tuple/TupleCrossLanguageTest.java
@@ -20,6 +20,7 @@
package org.apache.datasketches.tuple;
import static org.apache.datasketches.common.TestUtil.*;
+import static org.apache.datasketches.common.Util.getResourceBytes;
import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertTrue;
@@ -39,8 +40,7 @@ public class TupleCrossLanguageTest {
@Test(groups = {CHECK_CPP_HISTORICAL_FILES})
public void serialVersion1Compatibility() throws IOException {
- final byte[] byteArr =
- Files.readAllBytes(cppHistPath.resolve("CompactSketchWithDoubleSummary4K_serialVersion1.sk"));
+ final byte[] byteArr = getResourceBytes("CompactSketchWithDoubleSummary4K_serialVersion1.sk");
Sketch<DoubleSummary> sketch = Sketches.heapifySketch(Memory.wrap(byteArr), new DoubleSummaryDeserializer());
Assert.assertTrue(sketch.isEstimationMode());
Assert.assertEquals(sketch.getEstimate(), 8192, 8192 * 0.99);
@@ -56,7 +56,7 @@ public class TupleCrossLanguageTest {
@Test(groups = {CHECK_CPP_HISTORICAL_FILES})
public void version2Compatibility() throws IOException {
- final byte[] byteArr = Files.readAllBytes(cppHistPath.resolve("TupleWithTestIntegerSummary4kTrimmedSerVer2.sk"));
+ final byte[] byteArr = getResourceBytes("TupleWithTestIntegerSummary4kTrimmedSerVer2.sk");
Sketch<IntegerSummary> sketch1 = Sketches.heapifySketch(Memory.wrap(byteArr), new IntegerSummaryDeserializer());
// construct the same way
@@ -106,13 +106,13 @@ public class TupleCrossLanguageTest {
@Test(expectedExceptions = SketchesArgumentException.class, groups = {CHECK_CPP_HISTORICAL_FILES})
public void noSupportHeapifyV0_9_1() throws Exception {
- final byte[] byteArr = Files.readAllBytes(cppHistPath.resolve("ArrayOfDoublesUnion_v0.9.1.sk"));
+ final byte[] byteArr = getResourceBytes("ArrayOfDoublesUnion_v0.9.1.sk");
ArrayOfDoublesUnion.heapify(Memory.wrap(byteArr));
}
@Test(expectedExceptions = SketchesArgumentException.class, groups = {CHECK_CPP_HISTORICAL_FILES})
public void noSupportWrapV0_9_1() throws Exception {
- final byte[] byteArr = Files.readAllBytes(cppHistPath.resolve("ArrayOfDoublesUnion_v0.9.1.sk"));
+ final byte[] byteArr = getResourceBytes("ArrayOfDoublesUnion_v0.9.1.sk");
ArrayOfDoublesUnion.wrap(WritableMemory.writableWrap(byteArr));
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@datasketches.apache.org
For additional commands, e-mail: commits-help@datasketches.apache.org