CPD Results
The following document contains the results of PMD's CPD 6.55.0.
Duplications
File |
Line |
org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java |
795 |
org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java |
818 |
session.setConfigProperty(ConfigurationProperties.HTTP_EXPECT_CONTINUE, false);
httpServer.setAuthentication("testuser", "testpass");
httpServer.setExpectSupport(HttpServer.ExpectContinue.FAIL); // if transport tries Expect/Continue explode
auth = new AuthenticationBuilder()
.addUsername("testuser")
.addPassword("testpass")
.build();
newTransporter(httpServer.getHttpUrl());
RecordingTransportListener listener = new RecordingTransportListener();
PutTask task =
new PutTask(URI.create("repo/file.txt")).setListener(listener).setDataString("upload");
transporter.put(task);
assertEquals(0L, listener.getDataOffset());
assertEquals(6L, listener.getDataLength());
assertEquals(1, listener.getStartedCount()); // w/ expectContinue enabled would have here 2
assertTrue(listener.getProgressedCount() > 0, "Count: " + listener.getProgressedCount());
assertEquals("upload", TestFileUtils.readString(new File(repoDir, "file.txt")));
}
@Test
protected void testPut_Authenticated_ExpectContinueRejected_ExplicitlyConfiguredHeader() throws Exception { |
File |
Line |
org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java |
775 |
org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java |
796 |
org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java |
819 |
httpServer.setAuthentication("testuser", "testpass");
httpServer.setExpectSupport(HttpServer.ExpectContinue.FAIL);
auth = new AuthenticationBuilder()
.addUsername("testuser")
.addPassword("testpass")
.build();
newTransporter(httpServer.getHttpUrl());
RecordingTransportListener listener = new RecordingTransportListener();
PutTask task =
new PutTask(URI.create("repo/file.txt")).setListener(listener).setDataString("upload");
transporter.put(task);
assertEquals(0L, listener.getDataOffset());
assertEquals(6L, listener.getDataLength());
assertEquals(1, listener.getStartedCount());
assertTrue(listener.getProgressedCount() > 0, "Count: " + listener.getProgressedCount());
assertEquals("upload", TestFileUtils.readString(new File(repoDir, "file.txt")));
}
@Test
protected void testPut_Authenticated_ExpectContinueDisabled() throws Exception { |
File |
Line |
org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java |
734 |
org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java |
756 |
org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java |
776 |
org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java |
797 |
org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java |
820 |
httpServer.setAuthentication("testuser", "testpass");
auth = new AuthenticationBuilder()
.addUsername("testuser")
.addPassword("testpass")
.build();
newTransporter(httpServer.getHttpUrl());
RecordingTransportListener listener = new RecordingTransportListener();
PutTask task =
new PutTask(URI.create("repo/file.txt")).setListener(listener).setDataString("upload");
transporter.put(task);
assertEquals(0L, listener.getDataOffset());
assertEquals(6L, listener.getDataLength());
assertEquals(1, listener.getStartedCount());
assertTrue(listener.getProgressedCount() > 0, "Count: " + listener.getProgressedCount());
assertEquals("upload", TestFileUtils.readString(new File(repoDir, "file.txt")));
}
@Test
protected void testPut_Authenticated_ExpectContinueBroken() throws Exception { |
File |
Line |
org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java |
464 |
org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java |
517 |
httpServer.addSslConnector();
newTransporter(httpServer.getHttpsUrl());
RecordingTransportListener listener = new RecordingTransportListener();
GetTask task = new GetTask(URI.create("repo/file.txt")).setListener(listener);
transporter.get(task);
assertEquals("test", task.getDataString());
assertEquals(0L, listener.getDataOffset());
assertEquals(4L, listener.getDataLength());
assertEquals(1, listener.getStartedCount());
assertTrue(listener.getProgressedCount() > 0, "Count: " + listener.getProgressedCount());
assertEquals(task.getDataString(), listener.getBaos().toString(StandardCharsets.UTF_8));
}
@Test
protected void testGet_SSL_WithServerErrors() throws Exception { |
File |
Line |
org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java |
563 |
org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java |
580 |
file.setLastModified(System.currentTimeMillis() - 5 * 60 * 1000);
RecordingTransportListener listener = new RecordingTransportListener();
GetTask task = new GetTask(URI.create("repo/resume.txt"))
.setDataFile(file, true)
.setListener(listener);
transporter.get(task);
assertEquals("resumable", TestFileUtils.readString(file));
assertEquals(1L, listener.getStartedCount());
assertEquals(0L, listener.getDataOffset());
assertEquals(9, listener.getDataLength());
assertTrue(listener.getProgressedCount() > 0, "Count: " + listener.getProgressedCount());
assertEquals("resumable", listener.getBaos().toString(StandardCharsets.UTF_8));
}
@Test
protected void testGet_ResumeRangesNotSupportedByServer() throws Exception { |
File |
Line |
org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java |
404 |
org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java |
465 |
org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java |
518 |
newTransporter(httpServer.getHttpUrl());
RecordingTransportListener listener = new RecordingTransportListener();
GetTask task = new GetTask(URI.create("repo/file.txt")).setListener(listener);
transporter.get(task);
assertEquals("test", task.getDataString());
assertEquals(0L, listener.getDataOffset());
assertEquals(4L, listener.getDataLength());
assertEquals(1, listener.getStartedCount());
assertTrue(listener.getProgressedCount() > 0, "Count: " + listener.getProgressedCount());
assertEquals(task.getDataString(), listener.getBaos().toString(StandardCharsets.UTF_8));
}
@Test
protected void testGet_Unauthenticated() throws Exception { |
File |
Line |
org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java |
404 |
org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java |
436 |
org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java |
465 |
org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java |
518 |
newTransporter(httpServer.getHttpUrl());
RecordingTransportListener listener = new RecordingTransportListener();
GetTask task = new GetTask(URI.create("repo/file.txt")).setListener(listener);
transporter.get(task);
assertEquals("test", task.getDataString());
assertEquals(0L, listener.getDataOffset());
assertEquals(4L, listener.getDataLength());
assertEquals(1, listener.getStartedCount());
assertTrue(listener.getProgressedCount() > 0, "Count: " + listener.getProgressedCount());
assertEquals(task.getDataString(), listener.getBaos().toString(StandardCharsets.UTF_8));
}
@Test
protected void testGet_Unauthenticated() throws Exception { |
File |
Line |
org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java |
332 |
org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java |
405 |
org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java |
437 |
org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java |
466 |
org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java |
519 |
RecordingTransportListener listener = new RecordingTransportListener();
GetTask task = new GetTask(URI.create("repo/file.txt")).setListener(listener);
transporter.get(task);
assertEquals("test", task.getDataString());
assertEquals(0L, listener.getDataOffset());
assertEquals(4L, listener.getDataLength());
assertEquals(1, listener.getStartedCount());
assertTrue(listener.getProgressedCount() > 0, "Count: " + listener.getProgressedCount());
assertEquals(task.getDataString(), listener.getBaos().toString(StandardCharsets.UTF_8));
}
@Test
protected void testGet_ToFile() throws Exception { |
File |
Line |
org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java |
331 |
org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java |
483 |
protected void testGet_ToMemory() throws Exception {
RecordingTransportListener listener = new RecordingTransportListener();
GetTask task = new GetTask(URI.create("repo/file.txt")).setListener(listener);
transporter.get(task);
assertEquals("test", task.getDataString());
assertEquals(0L, listener.getDataOffset());
assertEquals(4L, listener.getDataLength());
assertEquals(1, listener.getStartedCount());
assertTrue(listener.getProgressedCount() > 0, "Count: " + listener.getProgressedCount());
assertEquals(task.getDataString(), listener.getBaos().toString(StandardCharsets.UTF_8));
} |
File |
Line |
org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java |
405 |
org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java |
437 |
org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java |
466 |
org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java |
484 |
org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java |
519 |
RecordingTransportListener listener = new RecordingTransportListener();
GetTask task = new GetTask(URI.create("repo/file.txt")).setListener(listener);
transporter.get(task);
assertEquals("test", task.getDataString());
assertEquals(0L, listener.getDataOffset());
assertEquals(4L, listener.getDataLength());
assertEquals(1, listener.getStartedCount());
assertTrue(listener.getProgressedCount() > 0, "Count: " + listener.getProgressedCount());
assertEquals(task.getDataString(), listener.getBaos().toString(StandardCharsets.UTF_8));
} |
File |
Line |
org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java |
739 |
org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java |
761 |
org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java |
781 |
org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java |
802 |
org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java |
825 |
org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java |
901 |
newTransporter(httpServer.getHttpUrl());
RecordingTransportListener listener = new RecordingTransportListener();
PutTask task =
new PutTask(URI.create("repo/file.txt")).setListener(listener).setDataString("upload");
transporter.put(task);
assertEquals(0L, listener.getDataOffset());
assertEquals(6L, listener.getDataLength());
assertEquals(1, listener.getStartedCount());
assertTrue(listener.getProgressedCount() > 0, "Count: " + listener.getProgressedCount());
assertEquals("upload", TestFileUtils.readString(new File(repoDir, "file.txt")));
}
@Test
protected void testPut_Authenticated_ExpectContinueBroken() throws Exception { |
File |
Line |
org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java |
739 |
org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java |
761 |
org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java |
781 |
org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java |
802 |
org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java |
825 |
org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java |
862 |
org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java |
901 |
newTransporter(httpServer.getHttpUrl());
RecordingTransportListener listener = new RecordingTransportListener();
PutTask task =
new PutTask(URI.create("repo/file.txt")).setListener(listener).setDataString("upload");
transporter.put(task);
assertEquals(0L, listener.getDataOffset());
assertEquals(6L, listener.getDataLength());
assertEquals(1, listener.getStartedCount());
assertTrue(listener.getProgressedCount() > 0, "Count: " + listener.getProgressedCount());
assertEquals("upload", TestFileUtils.readString(new File(repoDir, "file.txt")));
}
@Test
protected void testPut_Authenticated_ExpectContinueBroken() throws Exception { |
File |
Line |
org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java |
681 |
org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java |
740 |
org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java |
762 |
org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java |
782 |
org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java |
803 |
org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java |
826 |
org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java |
863 |
org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java |
902 |
RecordingTransportListener listener = new RecordingTransportListener();
PutTask task =
new PutTask(URI.create("repo/file.txt")).setListener(listener).setDataString("upload");
transporter.put(task);
assertEquals(0L, listener.getDataOffset());
assertEquals(6L, listener.getDataLength());
assertEquals(1, listener.getStartedCount());
assertTrue(listener.getProgressedCount() > 0, "Count: " + listener.getProgressedCount());
assertEquals("upload", TestFileUtils.readString(new File(repoDir, "file.txt")));
}
@Test
protected void testPut_FromFile() throws Exception { |