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 |
787 |
org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java |
810 |
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 |
767 |
org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java |
788 |
org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java |
811 |
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 |
726 |
org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java |
748 |
org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java |
768 |
org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java |
789 |
org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java |
812 |
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 |
456 |
org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java |
509 |
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 |
555 |
org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java |
572 |
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 |
396 |
org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java |
457 |
org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java |
510 |
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 |
396 |
org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java |
428 |
org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java |
457 |
org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java |
510 |
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 |
324 |
org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java |
397 |
org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java |
429 |
org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java |
458 |
org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java |
511 |
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 |
323 |
org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java |
475 |
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 |
397 |
org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java |
429 |
org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java |
458 |
org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java |
476 |
org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java |
511 |
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 |
731 |
org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java |
753 |
org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java |
773 |
org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java |
794 |
org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java |
817 |
org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java |
893 |
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 |
731 |
org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java |
753 |
org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java |
773 |
org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java |
794 |
org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java |
817 |
org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java |
854 |
org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java |
893 |
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 |
673 |
org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java |
732 |
org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java |
754 |
org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java |
774 |
org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java |
795 |
org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java |
818 |
org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java |
855 |
org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java |
894 |
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 { |