You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hc.apache.org by ol...@apache.org on 2021/05/23 21:44:11 UTC

[httpcomponents-core] branch devel updated (d684ca0 -> 97b3bfb)

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

olegk pushed a change to branch devel
in repository https://gitbox.apache.org/repos/asf/httpcomponents-core.git.


 discard d684ca0  Adjusted test cases incompatible with Java 16 strong encapsulation of JDK internals
     new fbdc4b1  Upgraded japicmp-maven-plugin to version 0.15.3
     new 97b3bfb  Adjusted test cases incompatible with Java 16 strong encapsulation of JDK internals

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (d684ca0)
            \
             N -- N -- N   refs/heads/devel (97b3bfb)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

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:
 .../src/test/java/org/apache/hc/core5/testing/nio/H2AlpnTest.java      | 3 +--
 pom.xml                                                                | 2 +-
 2 files changed, 2 insertions(+), 3 deletions(-)

[httpcomponents-core] 02/02: Adjusted test cases incompatible with Java 16 strong encapsulation of JDK internals

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

olegk pushed a commit to branch devel
in repository https://gitbox.apache.org/repos/asf/httpcomponents-core.git

commit 97b3bfbb7e34936fb650ae7e138bac219fd00409
Author: Oleg Kalnichevski <ol...@apache.org>
AuthorDate: Sun May 23 23:37:55 2021 +0200

    Adjusted test cases incompatible with Java 16 strong encapsulation of JDK internals
---
 .travis.yml                                            |  5 +----
 .../org/apache/hc/core5/testing/nio/H2AlpnTest.java    | 10 +++++++++-
 .../core5/testing/nio/H2ProtocolNegotiationTest.java   | 10 +++++-----
 .../hc/core5/http/impl/io/TestBHttpConnectionBase.java | 18 +++++++-----------
 .../hc/core5/http/impl/io/TestSessionInOutBuffers.java |  5 +++--
 5 files changed, 25 insertions(+), 23 deletions(-)

diff --git a/.travis.yml b/.travis.yml
index c6cff08..2116214 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -24,6 +24,7 @@ jdk:
   - oraclejdk8
   - openjdk11
   - oraclejdk11
+  - oraclejdk16
   - openjdk-ea
 
 addons:
@@ -41,7 +42,3 @@ jobs:
       script: mvn verify -B
   allow_failures:
     - jdk: openjdk-ea
-          
-
-after_success:
-  - mvn clean cobertura:cobertura coveralls:report
diff --git a/httpcore5-testing/src/test/java/org/apache/hc/core5/testing/nio/H2AlpnTest.java b/httpcore5-testing/src/test/java/org/apache/hc/core5/testing/nio/H2AlpnTest.java
index 20d27a0..1775200 100644
--- a/httpcore5-testing/src/test/java/org/apache/hc/core5/testing/nio/H2AlpnTest.java
+++ b/httpcore5-testing/src/test/java/org/apache/hc/core5/testing/nio/H2AlpnTest.java
@@ -65,6 +65,7 @@ import org.apache.hc.core5.util.Timeout;
 import org.hamcrest.CoreMatchers;
 import org.hamcrest.MatcherAssert;
 import org.junit.Assume;
+import org.junit.Before;
 import org.junit.BeforeClass;
 import org.junit.Rule;
 import org.junit.Test;
@@ -164,9 +165,16 @@ public class H2AlpnTest {
 
     };
 
+    private static int JAVA_VER;
+
     @BeforeClass
     public static void determineJavaVersion() {
-        Assume.assumeTrue("Java version must be 9 or greater", ReflectionUtils.determineJRELevel() >= 9);
+        JAVA_VER = ReflectionUtils.determineJRELevel();
+    }
+
+    @Before
+    public void checkVersion() {
+        Assume.assumeTrue("Java version must be 9 or greater and less than 16", JAVA_VER >= 9 && JAVA_VER < 16);
     }
 
     @Test
diff --git a/httpcore5-testing/src/test/java/org/apache/hc/core5/testing/nio/H2ProtocolNegotiationTest.java b/httpcore5-testing/src/test/java/org/apache/hc/core5/testing/nio/H2ProtocolNegotiationTest.java
index dc959b0..974ff98 100644
--- a/httpcore5-testing/src/test/java/org/apache/hc/core5/testing/nio/H2ProtocolNegotiationTest.java
+++ b/httpcore5-testing/src/test/java/org/apache/hc/core5/testing/nio/H2ProtocolNegotiationTest.java
@@ -145,16 +145,16 @@ public class H2ProtocolNegotiationTest {
 
     };
 
-    private static int javaVersion;
+    private static int JAVA_VER;
 
     @BeforeClass
     public static void determineJavaVersion() {
-        javaVersion = ReflectionUtils.determineJRELevel();
+        JAVA_VER = ReflectionUtils.determineJRELevel();
     }
 
     @Before
     public void checkVersion() {
-        Assume.assumeTrue("Java version must be 1.8 or greater", javaVersion > 7);
+        Assume.assumeTrue("Java version must be 1.8 or greater", JAVA_VER >= 8);
     }
 
     @Test
@@ -232,7 +232,7 @@ public class H2ProtocolNegotiationTest {
     }
 
     private boolean isAlpnSupported() {
-        if (javaVersion == 8) {
+        if (JAVA_VER == 8) {
             // The 'java.version' property values are structured "1.8.0_[BUILD NUMBER]" in java 8 releases.
             final Matcher matcher = Pattern.compile("^1\\.8\\.0_(\\d+)$")
                     .matcher(System.getProperty("java.version"));
@@ -243,7 +243,7 @@ public class H2ProtocolNegotiationTest {
                 return java8Build >= 251;
             }
         }
-        return javaVersion > 8;
+        return JAVA_VER > 8 && JAVA_VER < 16;
     }
 
 }
diff --git a/httpcore5/src/test/java/org/apache/hc/core5/http/impl/io/TestBHttpConnectionBase.java b/httpcore5/src/test/java/org/apache/hc/core5/http/impl/io/TestBHttpConnectionBase.java
index 8559dca..73e2494 100644
--- a/httpcore5/src/test/java/org/apache/hc/core5/http/impl/io/TestBHttpConnectionBase.java
+++ b/httpcore5/src/test/java/org/apache/hc/core5/http/impl/io/TestBHttpConnectionBase.java
@@ -231,8 +231,8 @@ public class TestBHttpConnectionBase {
 
     @Test
     public void testAwaitInputInBuffer() throws Exception {
-        final ByteArrayInputStream inStream = Mockito.spy(new ByteArrayInputStream(
-                new byte[] {1, 2, 3, 4, 5}));
+        final ByteArrayInputStream inStream = new ByteArrayInputStream(
+                new byte[] {1, 2, 3, 4, 5});
         conn.bind(socket);
         conn.ensureOpen();
         conn.inBuffer.read(inStream);
@@ -240,14 +240,12 @@ public class TestBHttpConnectionBase {
         Assert.assertTrue(conn.awaitInput(Timeout.ofMilliseconds(432)));
 
         Mockito.verify(socket, Mockito.never()).setSoTimeout(ArgumentMatchers.anyInt());
-        Mockito.verify(inStream, Mockito.times(1)).read(
-                ArgumentMatchers.any(), ArgumentMatchers.anyInt(), ArgumentMatchers.anyInt());
     }
 
     @Test
     public void testAwaitInputInSocket() throws Exception {
-        final ByteArrayInputStream inStream = Mockito.spy(new ByteArrayInputStream(
-                new byte[] {1, 2, 3, 4, 5}));
+        final ByteArrayInputStream inStream = new ByteArrayInputStream(
+                new byte[] {1, 2, 3, 4, 5});
         Mockito.when(socket.getInputStream()).thenReturn(inStream);
         Mockito.when(socket.getSoTimeout()).thenReturn(345);
 
@@ -258,9 +256,7 @@ public class TestBHttpConnectionBase {
 
         Mockito.verify(socket, Mockito.times(1)).setSoTimeout(432);
         Mockito.verify(socket, Mockito.times(1)).setSoTimeout(345);
-        Mockito.verify(inStream, Mockito.times(1)).read(
-                ArgumentMatchers.any(), ArgumentMatchers.anyInt(), ArgumentMatchers.anyInt());
-    }
+        }
 
     @Test
     public void testAwaitInputNoData() throws Exception {
@@ -289,8 +285,8 @@ public class TestBHttpConnectionBase {
 
     @Test
     public void testNotStaleWhenHasData() throws Exception {
-        final ByteArrayInputStream inStream = Mockito.spy(new ByteArrayInputStream(
-                new byte[] {1, 2, 3, 4, 5}));
+        final ByteArrayInputStream inStream = new ByteArrayInputStream(
+                new byte[] {1, 2, 3, 4, 5});
         Mockito.when(socket.getInputStream()).thenReturn(inStream);
 
         conn.bind(socket);
diff --git a/httpcore5/src/test/java/org/apache/hc/core5/http/impl/io/TestSessionInOutBuffers.java b/httpcore5/src/test/java/org/apache/hc/core5/http/impl/io/TestSessionInOutBuffers.java
index 82d3e4a..3323b88 100644
--- a/httpcore5/src/test/java/org/apache/hc/core5/http/impl/io/TestSessionInOutBuffers.java
+++ b/httpcore5/src/test/java/org/apache/hc/core5/http/impl/io/TestSessionInOutBuffers.java
@@ -30,6 +30,7 @@ package org.apache.hc.core5.http.impl.io;
 import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;
 import java.io.InputStream;
+import java.io.OutputStream;
 import java.nio.charset.CharacterCodingException;
 import java.nio.charset.CharsetDecoder;
 import java.nio.charset.CharsetEncoder;
@@ -370,7 +371,7 @@ public class TestSessionInOutBuffers {
 
     @Test
     public void testWriteSmallFragmentBuffering() throws Exception {
-        final ByteArrayOutputStream outputStream = Mockito.spy(new ByteArrayOutputStream());
+        final OutputStream outputStream = Mockito.mock(OutputStream.class);
         final SessionOutputBuffer outbuffer = new SessionOutputBufferImpl(new BasicHttpTransportMetrics(), 16, 16, null);
         outbuffer.write(1, outputStream);
         outbuffer.write(2, outputStream);
@@ -383,7 +384,7 @@ public class TestSessionInOutBuffers {
 
     @Test
     public void testWriteSmallFragmentNoBuffering() throws Exception {
-        final ByteArrayOutputStream outputStream = Mockito.spy(new ByteArrayOutputStream());
+        final OutputStream outputStream = Mockito.mock(OutputStream.class);
         final SessionOutputBuffer outbuffer = new SessionOutputBufferImpl(new BasicHttpTransportMetrics(), 16, 0, null);
         outbuffer.write(1, outputStream);
         outbuffer.write(2, outputStream);

[httpcomponents-core] 01/02: Upgraded japicmp-maven-plugin to version 0.15.3

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

olegk pushed a commit to branch devel
in repository https://gitbox.apache.org/repos/asf/httpcomponents-core.git

commit fbdc4b1577a7d63b425c5f2c4e7ac0409a647ce3
Author: Oleg Kalnichevski <ol...@apache.org>
AuthorDate: Sun May 23 23:35:13 2021 +0200

    Upgraded japicmp-maven-plugin to version 0.15.3
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index d2d78e0..393134a 100644
--- a/pom.xml
+++ b/pom.xml
@@ -166,7 +166,7 @@
       <plugin>
         <groupId>com.github.siom79.japicmp</groupId>
         <artifactId>japicmp-maven-plugin</artifactId>
-        <version>0.14.4</version>
+        <version>0.15.3</version>
         <configuration>
           <oldVersion>
             <dependency>