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 |
797 |
org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java |
820 |
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 |
777 |
org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java |
798 |
org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java |
821 |
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 |
736 |
org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java |
758 |
org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java |
778 |
org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java |
799 |
org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java |
822 |
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 |
466 |
org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java |
519 |
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 |
565 |
org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java |
582 |
file.setLastModified(System.currentTimeMillis() - 5 * 60 * 1000);
RecordingTransportListener listener = new RecordingTransportListener();
GetTask task = new GetTask(URI.create("repo/resume.txt"))
.setDataPath(file.toPath(), 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 |
406 |
org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java |
467 |
org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java |
520 |
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 |
406 |
org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java |
438 |
org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java |
467 |
org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java |
520 |
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 |
407 |
org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java |
439 |
org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java |
468 |
org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java |
521 |
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 |
485 |
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 |
407 |
org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java |
439 |
org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java |
468 |
org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java |
486 |
org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java |
521 |
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 |
741 |
org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java |
763 |
org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java |
783 |
org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java |
804 |
org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java |
827 |
org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java |
903 |
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 |
741 |
org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java |
763 |
org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java |
783 |
org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java |
804 |
org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java |
827 |
org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java |
864 |
org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java |
903 |
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 |
683 |
org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java |
742 |
org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java |
764 |
org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java |
784 |
org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java |
805 |
org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java |
828 |
org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java |
865 |
org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java |
904 |
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 { |