yx9o commented on code in PR #11509:
URL: https://github.com/apache/rocketmq/pull/11509#discussion_r4586490811


##########
common/src/test/java/org/apache/rocketmq/common/utils/IOTinyUtilsTest.java:
##########
@@ -170,4 +170,31 @@ public void testCopyFile() throws Exception {
         File dest = new File(target);
         assertTrue(dest.exists());
     }
+
+    @Test
+    public void testCopyFileSameFile() throws Exception {
+        File source = new File(testRootDir, "source");
+        IOTinyUtils.writeStringToFile(source, "testCopyFileSameFile", 
StandardCharsets.UTF_8.name());
+
+        try {
+            IOTinyUtils.copyFile(source.getCanonicalPath(), 
source.getCanonicalPath());
+            fail("Expected IllegalArgumentException when source and target are 
the same file");
+        } catch (IllegalArgumentException e) {
+            assertTrue(e.getMessage().contains("same file"));
+        }
+    }
+}
+
+    @Test
+    public void testCopyFileSameFile() throws Exception {

Review Comment:
   The second `testCopyFileSameFile()` is outside the class, so 
`rocketmq-common` fails at test compilation before the timer-wheel tests can 
run. Could you remove the duplicate?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to