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 |
784 |
org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java |
807 |
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 |
764 |
org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java |
785 |
org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java |
808 |
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 |
723 |
org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java |
745 |
org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java |
765 |
org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java |
786 |
org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java |
809 |
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 |
453 |
org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java |
506 |
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 |
552 |
org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java |
569 |
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 |
393 |
org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java |
454 |
org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java |
507 |
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 |
393 |
org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java |
425 |
org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java |
454 |
org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java |
507 |
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 |
321 |
org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java |
394 |
org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java |
426 |
org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java |
455 |
org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java |
508 |
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 |
320 |
org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java |
472 |
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 |
394 |
org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java |
426 |
org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java |
455 |
org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java |
473 |
org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java |
508 |
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 |
728 |
org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java |
750 |
org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java |
770 |
org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java |
791 |
org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java |
814 |
org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java |
890 |
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 |
728 |
org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java |
750 |
org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java |
770 |
org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java |
791 |
org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java |
814 |
org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java |
851 |
org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java |
890 |
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 |
670 |
org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java |
729 |
org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java |
751 |
org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java |
771 |
org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java |
792 |
org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java |
815 |
org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java |
852 |
org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java |
891 |
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 { |