You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@datasketches.apache.org by dc...@apache.org on 2021/06/08 09:13:37 UTC

[datasketches-memory] branch multi-module-experimental updated (68f968c -> a285bc1)

This is an automated email from the ASF dual-hosted git repository.

dcromberge pushed a change to branch multi-module-experimental
in repository https://gitbox.apache.org/repos/asf/datasketches-memory.git.


    from 68f968c  Rename base to java8
     new 0f95f86  Add tests for packaged JAR
     new a285bc1  Set environment during package tests

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .github/workflows/maven.yml                        |   1 +
 datasketches-memory-java8-tests/pom.xml            |  21 +--
 .../datasketches/memory/internal/UnsafeUtil.java   |   2 +
 datasketches-memory-tests/pom.xml                  | 166 +++++++++++++++++++++
 .../src/test/resources/GettysburgAddress.txt       |   0
 datasketches-memory/pom.xml                        |  44 +++++-
 datasketches-memory/src/assembly/tests.xml         |   2 +-
 pom.xml                                            |  18 +--
 8 files changed, 216 insertions(+), 38 deletions(-)
 create mode 100644 datasketches-memory-tests/pom.xml
 copy {datasketches-memory-java8-tests => datasketches-memory-tests}/src/test/resources/GettysburgAddress.txt (100%)

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@datasketches.apache.org
For additional commands, e-mail: commits-help@datasketches.apache.org


[datasketches-memory] 01/02: Add tests for packaged JAR

Posted by dc...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

dcromberge pushed a commit to branch multi-module-experimental
in repository https://gitbox.apache.org/repos/asf/datasketches-memory.git

commit 0f95f86459834352286762cedbd155d9672e1461
Author: David Cromberge <da...@gmail.com>
AuthorDate: Tue Jun 8 10:12:27 2021 +0100

    Add tests for packaged JAR
---
 datasketches-memory-java8-tests/pom.xml            |  21 +--
 .../datasketches/memory/internal/UnsafeUtil.java   |   2 +
 datasketches-memory-tests/pom.xml                  | 166 +++++++++++++++++++++
 .../src/test/resources/GettysburgAddress.txt       |   7 +
 datasketches-memory/pom.xml                        |  44 +++++-
 datasketches-memory/src/assembly/tests.xml         |   2 +-
 pom.xml                                            |  18 +--
 7 files changed, 222 insertions(+), 38 deletions(-)

diff --git a/datasketches-memory-java8-tests/pom.xml b/datasketches-memory-java8-tests/pom.xml
index 6ad6536..f8b80b4 100644
--- a/datasketches-memory-java8-tests/pom.xml
+++ b/datasketches-memory-java8-tests/pom.xml
@@ -40,7 +40,7 @@
     <dependencies>
         <dependency>
             <groupId>org.apache.datasketches</groupId>
-            <artifactId>datasketches-memory</artifactId>
+            <artifactId>datasketches-memory-java8</artifactId>
             <version>${project.parent.version}</version>
             <scope>test</scope>
         </dependency>
@@ -81,6 +81,7 @@
                                 <redirectTestOutputToFile>true</redirectTestOutputToFile>
                             </configuration>
                         </plugin>
+
                     </plugins>
                 </pluginManagement>
             </build>
@@ -108,24 +109,6 @@
                             <groupId>org.apache.maven.plugins</groupId>
                             <artifactId>maven-surefire-plugin</artifactId>
                             <version>${maven-surefire-plugin.version}</version>
-                            <executions>
-                                <execution>
-                                    <id>package-test</id>
-                                    <phase>package</phase>
-                                    <goals>
-                                        <goal>test</goal>
-                                    </goals>
-                                    <configuration>
-                                        <skip>false</skip>
-                                        <argLine>
-                                            --add-opens java.base/java.nio=ALL-UNNAMED
-                                            --add-opens java.base/jdk.internal.misc=ALL-UNNAMED
-                                            --add-opens java.base/jdk.internal.ref=ALL-UNNAMED
-                                            --add-opens org.apache.datasketches.memory/org.apache.datasketches.memory.internal=ALL-UNNAMED
-                                        </argLine>
-                                    </configuration>
-                                </execution>
-                            </executions>
                             <configuration>
                                 <skip>true</skip>
                                 <trimStackTrace>false</trimStackTrace>
diff --git a/datasketches-memory-java8/src/main/java/org/apache/datasketches/memory/internal/UnsafeUtil.java b/datasketches-memory-java8/src/main/java/org/apache/datasketches/memory/internal/UnsafeUtil.java
index ecd2ed5..3df8921 100644
--- a/datasketches-memory-java8/src/main/java/org/apache/datasketches/memory/internal/UnsafeUtil.java
+++ b/datasketches-memory-java8/src/main/java/org/apache/datasketches/memory/internal/UnsafeUtil.java
@@ -160,7 +160,9 @@ public final class UnsafeUtil {
 
   /**
    * Like {@link Unsafe#arrayBaseOffset(Class)}, but caches return values for common array types.
+   * @param c the class instance used to return the correct base offset.
    * Useful because calling {@link Unsafe#arrayBaseOffset(Class)} directly incurs more overhead.
+   * @return the array base offset for the class type provided.
    */
   public static long getArrayBaseOffset(final Class<?> c) {
     // Ordering here is roughly in order of what we expect to be most popular.
diff --git a/datasketches-memory-tests/pom.xml b/datasketches-memory-tests/pom.xml
new file mode 100644
index 0000000..57c6e44
--- /dev/null
+++ b/datasketches-memory-tests/pom.xml
@@ -0,0 +1,166 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one
+  ~ or more contributor license agreements.  See the NOTICE file
+  ~ distributed with this work for additional information
+  ~ regarding copyright ownership.  The ASF licenses this file
+  ~ to you under the Apache License, Version 2.0 (the
+  ~ "License"); you may not use this file except in compliance
+  ~ with the License.  You may obtain a copy of the License at
+  ~
+  ~   http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing,
+  ~ software distributed under the License is distributed on an
+  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~ KIND, either express or implied.  See the License for the
+  ~ specific language governing permissions and limitations
+  ~ under the License.
+  -->
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
+                             http://maven.apache.org/xsd/maven-4.0.0.xsd">
+
+  <modelVersion>4.0.0</modelVersion>
+
+  <parent>
+    <groupId>org.apache.datasketches</groupId>
+    <artifactId>datasketches-memory-root</artifactId>
+    <version>1.4.0-SNAPSHOT</version>
+  </parent>
+
+  <artifactId>datasketches-memory-tests</artifactId>
+  <name>${project.artifactId}</name>
+
+  <profiles>
+    <profile>
+      <id>java8</id>
+      <activation>
+        <jdk>1.8</jdk>
+        <property>
+          <name>environment</name>
+          <value>ci</value>
+        </property>
+      </activation>
+
+      <dependencies>
+        <dependency>
+          <groupId>org.apache.datasketches</groupId>
+          <artifactId>datasketches-memory</artifactId>
+          <version>${project.version}</version>
+        </dependency>
+        <dependency>
+          <groupId>org.apache.datasketches</groupId>
+          <artifactId>datasketches-memory-java8-tests</artifactId>
+          <version>${project.version}</version>
+          <classifier>tests</classifier>
+          <scope>test</scope>
+        </dependency>
+      </dependencies>
+
+      <build>
+        <pluginManagement>
+          <plugins>
+
+            <plugin>
+              <!-- Apache Parent pom, pluginManagement-->
+              <groupId>org.apache.maven.plugins</groupId>
+              <artifactId>maven-surefire-plugin</artifactId>
+              <version>${maven-surefire-plugin.version}</version>
+              <executions>
+                <execution>
+                  <id>package-test</id>
+                  <phase>package</phase>
+                  <goals>
+                    <goal>test</goal>
+                  </goals>
+                  <configuration>
+                    <skip>false</skip>
+                    <dependenciesToScan>
+                      <dependency>org.apache.datasketches:datasketches-memory-java8-tests</dependency>
+                    </dependenciesToScan>
+                  </configuration>
+                </execution>
+              </executions>
+              <configuration>
+                <skip>true</skip>
+                <trimStackTrace>false</trimStackTrace>
+                <useManifestOnlyJar>false</useManifestOnlyJar>
+                <redirectTestOutputToFile>true</redirectTestOutputToFile>
+              </configuration>
+            </plugin>
+          </plugins>
+        </pluginManagement>
+      </build>
+    </profile>
+
+    <profile>
+      <id>java9to14</id>
+      <activation>
+        <jdk>[9,14)</jdk>
+        <property>
+          <name>environment</name>
+          <value>ci</value>
+        </property>
+      </activation>
+
+      <dependencies>
+        <dependency>
+          <groupId>org.apache.datasketches</groupId>
+          <artifactId>datasketches-memory</artifactId>
+          <version>${project.version}</version>
+        </dependency>
+        <dependency>
+          <groupId>org.apache.datasketches</groupId>
+          <artifactId>datasketches-memory-java8-tests</artifactId>
+          <version>${project.version}</version>
+          <classifier>tests</classifier>
+          <scope>test</scope>
+        </dependency>
+      </dependencies>
+
+      <build>
+        <pluginManagement>
+          <plugins>
+
+            <plugin>
+              <!-- Apache Parent pom, pluginManagement-->
+              <groupId>org.apache.maven.plugins</groupId>
+              <artifactId>maven-surefire-plugin</artifactId>
+              <version>${maven-surefire-plugin.version}</version>
+              <executions>
+                <execution>
+                  <id>package-test</id>
+                  <phase>package</phase>
+                  <goals>
+                    <goal>test</goal>
+                  </goals>
+                  <configuration>
+                    <skip>false</skip>
+                    <argLine>
+                      --add-opens java.base/java.nio=ALL-UNNAMED
+                      --add-opens java.base/jdk.internal.misc=ALL-UNNAMED
+                      --add-opens java.base/jdk.internal.ref=ALL-UNNAMED
+                      --add-opens org.apache.datasketches.memory/org.apache.datasketches.memory.internal=ALL-UNNAMED
+                    </argLine>
+                    <dependenciesToScan>
+                      <dependency>org.apache.datasketches:datasketches-memory-java8-tests</dependency>
+                    </dependenciesToScan>
+                  </configuration>
+                </execution>
+              </executions>
+              <configuration>
+                <skip>true</skip>
+                <trimStackTrace>false</trimStackTrace>
+                <useManifestOnlyJar>false</useManifestOnlyJar>
+                <redirectTestOutputToFile>true</redirectTestOutputToFile>
+              </configuration>
+            </plugin>
+          </plugins>
+        </pluginManagement>
+      </build>
+    </profile>
+  </profiles>
+
+</project>
diff --git a/datasketches-memory-tests/src/test/resources/GettysburgAddress.txt b/datasketches-memory-tests/src/test/resources/GettysburgAddress.txt
new file mode 100644
index 0000000..3969d17
--- /dev/null
+++ b/datasketches-memory-tests/src/test/resources/GettysburgAddress.txt
@@ -0,0 +1,7 @@
+Abraham Lincoln's Gettysburg Address:
+
+    Four score and seven years ago our fathers brought forth on this continent, a new nation, conceived in Liberty, and dedicated to the proposition that all men are created equal.
+
+    Now we are engaged in a great civil war, testing whether that nation, or any nation so conceived and so dedicated, can long endure. We are met on a great battle-field of that war. We have come to dedicate a portion of that field, as a final resting place for those who here gave their lives that that nation might live. It is altogether fitting and proper that we should do this.
+
+    But, in a larger sense, we can not dedicate —- we can not consecrate —- we can not hallow —- this ground. The brave men, living and dead, who struggled here, have consecrated it, far above our poor power to add or detract. The world will little note, nor long remember what we say here, but it can never forget what they did here. It is for us the living, rather, to be dedicated here to the unfinished work which they who fought here have thus far so nobly advanced. It is rather for us  [...]
diff --git a/datasketches-memory/pom.xml b/datasketches-memory/pom.xml
index 907089b..2bcef88 100644
--- a/datasketches-memory/pom.xml
+++ b/datasketches-memory/pom.xml
@@ -49,6 +49,19 @@
             <artifactId>datasketches-memory-java11</artifactId>
             <version>${project.version}</version>
         </dependency>
+        <dependency>
+            <groupId>org.apache.datasketches</groupId>
+            <artifactId>datasketches-memory-java8-tests</artifactId>
+            <version>${project.version}</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.datasketches</groupId>
+            <artifactId>datasketches-memory-java9-tests</artifactId>
+            <version>${project.version}</version>
+            <scope>test</scope>
+        </dependency>
+
     </dependencies>
 
     <build>
@@ -96,8 +109,8 @@
                     <appendAssemblyId>false</appendAssemblyId>
                     <descriptors>
                         <descriptor>src/assembly/mrjar.xml</descriptor>
-<!--                        <descriptor>src/assembly/tests.xml</descriptor>-->
-<!--                        <descriptor>src/assembly/zip-dist.xml</descriptor>-->
+                        <!--                        <descriptor>src/assembly/tests.xml</descriptor>-->
+                        <!--                        <descriptor>src/assembly/zip-dist.xml</descriptor>-->
                     </descriptors>
                     <archive>
                         <manifestEntries>
@@ -114,6 +127,33 @@
                         </goals>
                     </execution>
                 </executions>
+
+            </plugin>
+
+            <plugin>
+                <!-- Generates code coverage report from website. -->
+                <groupId>org.jacoco</groupId>
+                <artifactId>jacoco-maven-plugin</artifactId>
+                <version>${jacoco-maven-plugin.version}</version>
+                <executions>
+                    <execution>
+                        <id>default-report</id>
+                        <goals>
+                            <goal>report-aggregate</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+
+            <plugin>
+                <!-- Submit code coverage report to Coveralls.io. -->
+                <groupId>org.eluder.coveralls</groupId>
+                <artifactId>coveralls-maven-plugin</artifactId>
+                <version>${coveralls-maven-plugin.version}</version>
+                <configuration>
+                    <!--suppress UnresolvedMavenProperty -->
+                    <repoToken>${coveralls-repo-token}</repoToken>
+                </configuration>
             </plugin>
 
         </plugins>
diff --git a/datasketches-memory/src/assembly/tests.xml b/datasketches-memory/src/assembly/tests.xml
index cefd45a..8ba4a5e 100644
--- a/datasketches-memory/src/assembly/tests.xml
+++ b/datasketches-memory/src/assembly/tests.xml
@@ -29,7 +29,7 @@
 
   <fileSets>
     <fileSet>
-      <directory>${maven.multiModuleProjectDirectory}/datasketches-memory-java8/target/test-classes</directory>
+      <directory>${maven.multiModuleProjectDirectory}/datasketches-memory-java8-tests/target/test-classes</directory>
       <outputDirectory>/</outputDirectory>
     </fileSet>
   </fileSets>
diff --git a/pom.xml b/pom.xml
index 3824a1f..3ba0b79 100644
--- a/pom.xml
+++ b/pom.xml
@@ -359,26 +359,10 @@ under the License.
                 <goal>prepare-agent</goal>
               </goals>
             </execution>
-            <execution>
-              <id>default-report</id>
-              <goals>
-                <goal>report</goal>
-              </goals>
-            </execution>
           </executions>
         </plugin>
 
         <plugin>
-          <!-- Submit code coverage report to Coveralls.io. -->
-          <groupId>org.eluder.coveralls</groupId>
-          <artifactId>coveralls-maven-plugin</artifactId>
-          <version>${coveralls-maven-plugin.version}</version>
-          <configuration>
-            <repoToken>${coveralls-repo-token}</repoToken>
-          </configuration>
-        </plugin>
-
-        <plugin>
           <groupId>org.eclipse.m2e</groupId>
           <artifactId>lifecycle-mapping</artifactId>
           <version>${lifecycle-mapping.version}</version>
@@ -432,6 +416,7 @@ under the License.
       <plugin>
         <groupId>org.eluder.coveralls</groupId>
         <artifactId>coveralls-maven-plugin</artifactId>
+        <version>${coveralls-maven-plugin.version}</version>
       </plugin>
       <plugin>
         <groupId>pl.project13.maven</groupId>
@@ -642,6 +627,7 @@ under the License.
     <module>datasketches-memory-java9-tests</module>
     <module>datasketches-memory-java11</module>
     <module>datasketches-memory</module>
+    <module>datasketches-memory-tests</module>
   </modules>
 
 </project>

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@datasketches.apache.org
For additional commands, e-mail: commits-help@datasketches.apache.org


[datasketches-memory] 02/02: Set environment during package tests

Posted by dc...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

dcromberge pushed a commit to branch multi-module-experimental
in repository https://gitbox.apache.org/repos/asf/datasketches-memory.git

commit a285bc16445778e4f3927091fea9007f12d136c6
Author: David Cromberge <da...@gmail.com>
AuthorDate: Tue Jun 8 10:13:23 2021 +0100

    Set environment during package tests
---
 .github/workflows/maven.yml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml
index ec5bdf3..68a9eed 100644
--- a/.github/workflows/maven.yml
+++ b/.github/workflows/maven.yml
@@ -85,6 +85,7 @@ jobs:
               mvn package
               -Dmaven.javadoc.skip=true
               -Dgpg.skip=true
+              -Denvironment=ci
               --toolchains .github/workflows/.toolchains.xml
 
         - name: Test & Report

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@datasketches.apache.org
For additional commands, e-mail: commits-help@datasketches.apache.org