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 2024/06/27 07:23:34 UTC
(httpcomponents-core) 03/05: Remove duplicate test methods
This is an automated email from the ASF dual-hosted git repository.
olegk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/httpcomponents-core.git
commit b12db4149687298f7b4cf781ae8e7b5e68036475
Author: strangelookingnerd <49...@users.noreply.github.com>
AuthorDate: Wed Jun 26 16:06:33 2024 +0200
Remove duplicate test methods
---
.../core5/http/impl/nio/TestIdentityEncoder.java | 32 +---------------------
.../hc/core5/http/io/TestEofSensorInputStream.java | 15 ----------
2 files changed, 1 insertion(+), 46 deletions(-)
diff --git a/httpcore5/src/test/java/org/apache/hc/core5/http/impl/nio/TestIdentityEncoder.java b/httpcore5/src/test/java/org/apache/hc/core5/http/impl/nio/TestIdentityEncoder.java
index 8addef18b..38f2b6525 100644
--- a/httpcore5/src/test/java/org/apache/hc/core5/http/impl/nio/TestIdentityEncoder.java
+++ b/httpcore5/src/test/java/org/apache/hc/core5/http/impl/nio/TestIdentityEncoder.java
@@ -191,37 +191,7 @@ class TestIdentityEncoder {
}
@Test
- void testCodingFromFileSmaller() throws Exception {
- final WritableByteChannelMock channel = new WritableByteChannelMock(64);
- final SessionOutputBuffer outbuf = new SessionOutputBufferImpl(1024, 128);
- final BasicHttpTransportMetrics metrics = new BasicHttpTransportMetrics();
-
- final IdentityEncoder encoder = new IdentityEncoder(channel, outbuf, metrics);
-
- createTempFile();
- RandomAccessFile testfile = new RandomAccessFile(this.tmpfile, "rw");
- try {
- testfile.write("stuff;".getBytes(StandardCharsets.US_ASCII));
- testfile.write("more stuff".getBytes(StandardCharsets.US_ASCII));
- } finally {
- testfile.close();
- }
-
- testfile = new RandomAccessFile(this.tmpfile, "rw");
- try {
- final FileChannel fchannel = testfile.getChannel();
- encoder.transfer(fchannel, 0, 20);
- } finally {
- testfile.close();
- }
- final String s = channel.dump(StandardCharsets.US_ASCII);
-
- Assertions.assertFalse(encoder.isCompleted());
- Assertions.assertEquals("stuff;more stuff", s);
- }
-
- @Test
- public void testCodingFromFileFlushBuffer() throws Exception {
+ void testCodingFromFileFlushBuffer() throws Exception {
final WritableByteChannelMock channel = new WritableByteChannelMock(64);
final SessionOutputBuffer outbuf = new SessionOutputBufferImpl(1024, 128);
final BasicHttpTransportMetrics metrics = new BasicHttpTransportMetrics();
diff --git a/httpcore5/src/test/java/org/apache/hc/core5/http/io/TestEofSensorInputStream.java b/httpcore5/src/test/java/org/apache/hc/core5/http/io/TestEofSensorInputStream.java
index e00f62f02..322d3d282 100644
--- a/httpcore5/src/test/java/org/apache/hc/core5/http/io/TestEofSensorInputStream.java
+++ b/httpcore5/src/test/java/org/apache/hc/core5/http/io/TestEofSensorInputStream.java
@@ -74,21 +74,6 @@ class TestEofSensorInputStream {
Mockito.verify(eofwatcher).streamClosed(inStream);
}
- @Test
- void testReleaseConnection() throws Exception {
- Mockito.when(eofwatcher.streamClosed(Mockito.any())).thenReturn(Boolean.TRUE);
-
- eofstream.close();
-
- Assertions.assertTrue(eofstream.isSelfClosed());
- Assertions.assertNull(eofstream.getWrappedStream());
-
- Mockito.verify(inStream, Mockito.times(1)).close();
- Mockito.verify(eofwatcher).streamClosed(inStream);
-
- eofstream.close();
- }
-
@Test
void testAbortConnection() throws Exception {
Mockito.when(eofwatcher.streamAbort(Mockito.any())).thenReturn(Boolean.TRUE);