(commons-jexl) branch master updated: JEXL: improve example on filter/map;

2023-11-08 Thread henrib
This is an automated email from the ASF dual-hosted git repository.

henrib pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-jexl.git


The following commit(s) were added to refs/heads/master by this push:
 new 0c8b1ea0 JEXL: improve example on filter/map;
0c8b1ea0 is described below

commit 0c8b1ea02497e1788288f75390fbad5fd6f95405
Author: Henri Biestro 
AuthorDate: Wed Nov 8 12:06:21 2023 +0100

JEXL: improve example on filter/map;
---
 .../apache/commons/jexl3/examples/StreamTest.java  | 108 -
 1 file changed, 103 insertions(+), 5 deletions(-)

diff --git a/src/test/java/org/apache/commons/jexl3/examples/StreamTest.java 
b/src/test/java/org/apache/commons/jexl3/examples/StreamTest.java
index 1f72d095..b57cd720 100644
--- a/src/test/java/org/apache/commons/jexl3/examples/StreamTest.java
+++ b/src/test/java/org/apache/commons/jexl3/examples/StreamTest.java
@@ -20,7 +20,10 @@ import static java.lang.Boolean.TRUE;
 
 import java.net.URI;
 import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
 import java.util.List;
+import java.util.Objects;
 import java.util.stream.Collectors;
 import java.util.stream.Stream;
 
@@ -40,7 +43,7 @@ import org.junit.Test;
  */
 public class StreamTest {
 /**
- * A MapContext that can operate on streams.
+ * A MapContext that can operate on streams and collections.
  */
 public static class StreamContext extends MapContext {
 /**
@@ -62,6 +65,31 @@ public class StreamTest {
 public Stream map(final Stream stream, final JexlScript mapper) {
 return stream.map( x -> mapper.execute(this, x));
 }
+
+/**
+ * This allows using a JEXL lambda as a filter.
+ * @param collection the collection
+ * @param filter the lambda to use as filter
+ * @return the filtered result as a list
+ */
+public List filter(Collection collection, final JexlScript 
filter) {
+return collection.stream()
+.filter(x -> x != null && TRUE.equals(filter.execute(this, x)))
+.collect(Collectors.toList());
+}
+
+/**
+ * This allows using a JEXL lambda as a mapper.
+ * @param collection the collection
+ * @param mapper the lambda to use as mapper
+ * @return the mapped result as a list
+ */
+public List map(Collection collection, final JexlScript mapper) {
+return collection.stream()
+.map(x -> mapper.execute(this, x))
+.filter(Objects::nonNull)
+.collect(Collectors.toList());
+}
 }
 
 /** Our engine instance. */
@@ -76,13 +104,17 @@ public class StreamTest {
 // Restricted permissions to a safe set but with URI allowed
 final JexlPermissions permissions = new 
ClassPermissions(java.net.URI.class);
 // Create the engine
-jexl = new 
JexlBuilder().features(features).permissions(permissions).create();
+jexl = new JexlBuilder()
+.features(features)
+.permissions(permissions)
+.namespaces(Collections.singletonMap("URI", java.net.URI.class))
+.create();
 }
 
 @Test
-public void testURIStream() throws Exception {
+public void testURIStream() {
 // let's assume a collection of uris need to be processed and 
transformed to be simplified ;
-// we want only http/https ones, only the host part and using an https 
scheme
+// we want only http/https ones, only the host part and using a https 
scheme
 final List uris = Arrays.asList(
 URI.create("http://u...@www.apache.org:8000?qry=true";),
 URI.create("https://commons.apache.org/releases/prepare.html";),
@@ -91,7 +123,7 @@ public class StreamTest {
 // Create the test control, the expected result of our script 
evaluation
 final List control =  uris.stream()
 .map(uri -> uri.getScheme().startsWith("http")? "https://"; + 
uri.getHost() : null)
-.filter(x -> x != null)
+.filter(Objects::nonNull)
 .collect(Collectors.toList());
 Assert.assertEquals(2, control.size());
 
@@ -114,4 +146,70 @@ public class StreamTest {
 Assert.assertTrue(transformed instanceof List);
 Assert.assertEquals(control, transformed);
 }
+
+/**
+ * A MapContext that can operate on streams and collections.
+ */
+public static class CollectionContext extends MapContext {
+/**
+ * This allows using a JEXL lambda as a filter.
+ * @param collection the collection
+ * @param filter the lambda to use as filter
+ * @return the filtered result as a list
+ */
+public List filter(Collection collection, final JexlScript 
filter) {
+return collection.stream()
+.filt

(commons-crypto) branch master updated: Drop check for OpenSSL library

2023-11-08 Thread sebb
This is an automated email from the ASF dual-hosted git repository.

sebb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-crypto.git


The following commit(s) were added to refs/heads/master by this push:
 new 8d7bfe34 Drop check for OpenSSL library
8d7bfe34 is described below

commit 8d7bfe342e5fb09e72077e576df673f80c1f691c
Author: Sebb 
AuthorDate: Wed Nov 8 11:17:57 2023 +

Drop check for OpenSSL library

The code does also support (some) LibreSsl implementations
---
 .github/workflows/maven.yml | 5 ++---
 .github/workflows/maven_adhoc.yml   | 4 ++--
 src/test/java/org/apache/commons/crypto/CryptoTest.java | 8 
 src/test/java/org/apache/commons/crypto/jna/OpenSslJnaTest.java | 8 
 4 files changed, 4 insertions(+), 21 deletions(-)

diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml
index 22f02cf2..469c331b 100644
--- a/.github/workflows/maven.yml
+++ b/.github/workflows/maven.yml
@@ -96,7 +96,6 @@ jobs:
   run: |
 openssl version -a
 echo "NAME=libcrypto-1_1-x64.dll" >> $env:GITHUB_ENV
-echo "CHECK_SKIP=skip" >> $env:GITHUB_ENV
 # N.B. '-V -B -ntp' is shorthand for '--show-version --batch-mode 
--no-transfer-progress'
 # 
 # The bash shell under Windows changes the openssl default library, so is 
not used for running tests
@@ -117,11 +116,11 @@ jobs:
   env:
 OPENSSL_HOME: "C:\\Miniconda\\Library"
   run: |
-mvn -V -B -ntp -DtrimStackTrace=false -D"jni.library.name=$env:NAME" 
-D"commons.crypto.OpenSslNativeJna=$env:NAME" 
-D"commons.crypto.openssl.check=$env:CHECK_SKIP"
+mvn -V -B -ntp -DtrimStackTrace=false -D"jni.library.name=$env:NAME" 
-D"commons.crypto.OpenSslNativeJna=$env:NAME"
 - name: Build with Maven (not Windows)
   if: ${{ matrix.os != 'windows-latest' }}
   run: |
-mvn -V -B -ntp -DtrimStackTrace=false -D"jni.library.path=$ENGINESDIR" 
-D"jna.library.path=$ENGINESDIR" -D"commons.crypto.openssl.check=$CHECK_SKIP"
+mvn -V -B -ntp -DtrimStackTrace=false -D"jni.library.path=$ENGINESDIR" 
-D"jna.library.path=$ENGINESDIR"
 - name: Check benchmark code compiles
   if: ${{ matrix.java == '8' }}
   env:
diff --git a/.github/workflows/maven_adhoc.yml 
b/.github/workflows/maven_adhoc.yml
index 1c5f8f10..4ffa1c61 100644
--- a/.github/workflows/maven_adhoc.yml
+++ b/.github/workflows/maven_adhoc.yml
@@ -65,7 +65,7 @@ jobs:
 OPENSSL_HOME: "C:\\Miniconda\\Library"
 NAME: "libcrypto-1_1-x64"
   run: |
-mvn clean test -B -V -ntp -D"jna.debug_load=true" 
-DtrimStackTrace=false -D"jni.library.name=$env:NAME" 
-D"commons.crypto.OpenSslNativeJna=$env:NAME" 
-D"commons.crypto.openssl.check=skip" -D"commons.crypto.debug=true"
+mvn clean test -B -V -ntp -D"jna.debug_load=true" 
-DtrimStackTrace=false -D"jni.library.name=$env:NAME" 
-D"commons.crypto.OpenSslNativeJna=$env:NAME" -D"commons.crypto.debug=true"
 - name: JNA test
   if: always()
   env:
@@ -89,4 +89,4 @@ jobs:
 - name: Maven test default
   if: always()
   run: |
-mvn surefire:test -B -V -ntp -D"jna.debug_load=true" 
-DtrimStackTrace=false -D"commons.crypto.openssl.check=skip" 
-D"commons.crypto.debug=true"
+mvn surefire:test -B -V -ntp -D"jna.debug_load=true" 
-DtrimStackTrace=false -D"commons.crypto.debug=true"
diff --git a/src/test/java/org/apache/commons/crypto/CryptoTest.java 
b/src/test/java/org/apache/commons/crypto/CryptoTest.java
index a775b937..9c1a532e 100644
--- a/src/test/java/org/apache/commons/crypto/CryptoTest.java
+++ b/src/test/java/org/apache/commons/crypto/CryptoTest.java
@@ -16,9 +16,6 @@
  */
 package org.apache.commons.crypto;
 
-import static org.hamcrest.CoreMatchers.containsString;
-import static org.hamcrest.MatcherAssert.assertThat;
-
 import static org.junit.jupiter.api.Assertions.assertNotNull;
 import static org.junit.jupiter.api.Assertions.assertTrue;
 
@@ -61,11 +58,6 @@ public class CryptoTest {
 assertTrue(Crypto.isNativeCodeLoaded(), "Native code loaded OK");
 Crypto.main(new String[] { }); // show the JNI library details
 assertTrue(Crypto.isNativeCodeLoaded(), "Completed OK");
-// Ensure that test loaded OpenSSL, not some other library
-// This may require jni.library.path to be defined if the default 
library is not OpenSSL
-if 
(!"skip".equals(System.getProperty("commons.crypto.openssl.check"))) { // allow 
check to be skipped
-assertThat(OpenSslInfoNative.OpenSSLVersion(0), 
containsString("OpenSSL"));
-}
 }
 
 }
diff --git a/src/test/java/org/apache/commons/crypto/jna/OpenSslJnaTest.java 
b/src/test/java/org/apache/commons/crypto/jna/OpenSslJnaTest.java
index 1859a4c2..96911e58 100644
--- a/src/test/java/org/apache/commons/crypto/jna/OpenSslJnaTest.java
+++ b/src/test/java/org/apache/commo

(commons-jexl) branch master updated: JEXL: improve example on filter/map; keep inner classes close to usage to ease comprehension when reading code

2023-11-08 Thread henrib
This is an automated email from the ASF dual-hosted git repository.

henrib pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-jexl.git


The following commit(s) were added to refs/heads/master by this push:
 new fd86178a JEXL: improve example on filter/map; keep inner classes close 
to usage to ease comprehension when reading code
fd86178a is described below

commit fd86178aac2db17d102cf2e7513fdfde5b7c6af1
Author: Henri Biestro 
AuthorDate: Wed Nov 8 12:31:23 2023 +0100

JEXL: improve example on filter/map; keep inner classes close to usage to 
ease comprehension when reading code
---
 .../apache/commons/jexl3/examples/StreamTest.java  | 64 +++---
 1 file changed, 20 insertions(+), 44 deletions(-)

diff --git a/src/test/java/org/apache/commons/jexl3/examples/StreamTest.java 
b/src/test/java/org/apache/commons/jexl3/examples/StreamTest.java
index b57cd720..962ca7b7 100644
--- a/src/test/java/org/apache/commons/jexl3/examples/StreamTest.java
+++ b/src/test/java/org/apache/commons/jexl3/examples/StreamTest.java
@@ -42,6 +42,26 @@ import org.junit.Test;
  * A test around scripting streams.
  */
 public class StreamTest {
+
+/** Our engine instance. */
+private final JexlEngine jexl;
+
+public StreamTest() {
+// Restricting features; no loops, no side effects
+final JexlFeatures features = new JexlFeatures()
+.loops(false)
+.sideEffectGlobal(false)
+.sideEffect(false);
+// Restricted permissions to a safe set but with URI allowed
+final JexlPermissions permissions = new 
ClassPermissions(java.net.URI.class);
+// Create the engine
+jexl = new JexlBuilder()
+.features(features)
+.permissions(permissions)
+.namespaces(Collections.singletonMap("URI", java.net.URI.class))
+.create();
+}
+
 /**
  * A MapContext that can operate on streams and collections.
  */
@@ -65,50 +85,6 @@ public class StreamTest {
 public Stream map(final Stream stream, final JexlScript mapper) {
 return stream.map( x -> mapper.execute(this, x));
 }
-
-/**
- * This allows using a JEXL lambda as a filter.
- * @param collection the collection
- * @param filter the lambda to use as filter
- * @return the filtered result as a list
- */
-public List filter(Collection collection, final JexlScript 
filter) {
-return collection.stream()
-.filter(x -> x != null && TRUE.equals(filter.execute(this, x)))
-.collect(Collectors.toList());
-}
-
-/**
- * This allows using a JEXL lambda as a mapper.
- * @param collection the collection
- * @param mapper the lambda to use as mapper
- * @return the mapped result as a list
- */
-public List map(Collection collection, final JexlScript mapper) {
-return collection.stream()
-.map(x -> mapper.execute(this, x))
-.filter(Objects::nonNull)
-.collect(Collectors.toList());
-}
-}
-
-/** Our engine instance. */
-private final JexlEngine jexl;
-
-public StreamTest() {
-// Restricting features; no loops, no side effects
-final JexlFeatures features = new JexlFeatures()
-.loops(false)
-.sideEffectGlobal(false)
-.sideEffect(false);
-// Restricted permissions to a safe set but with URI allowed
-final JexlPermissions permissions = new 
ClassPermissions(java.net.URI.class);
-// Create the engine
-jexl = new JexlBuilder()
-.features(features)
-.permissions(permissions)
-.namespaces(Collections.singletonMap("URI", java.net.URI.class))
-.create();
 }
 
 @Test



(commons-io) branch master updated: Add @SuppressWarnings

2023-11-08 Thread ggregory
This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-io.git


The following commit(s) were added to refs/heads/master by this push:
 new 00796635 Add @SuppressWarnings
00796635 is described below

commit 0079663587cc58d109dc584cb033796847067506
Author: Gary Gregory 
AuthorDate: Wed Nov 8 07:55:32 2023 -0500

Add @SuppressWarnings
---
 src/test/java/org/apache/commons/io/file/AbstractTempDirTest.java | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/test/java/org/apache/commons/io/file/AbstractTempDirTest.java 
b/src/test/java/org/apache/commons/io/file/AbstractTempDirTest.java
index 16bd66cc..7e6de1f5 100644
--- a/src/test/java/org/apache/commons/io/file/AbstractTempDirTest.java
+++ b/src/test/java/org/apache/commons/io/file/AbstractTempDirTest.java
@@ -54,6 +54,7 @@ public abstract class AbstractTempDirTest {
 }
 
 
+@SuppressWarnings("resource") // no FileSystem allocation
 protected final boolean isPosixFilePermissionsSupported() {
 return 
FileSystems.getDefault().supportedFileAttributeViews().contains("posix");
 }



(commons-io) branch master updated: Add test for FileChannels.contentEquals() #509

2023-11-08 Thread ggregory
This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-io.git


The following commit(s) were added to refs/heads/master by this push:
 new 283e53e5 Add test for FileChannels.contentEquals() #509
283e53e5 is described below

commit 283e53e54b9ab23c888f9e502c7e504bc6c58653
Author: Gary Gregory 
AuthorDate: Wed Nov 8 08:32:22 2023 -0500

Add test for FileChannels.contentEquals() #509

- Fix FileChannels.contentEquals()
---
 src/changes/changes.xml|   2 +
 .../apache/commons/io/channels/FileChannels.java   |   4 +-
 .../commons/io/channels/FileChannelsTest.java  | 112 +
 3 files changed, 116 insertions(+), 2 deletions(-)

diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index ad0ee4c9..1d5e1bf8 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -50,6 +50,8 @@ The  type attribute can be add,update,fix,remove.
 
   
   Fix wrong issue id 
in changelog #503.
+  Add test for FileChannels.contentEquals() #509.
+  Fix 
FileChannels.contentEquals().
 
 
   
diff --git a/src/main/java/org/apache/commons/io/channels/FileChannels.java 
b/src/main/java/org/apache/commons/io/channels/FileChannels.java
index 468c85b4..94116b14 100644
--- a/src/main/java/org/apache/commons/io/channels/FileChannels.java
+++ b/src/main/java/org/apache/commons/io/channels/FileChannels.java
@@ -60,6 +60,8 @@ public final class FileChannels {
 while (true) {
 final int read1 = channel1.read(byteBuffer1);
 final int read2 = channel2.read(byteBuffer2);
+byteBuffer1.clear();
+byteBuffer2.clear();
 if (read1 == IOUtils.EOF && read2 == IOUtils.EOF) {
 return byteBuffer1.equals(byteBuffer2);
 }
@@ -69,8 +71,6 @@ public final class FileChannels {
 if (!byteBuffer1.equals(byteBuffer2)) {
 return false;
 }
-byteBuffer1.clear();
-byteBuffer2.clear();
 }
 }
 
diff --git a/src/test/java/org/apache/commons/io/channels/FileChannelsTest.java 
b/src/test/java/org/apache/commons/io/channels/FileChannelsTest.java
new file mode 100644
index ..7a3b260a
--- /dev/null
+++ b/src/test/java/org/apache/commons/io/channels/FileChannelsTest.java
@@ -0,0 +1,112 @@
+/*
+ * 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.
+ */
+package org.apache.commons.io.channels;
+
+import static java.nio.charset.StandardCharsets.US_ASCII;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertNotEquals;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.nio.channels.FileChannel;
+
+import org.apache.commons.io.FileUtils;
+import org.apache.commons.io.file.AbstractTempDirTest;
+import org.apache.commons.lang3.StringUtils;
+import org.junit.jupiter.api.Test;
+
+/**
+ * Tests {@link FileChannels}.
+ */
+public class FileChannelsTest extends AbstractTempDirTest {
+
+private static final int BUFFER_SIZE = 1024;
+private static final String CONTENT = StringUtils.repeat("x", BUFFER_SIZE);
+
+private boolean isEmpty(final File empty) {
+return empty.length() == 0;
+}
+
+private void testContentEquals(final String content1, final String 
content2) throws IOException {
+assertTrue(FileChannels.contentEquals(null, null, BUFFER_SIZE));
+
+// Prepare test files with same size but different content
+// (first 3 bytes are different, followed by a large amount of equal 
content)
+final File file1 = new File(tempDirFile, "test1.txt");
+final File file2 = new File(tempDirFile, "test2.txt");
+FileUtils.writeStringToFile(file1, content1, US_ASCII);
+FileUtils.writeStringToFile(file2, content2, US_ASCII);
+
+// File checksums are different
+assertNotEquals(FileUtils.checksumCRC32(file1), 
FileUtils.checksumCRC32(file2));
+
+try (FileInputStream stream1 = new FileInputStream(fi

(commons-vfs) branch master updated: Make private class final

2023-11-08 Thread ggregory
This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-vfs.git


The following commit(s) were added to refs/heads/master by this push:
 new d4953ac9 Make private class final
d4953ac9 is described below

commit d4953ac9260343a14ce18720694363f4e0d9ed7c
Author: Gary Gregory 
AuthorDate: Wed Nov 8 09:41:24 2023 -0500

Make private class final
---
 .../main/java/org/apache/commons/vfs2/provider/ftp/FtpFileObject.java | 2 +-
 .../java/org/apache/commons/vfs2/provider/sftp/SftpFileObject.java| 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git 
a/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/ftp/FtpFileObject.java
 
b/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/ftp/FtpFileObject.java
index f9f279fb..6d879a38 100644
--- 
a/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/ftp/FtpFileObject.java
+++ 
b/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/ftp/FtpFileObject.java
@@ -103,7 +103,7 @@ public class FtpFileObject extends 
AbstractFileObject {
 /**
  * An OutputStream that monitors for end-of-file.
  */
-private class FtpOutputStream extends MonitorOutputStream {
+private final class FtpOutputStream extends MonitorOutputStream {
 private final FtpClient client;
 
 FtpOutputStream(final FtpClient client, final OutputStream outstr) {
diff --git 
a/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/sftp/SftpFileObject.java
 
b/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/sftp/SftpFileObject.java
index 32d480b0..8d9caea9 100644
--- 
a/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/sftp/SftpFileObject.java
+++ 
b/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/sftp/SftpFileObject.java
@@ -52,7 +52,7 @@ public class SftpFileObject extends 
AbstractFileObject {
 /**
  * An InputStream that monitors for end-of-file.
  */
-private class SftpInputStream extends MonitorInputStream {
+private final class SftpInputStream extends MonitorInputStream {
 private final ChannelSftp channel;
 
 SftpInputStream(final ChannelSftp channel, final InputStream in) {
@@ -77,7 +77,7 @@ public class SftpFileObject extends 
AbstractFileObject {
 /**
  * An OutputStream that wraps an sftp OutputStream, and closes the channel 
when the stream is closed.
  */
-private class SftpOutputStream extends MonitorOutputStream {
+private final class SftpOutputStream extends MonitorOutputStream {
 private final ChannelSftp channel;
 
 SftpOutputStream(final ChannelSftp channel, final OutputStream out) {



(commons-vfs) branch master updated: Better terst assertion messages

2023-11-08 Thread ggregory
This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-vfs.git


The following commit(s) were added to refs/heads/master by this push:
 new 0358d5f5 Better terst assertion messages
0358d5f5 is described below

commit 0358d5f599e7624e29445d5caff78cab945195e7
Author: Gary Gregory 
AuthorDate: Wed Nov 8 09:44:38 2023 -0500

Better terst assertion messages

Better param names
---
 .../org/apache/commons/vfs2/LastModifiedTests.java | 24 +++---
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git 
a/commons-vfs2/src/test/java/org/apache/commons/vfs2/LastModifiedTests.java 
b/commons-vfs2/src/test/java/org/apache/commons/vfs2/LastModifiedTests.java
index 9cba18d6..1a922811 100644
--- a/commons-vfs2/src/test/java/org/apache/commons/vfs2/LastModifiedTests.java
+++ b/commons-vfs2/src/test/java/org/apache/commons/vfs2/LastModifiedTests.java
@@ -32,24 +32,24 @@ public class LastModifiedTests extends 
AbstractProviderTestCase {
 
 protected static final Duration ONE_DAY = Duration.ofDays(1);
 
-protected void assertDeltaMillis(final String message, final long 
expected, final long actual, final long delta) {
-if (expected == actual) {
+protected void assertDeltaMillis(final String message, final long 
expectedMillis, final long actualMillis, final long deltaMillis) {
+if (expectedMillis == actualMillis) {
 return;
 }
 // getLastModTimeAccuracy() is not accurate
-final long actualDelta = Math.abs(expected - actual);
-if (actualDelta > Math.max(delta, 1000)) {
-Assertions.fail(String.format("%s expected=%,d (%s), actual=%,d 
(%s), expected delta=%,d, actual delta=%,d",
-message, Long.valueOf(expected), new 
Date(expected).toString(), Long.valueOf(actual),
-new Date(actual).toString(), Long.valueOf(delta), 
Long.valueOf(actualDelta)));
+final long actualDelta = Math.abs(expectedMillis - actualMillis);
+if (actualDelta > Math.max(deltaMillis, 1000)) {
+Assertions.fail(String.format("%s expected=%,d (%s), actual=%,d 
(%s), expected delta=%,d, actual delta=%,d millis", message,
+Long.valueOf(expectedMillis), new 
Date(expectedMillis).toString(), Long.valueOf(actualMillis), new 
Date(actualMillis).toString(),
+Long.valueOf(deltaMillis), Long.valueOf(actualDelta)));
 }
 }
 
-protected void assertEqualMillis(final String message, final long 
expected, final long actual) {
-if (expected != actual) {
-final long delta = Math.abs(expected - actual);
-Assertions.fail(String.format("%s expected=%,d (%s), actual=%,d 
(%s), delta=%,d", message, Long.valueOf(expected),
-new Date(expected).toString(), Long.valueOf(actual), new 
Date(actual).toString(), delta));
+protected void assertEqualMillis(final String message, final long 
expectedMillis, final long actualMillis) {
+if (expectedMillis != actualMillis) {
+final long delta = Math.abs(expectedMillis - actualMillis);
+Assertions.fail(String.format("%s expected=%,d (%s), actual=%,d 
(%s), delta=%,d millis", message, Long.valueOf(expectedMillis),
+new Date(expectedMillis).toString(), 
Long.valueOf(actualMillis), new Date(actualMillis).toString(), delta));
 }
 }
 



(commons-vfs) branch master updated: Better terst assertion messages

2023-11-08 Thread ggregory
This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-vfs.git


The following commit(s) were added to refs/heads/master by this push:
 new cf367d89 Better terst assertion messages
cf367d89 is described below

commit cf367d89a8cbf5dcc6856a8c1b119fb1575eb2be
Author: Gary Gregory 
AuthorDate: Wed Nov 8 09:46:43 2023 -0500

Better terst assertion messages
---
 .../src/test/java/org/apache/commons/vfs2/LastModifiedTests.java| 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git 
a/commons-vfs2/src/test/java/org/apache/commons/vfs2/LastModifiedTests.java 
b/commons-vfs2/src/test/java/org/apache/commons/vfs2/LastModifiedTests.java
index 1a922811..161ae86b 100644
--- a/commons-vfs2/src/test/java/org/apache/commons/vfs2/LastModifiedTests.java
+++ b/commons-vfs2/src/test/java/org/apache/commons/vfs2/LastModifiedTests.java
@@ -39,7 +39,7 @@ public class LastModifiedTests extends 
AbstractProviderTestCase {
 // getLastModTimeAccuracy() is not accurate
 final long actualDelta = Math.abs(expectedMillis - actualMillis);
 if (actualDelta > Math.max(deltaMillis, 1000)) {
-Assertions.fail(String.format("%s expected=%,d (%s), actual=%,d 
(%s), expected delta=%,d, actual delta=%,d millis", message,
+Assertions.fail(String.format("%s expected=%,d (%s), actual=%,d 
(%s), expected delta=%,d millis, actual delta=%,d millis", message,
 Long.valueOf(expectedMillis), new 
Date(expectedMillis).toString(), Long.valueOf(actualMillis), new 
Date(actualMillis).toString(),
 Long.valueOf(deltaMillis), Long.valueOf(actualDelta)));
 }



(commons-vfs) branch master updated: Better local name

2023-11-08 Thread ggregory
This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-vfs.git


The following commit(s) were added to refs/heads/master by this push:
 new eb3dc181 Better local name
eb3dc181 is described below

commit eb3dc181d3f927f402998bdcdd0ebc94e7c7f346
Author: Gary Gregory 
AuthorDate: Wed Nov 8 09:48:14 2023 -0500

Better local name
---
 .../test/java/org/apache/commons/vfs2/AbstractProviderTestCase.java | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git 
a/commons-vfs2/src/test/java/org/apache/commons/vfs2/AbstractProviderTestCase.java
 
b/commons-vfs2/src/test/java/org/apache/commons/vfs2/AbstractProviderTestCase.java
index bee0e502..f4255659 100644
--- 
a/commons-vfs2/src/test/java/org/apache/commons/vfs2/AbstractProviderTestCase.java
+++ 
b/commons-vfs2/src/test/java/org/apache/commons/vfs2/AbstractProviderTestCase.java
@@ -227,9 +227,9 @@ public abstract class AbstractProviderTestCase extends 
TestCase {
 }
 
 protected FileSystem getFileSystem() {
-final FileObject rFolder = getReadFolder();
-Assert.assertNotNull("This test's read folder should not be null", 
rFolder);
-return rFolder.getFileSystem();
+final FileObject readFolder = getReadFolder();
+Assert.assertNotNull("This test's read folder should not be null", 
readFolder);
+return readFolder.getFileSystem();
 }
 
 /**



(commons-vfs) branch master updated: Javadoc

2023-11-08 Thread ggregory
This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-vfs.git


The following commit(s) were added to refs/heads/master by this push:
 new b2467fe1 Javadoc
b2467fe1 is described below

commit b2467fe10980a00b1696f1750194742a74a66791
Author: Gary Gregory 
AuthorDate: Wed Nov 8 10:05:44 2023 -0500

Javadoc
---
 .../commons/vfs2/provider/AbstractFileSystem.java  | 28 +++---
 1 file changed, 14 insertions(+), 14 deletions(-)

diff --git 
a/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/AbstractFileSystem.java
 
b/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/AbstractFileSystem.java
index 3045b332..124bfd20 100644
--- 
a/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/AbstractFileSystem.java
+++ 
b/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/AbstractFileSystem.java
@@ -289,7 +289,7 @@ public abstract class AbstractFileSystem extends 
AbstractVfsComponent implements
 }
 
 /**
- * Retrieves the attribute with the specified name. The default 
implementation simply throws an exception.
+ * Gets the attribute with the specified name. The default implementation 
simply throws an exception.
  *
  * @param attrName The name of the attribute.
  * @return the Object associated with the attribute or null if no object 
is.
@@ -305,7 +305,7 @@ public abstract class AbstractFileSystem extends 
AbstractVfsComponent implements
 }
 
 /**
- * Returns a cached file.
+ * Gets a cached file.
  *
  * @param name name to search for.
  * @return file object or null if not found.
@@ -320,7 +320,7 @@ public abstract class AbstractFileSystem extends 
AbstractVfsComponent implements
 }
 
 /**
- * Returns the FileSystemManager used to instantiate this file system.
+ * Gets the FileSystemManager used to instantiate this file system.
  *
  * @return the FileSystemManager.
  */
@@ -330,7 +330,7 @@ public abstract class AbstractFileSystem extends 
AbstractVfsComponent implements
 }
 
 /**
- * Returns the FileSystemOptions used to instantiate this file system.
+ * Gets the FileSystemOptions used to instantiate this file system.
  *
  * @return the FileSystemOptions.
  */
@@ -340,9 +340,9 @@ public abstract class AbstractFileSystem extends 
AbstractVfsComponent implements
 }
 
 /**
- * Returns the accuracy of the last modification time.
+ * Gets the accuracy of the last modification time.
  *
- * @return ms 0 perfectly accurate, {@literal >0} might be off by this 
value e.g. sftp 1000ms
+ * @return milliseconds, 0 means perfectly accurate, {@code > 0} might be 
off by this value, for examnple, sftp is 1000 milliseconds.
  */
 @Override
 public double getLastModTimeAccuracy() {
@@ -350,7 +350,7 @@ public abstract class AbstractFileSystem extends 
AbstractVfsComponent implements
 }
 
 /**
- * Returns the parent layer if this is a layered file system.
+ * Gets the parent layer if this is a layered file system.
  *
  * @return The FileObject for the parent layer.
  * @throws FileSystemException if an error occurs.
@@ -361,7 +361,7 @@ public abstract class AbstractFileSystem extends 
AbstractVfsComponent implements
 }
 
 /**
- * Returns the root file of this file system.
+ * Gets the root file of this file system.
  *
  * @return The root FileObject of the FileSystem
  * @throws FileSystemException if an error occurs.
@@ -372,7 +372,7 @@ public abstract class AbstractFileSystem extends 
AbstractVfsComponent implements
 }
 
 /**
- * Returns the name of the root of this file system.
+ * Gets the name of the root of this file system.
  *
  * @return the root FileName.
  */
@@ -382,7 +382,7 @@ public abstract class AbstractFileSystem extends 
AbstractVfsComponent implements
 }
 
 /**
- * Returns the root URI specified for this file System.
+ * Gets the root URI specified for this file System.
  *
  * @return The root URI used in this file system.
  * @since 2.0
@@ -393,7 +393,7 @@ public abstract class AbstractFileSystem extends 
AbstractVfsComponent implements
 }
 
 /**
- * Determines if this file system has a particular capability.
+ * Tests whether this file system has a particular capability.
  *
  * @param capability the Capability to check for.
  * @return true if the FileSystem has the Capability, false otherwise.
@@ -414,7 +414,7 @@ public abstract class AbstractFileSystem extends 
AbstractVfsComponent implements
 }
 
 /**
- * Checks if this file system has open streams.
+ * Tests whether this file system has open streams.
  *
  * @return true if the FileSystem has open streams.
  */
@@ -423,9 +423,9 @@ public abstract class AbstractFileSyste

(commons-crypto) branch crypto-174 deleted (was db284325)

2023-11-08 Thread sebb
This is an automated email from the ASF dual-hosted git repository.

sebb pushed a change to branch crypto-174
in repository https://gitbox.apache.org/repos/asf/commons-crypto.git


 was db284325 Crypto 174 (#268)

The revisions that were on this branch are still contained in
other references; therefore, this change does not discard any commits
from the repository.



(commons-vfs) branch master updated: Remove test cruft

2023-11-08 Thread ggregory
This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-vfs.git


The following commit(s) were added to refs/heads/master by this push:
 new a99e0f7f Remove test cruft
a99e0f7f is described below

commit a99e0f7fa930f8374c022795c3a7f8ca14225b9a
Author: Gary Gregory 
AuthorDate: Wed Nov 8 14:32:07 2023 -0500

Remove test cruft
---
 .../org/apache/commons/vfs2/AbstractProviderTestCase.java   | 13 -
 1 file changed, 13 deletions(-)

diff --git 
a/commons-vfs2/src/test/java/org/apache/commons/vfs2/AbstractProviderTestCase.java
 
b/commons-vfs2/src/test/java/org/apache/commons/vfs2/AbstractProviderTestCase.java
index f4255659..65d3673a 100644
--- 
a/commons-vfs2/src/test/java/org/apache/commons/vfs2/AbstractProviderTestCase.java
+++ 
b/commons-vfs2/src/test/java/org/apache/commons/vfs2/AbstractProviderTestCase.java
@@ -46,19 +46,6 @@ public abstract class AbstractProviderTestCase extends 
TestCase {
 // Expected contents of test files
 public static final String TEST_FILE_CONTENT = "A test file.";
 
-protected static Test notConfigured(final Class testClass) {
-return warning(testClass + " is not configured for tests, skipping");
-}
-
-private static Test warning(final String message) {
-return new TestCase("warning") {
-@Override
-protected void runTest() {
-System.out.println(message);
-}
-};
-}
-
 private boolean addEmptyDir;
 private FileObject baseFolder;
 private DefaultFileSystemManager manager;



(commons-crypto) branch master updated: Define version 3 constant [skip ci]

2023-11-08 Thread sebb
This is an automated email from the ASF dual-hosted git repository.

sebb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-crypto.git


The following commit(s) were added to refs/heads/master by this push:
 new 56a15dd6 Define version 3 constant [skip ci]
56a15dd6 is described below

commit 56a15dd672217a879bbdda5b1549548512a569f9
Author: Sebb 
AuthorDate: Wed Nov 8 23:50:22 2023 +

Define version 3 constant [skip ci]
---
 src/main/native/org/apache/commons/crypto/org_apache_commons_crypto.h | 1 +
 1 file changed, 1 insertion(+)

diff --git 
a/src/main/native/org/apache/commons/crypto/org_apache_commons_crypto.h 
b/src/main/native/org/apache/commons/crypto/org_apache_commons_crypto.h
index 6832100a..1ba10a75 100644
--- a/src/main/native/org/apache/commons/crypto/org_apache_commons_crypto.h
+++ b/src/main/native/org/apache/commons/crypto/org_apache_commons_crypto.h
@@ -316,6 +316,7 @@ static FARPROC WINAPI do_dlsym_fallback(JNIEnv *env, 
HMODULE handle, LPCSTR symb
 
 #define VERSION_1_0_X 0x1000
 #define VERSION_1_1_X 0x1010
+#define VERSION_3_0_X 0x3000
 
 #endif
 



(commons-crypto) branch master updated: Allow for renamed OpenSSL3 methods

2023-11-08 Thread sebb
This is an automated email from the ASF dual-hosted git repository.

sebb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-crypto.git


The following commit(s) were added to refs/heads/master by this push:
 new 03f88de6 Allow for renamed OpenSSL3 methods
03f88de6 is described below

commit 03f88de6b5d37e7c426a9ce389d67ef05c5f7f34
Author: Sebb 
AuthorDate: Wed Nov 8 23:51:10 2023 +

Allow for renamed OpenSSL3 methods
---
 .../org/apache/commons/crypto/cipher/OpenSslNative.c | 20 +---
 1 file changed, 17 insertions(+), 3 deletions(-)

diff --git a/src/main/native/org/apache/commons/crypto/cipher/OpenSslNative.c 
b/src/main/native/org/apache/commons/crypto/cipher/OpenSslNative.c
index 44da3455..f2408f14 100644
--- a/src/main/native/org/apache/commons/crypto/cipher/OpenSslNative.c
+++ b/src/main/native/org/apache/commons/crypto/cipher/OpenSslNative.c
@@ -30,6 +30,7 @@
 #include "org_apache_commons_crypto_cipher_OpenSslNative.h"
 
 #ifdef UNIX
+static unsigned long (*dlsym_OpenSSL_version_num) (void);
 static EVP_CIPHER_CTX * (*dlsym_EVP_CIPHER_CTX_new)(void);
 static void (*dlsym_EVP_CIPHER_CTX_free)(EVP_CIPHER_CTX *);
 static int (*dlsym_EVP_CIPHER_CTX_set_padding)(EVP_CIPHER_CTX *, int);
@@ -55,6 +56,8 @@ static EVP_CIPHER * (*dlsym_EVP_aes_128_gcm)(void);
 #endif
 
 #ifdef WINDOWS
+typedef unsigned long (__cdecl *__dlsym_OpenSSL_version_num) (void);
+static __dlsym_OpenSSL_version_num dlsym_OpenSSL_version_num;
 typedef EVP_CIPHER_CTX * (__cdecl *__dlsym_EVP_CIPHER_CTX_new)(void);
 typedef void (__cdecl *__dlsym_EVP_CIPHER_CTX_free)(EVP_CIPHER_CTX *);
 typedef int (__cdecl *__dlsym_EVP_CIPHER_CTX_set_padding)(EVP_CIPHER_CTX *, 
int);
@@ -135,6 +138,8 @@ JNIEXPORT void JNICALL 
Java_org_apache_commons_crypto_cipher_OpenSslNative_initI
 #ifdef UNIX
   dlerror();  // Clear any existing error
 #endif
+  LOAD_DYNAMIC_SYMBOL_FALLBACK(__dlsym_OpenSSL_version_num, 
dlsym_OpenSSL_version_num, \
+  env, openssl, "OpenSSL_version_num", "SSLeay");
   LOAD_DYNAMIC_SYMBOL(__dlsym_EVP_CIPHER_CTX_new, dlsym_EVP_CIPHER_CTX_new,  \
   env, openssl, "EVP_CIPHER_CTX_new");
   LOAD_DYNAMIC_SYMBOL(__dlsym_EVP_CIPHER_CTX_free, dlsym_EVP_CIPHER_CTX_free,  
\
@@ -143,12 +148,21 @@ JNIEXPORT void JNICALL 
Java_org_apache_commons_crypto_cipher_OpenSslNative_initI
   env, openssl, "EVP_CIPHER_CTX_set_padding");
   LOAD_DYNAMIC_SYMBOL(__dlsym_EVP_CIPHER_CTX_ctrl, dlsym_EVP_CIPHER_CTX_ctrl,  
\
   env, openssl, "EVP_CIPHER_CTX_ctrl");
+  char *block_size_name;
+  char *flags_name;
+  if (dlsym_OpenSSL_version_num() < VERSION_3_0_X) {
+block_size_name = "EVP_CIPHER_CTX_block_size";
+flags_name = "EVP_CIPHER_flags";
+  } else {
+block_size_name = "EVP_CIPHER_CTX_get_block_size";
+flags_name = "EVP_CIPHER_get_flags";
+  }
   LOAD_DYNAMIC_SYMBOL(__dlsym_EVP_CIPHER_CTX_block_size, 
dlsym_EVP_CIPHER_CTX_block_size,  \
-  env, openssl, "EVP_CIPHER_CTX_block_size");
+env, openssl, block_size_name);
+  LOAD_DYNAMIC_SYMBOL(__dlsym_EVP_CIPHER_flags, dlsym_EVP_CIPHER_flags,  \
+env, openssl, flags_name);
   LOAD_DYNAMIC_SYMBOL(__dlsym_EVP_CIPHER_CTX_cipher, 
dlsym_EVP_CIPHER_CTX_cipher,  \
   env, openssl, "EVP_CIPHER_CTX_cipher");
-  LOAD_DYNAMIC_SYMBOL(__dlsym_EVP_CIPHER_flags, dlsym_EVP_CIPHER_flags,  \
-  env, openssl, "EVP_CIPHER_flags");
   LOAD_DYNAMIC_SYMBOL(__dlsym_EVP_CIPHER_CTX_test_flags, 
dlsym_EVP_CIPHER_CTX_test_flags,  \
   env, openssl, "EVP_CIPHER_CTX_test_flags");
   LOAD_DYNAMIC_SYMBOL(__dlsym_EVP_CipherInit_ex, dlsym_EVP_CipherInit_ex,  \



(commons-crypto) branch master updated: Try macos and ubuntu latest

2023-11-08 Thread sebb
This is an automated email from the ASF dual-hosted git repository.

sebb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-crypto.git


The following commit(s) were added to refs/heads/master by this push:
 new d02f448d Try macos and ubuntu latest
d02f448d is described below

commit d02f448d3780de086465bb7c2808f40404c040fe
Author: Sebb 
AuthorDate: Wed Nov 8 23:56:18 2023 +

Try macos and ubuntu latest
---
 .github/workflows/maven_adhoc.yml | 35 ++-
 1 file changed, 14 insertions(+), 21 deletions(-)

diff --git a/.github/workflows/maven_adhoc.yml 
b/.github/workflows/maven_adhoc.yml
index 4ffa1c61..15e9d4f0 100644
--- a/.github/workflows/maven_adhoc.yml
+++ b/.github/workflows/maven_adhoc.yml
@@ -35,22 +35,15 @@ jobs:
   matrix:
 # macos-latest and ubuntu-latest uses OpenSSL 3 which breaks tests
 # os: [macos-11, ubuntu-20.04, windows-latest]
-os: [ windows-latest ]
+os: [ macos-latest, ubuntu-latest ]
 # These names are used in conditional statements below.
 # java: [ 8, 11, 17, 21 ]
 java: [ 8 ]
 experimental: [false]
 
 steps:
-- name: Search
-  run: |
-dir "C:\Program Files"
-dir "C:\Program Files\OpenSSL"
-dir "C:\Program Files\OpenSSL\lib"
-dir "C:\Windows\SYSTEM32"
 - name: OpenSSL version
   run: openssl version -a
-  #  Get-Childitem –Path "C:\Program Files"  -File -Include libcrypto* 
-Recurse -ErrorAction SilentlyContinue
 - name: Checkout
   uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
   with:
@@ -65,19 +58,19 @@ jobs:
 OPENSSL_HOME: "C:\\Miniconda\\Library"
 NAME: "libcrypto-1_1-x64"
   run: |
-mvn clean test -B -V -ntp -D"jna.debug_load=true" 
-DtrimStackTrace=false -D"jni.library.name=$env:NAME" 
-D"commons.crypto.OpenSslNativeJna=$env:NAME" -D"commons.crypto.debug=true"
-- name: JNA test
-  if: always()
-  env:
-NAME: "crypto-1_1-x64"
-  run: |
-mvn -q exec:java -D"jna.debug_load=true" 
-D"exec.mainClass=org.apache.commons.crypto.jna.OpenSslJna" 
-D"commons.crypto.debug=true" -D"commons.crypto.OpenSslNativeJna=$env:NAME"
-- name: JNI test
-  if: always()
-  env:
-NAME: "libcrypto-1_1-x64"
-  run: |
-mvn -q exec:java -D"exec.mainClass=org.apache.commons.crypto.Crypto" 
-D"commons.crypto.debug=true" -D"jni.library.name=$env:NAME"
+mvn clean test -B -V -ntp -D"jna.debug_load=true" 
-DtrimStackTrace=false -D"commons.crypto.debug=true"
+# - name: JNA test
+#   if: always()
+#   env:
+# NAME: "crypto-1_1-x64"
+#   run: |
+# mvn -q exec:java -D"jna.debug_load=true" 
-D"exec.mainClass=org.apache.commons.crypto.jna.OpenSslJna" 
-D"commons.crypto.debug=true" -D"commons.crypto.OpenSslNativeJna=$env:NAME"
+# - name: JNI test
+#   if: always()
+#   env:
+# NAME: "libcrypto-1_1-x64"
+#   run: |
+# mvn -q exec:java -D"exec.mainClass=org.apache.commons.crypto.Crypto" 
-D"commons.crypto.debug=true" -D"jni.library.name=$env:NAME"
 - name: JNI test default
   if: always()
   run: |



(commons-vfs) branch master updated: Port assertions to JUnit 5 APIs

2023-11-08 Thread ggregory
This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-vfs.git


The following commit(s) were added to refs/heads/master by this push:
 new 1a0b5351 Port assertions to JUnit 5 APIs
1a0b5351 is described below

commit 1a0b5351eb7b15769710444f0e0fce82eb4fe3b9
Author: Gary Gregory 
AuthorDate: Wed Nov 8 18:59:07 2023 -0500

Port assertions to JUnit 5 APIs
---
 .../commons/vfs2/AbstractProviderTestCase.java | 14 ++--
 .../org/apache/commons/vfs2/AbstractTestSuite.java | 22 +++---
 .../vfs2/cache/DefaultFilesCacheTestCase.java  |  4 +-
 .../commons/vfs2/cache/LRUFilesCacheTestCase.java  |  4 +-
 .../commons/vfs2/cache/NullFilesCacheTestCase.java |  4 +-
 .../vfs2/cache/SoftRefFilesCacheTestCase.java  |  4 +-
 .../vfs2/cache/WeakRefFilesCacheTestCase.java  |  4 +-
 .../commons/vfs2/filter/AgeFileFilterTest.java | 63 +++
 .../apache/commons/vfs2/filter/BaseFilterTest.java | 11 +--
 .../commons/vfs2/filter/CanReadFileFilterTest.java | 29 +++
 .../vfs2/filter/CanWriteFileFilterTest.java| 21 ++---
 .../vfs2/filter/DirectoryAndFileFilterTest.java| 21 ++---
 .../commons/vfs2/filter/EmptyFileFilterTest.java   | 29 +++
 .../commons/vfs2/filter/HiddenFileFilterTest.java  | 15 ++--
 .../commons/vfs2/filter/SizeFileFilterTest.java| 67 
 .../vfs2/provider/ftp/FtpProviderIPv6TestCase.java |  4 +-
 .../provider/ftp/FtpProviderMdtmOffTestCase.java   |  4 +-
 .../vfs2/provider/ftp/FtpProviderTestCase.java |  4 +-
 .../provider/ftp/FtpProviderUserDirTestCase.java   |  4 +-
 .../vfs2/provider/http4/Http4ProviderTestCase.java |  2 -
 .../vfs2/provider/jar/JarProviderTestCase.java |  4 +-
 .../vfs2/provider/jar/NestedJarTestCase.java   |  4 +-
 .../vfs2/provider/local/LocalProviderTestCase.java |  4 +-
 .../vfs2/provider/ram/CustomRamProviderTest.java   | 89 +++---
 .../vfs2/provider/ram/RamProviderTestCase.java |  4 +-
 .../provider/res/ResourceProviderTestCase.java |  4 +-
 .../provider/sftp/SftpFileSystemGroupsTests.java   |  9 ++-
 .../SftpProviderClosedExecChannelTestCase.java |  4 +-
 .../provider/sftp/SftpProviderIPv6TestCase.java|  3 +-
 .../sftp/SftpProviderStreamProxyModeTestCase.java  |  4 +-
 .../vfs2/provider/sftp/SftpProviderTestCase.java   |  4 +-
 .../commons/vfs2/provider/tar/LargeTarTest.java| 10 +--
 .../vfs2/provider/tar/NestedTarTestCase.java   |  4 +-
 .../vfs2/provider/tar/NestedTbz2TestCase.java  |  4 +-
 .../vfs2/provider/tar/NestedTgzTestCase.java   |  4 +-
 .../vfs2/provider/tar/TarProviderTestCase.java |  4 +-
 .../vfs2/provider/tar/Tbz2ProviderTestCase.java|  4 +-
 .../vfs2/provider/tar/TgzProviderTestCase.java |  4 +-
 .../provider/temp/TemporaryProviderTestCase.java   |  4 +-
 .../provider/test/VirtualProviderTestCase.java |  4 +-
 .../vfs2/provider/url/UrlHttpProviderTestCase.java |  4 +-
 .../vfs2/provider/url/UrlProviderHttpTestCase.java |  4 +-
 .../vfs2/provider/url/UrlProviderTestCase.java |  4 +-
 .../vfs2/provider/zip/NestedZipTestCase.java   |  4 +-
 .../vfs2/provider/zip/ZipFileObjectTest.java   | 16 ++--
 .../vfs2/provider/zip/ZipProviderTestCase.java |  4 +-
 .../zip/ZipProviderWithCharsetNullTestCase.java|  4 +-
 .../zip/ZipProviderWithCharsetTestCase.java|  4 +-
 .../DelegatingFileSystemOptionsBuilderTest.java| 26 +++
 src/changes/changes.xml|  3 +
 50 files changed, 300 insertions(+), 278 deletions(-)

diff --git 
a/commons-vfs2/src/test/java/org/apache/commons/vfs2/AbstractProviderTestCase.java
 
b/commons-vfs2/src/test/java/org/apache/commons/vfs2/AbstractProviderTestCase.java
index 65d3673a..9b02bf13 100644
--- 
a/commons-vfs2/src/test/java/org/apache/commons/vfs2/AbstractProviderTestCase.java
+++ 
b/commons-vfs2/src/test/java/org/apache/commons/vfs2/AbstractProviderTestCase.java
@@ -16,7 +16,7 @@
  */
 package org.apache.commons.vfs2;
 
-import static org.junit.Assert.assertArrayEquals;
+import static org.junit.jupiter.api.Assertions.assertArrayEquals;
 
 import java.io.ByteArrayOutputStream;
 import java.io.InputStream;
@@ -25,13 +25,11 @@ import java.lang.reflect.Method;
 import java.net.URLConnection;
 import java.nio.charset.StandardCharsets;
 
+import junit.framework.TestCase;
+
 import org.apache.commons.vfs2.impl.DefaultFileSystemManager;
 import org.apache.commons.vfs2.provider.AbstractFileSystem;
 import org.apache.commons.vfs2.provider.local.DefaultLocalFileProvider;
-import org.junit.Assert;
-
-import junit.framework.Test;
-import junit.framework.TestCase;
 
 /**
  * File system test cases, which verifies the structure and naming 
functionality.
@@ -92,7 +90,7 @@ public abstract class AbstractProviderTestCase extends 
TestCase {
 }
 
 // Compare
-assertArrayEquals("same binary content", expectedBin, 
outstr.toByteArray()

(commons-crypto) branch master updated: Try Java 21

2023-11-08 Thread sebb
This is an automated email from the ASF dual-hosted git repository.

sebb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-crypto.git


The following commit(s) were added to refs/heads/master by this push:
 new a8535d34 Try Java 21
a8535d34 is described below

commit a8535d344a4a366f013c131096efa4dcde07567f
Author: Sebb 
AuthorDate: Thu Nov 9 00:05:14 2023 +

Try Java 21
---
 .github/workflows/maven_adhoc.yml | 8 +++-
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/.github/workflows/maven_adhoc.yml 
b/.github/workflows/maven_adhoc.yml
index 15e9d4f0..e18fb87b 100644
--- a/.github/workflows/maven_adhoc.yml
+++ b/.github/workflows/maven_adhoc.yml
@@ -38,7 +38,7 @@ jobs:
 os: [ macos-latest, ubuntu-latest ]
 # These names are used in conditional statements below.
 # java: [ 8, 11, 17, 21 ]
-java: [ 8 ]
+java: [ 21 ]
 experimental: [false]
 
 steps:
@@ -53,12 +53,11 @@ jobs:
   with:
 distribution: 'temurin'
 java-version: ${{ matrix.java }}
-- name: Build with Maven
+- name: Build only
   env:
 OPENSSL_HOME: "C:\\Miniconda\\Library"
-NAME: "libcrypto-1_1-x64"
   run: |
-mvn clean test -B -V -ntp -D"jna.debug_load=true" 
-DtrimStackTrace=false -D"commons.crypto.debug=true"
+mvn clean test -B -V -ntp -DskipTests
 # - name: JNA test
 #   if: always()
 #   env:
@@ -72,7 +71,6 @@ jobs:
 #   run: |
 # mvn -q exec:java -D"exec.mainClass=org.apache.commons.crypto.Crypto" 
-D"commons.crypto.debug=true" -D"jni.library.name=$env:NAME"
 - name: JNI test default
-  if: always()
   run: |
 mvn -q exec:java -D"exec.mainClass=org.apache.commons.crypto.Crypto" 
-D"commons.crypto.debug=true"
 - name: JNA test default