davsclaus commented on code in PR #29928:
URL: https://github.com/apache/camel/pull/29928#discussion_r4573488433


##########
core/camel-core/src/test/java/org/apache/camel/support/RouteWatcherReloadDataDirTest.java:
##########
@@ -119,6 +119,29 @@ public void 
testAFilePatternExcludeLeavesOutFilesNotFolders() throws Exception {
         assertThat(scanNames()).containsExactly("readme.txt", 
"shop.camel.yaml");
     }
 
+    @Test
+    public void testTheFilesARunWritesAreNotWatched() throws Exception {
+        // CAMEL-26930: camel dev > run.log in the project reloaded all the 
routes every 2 seconds; the pattern of
+        // camel run --dev with a source directory leaves out logs, the build 
output, git and the Camel folders
+        
start("*,!test/**,!*.log,!target/**,!.git/**,!.camel/**,!.camel-jbang/**");
+        assertThat(scanNames()).containsExactly("order-0.json", 
"order-1.json", "shop.camel.yaml");
+
+        Files.writeString(dir.resolve("run.log"), "a line");
+        Files.createDirectories(dir.resolve("logs"));
+        Files.writeString(dir.resolve("logs/app.log"), "a line");
+        Files.createDirectories(dir.resolve("target/classes"));
+        Files.writeString(dir.resolve("target/classes/Foo.class"), "bytes");
+        Files.createDirectories(dir.resolve(".git"));
+        Files.writeString(dir.resolve(".git/index"), "index");
+        Files.createDirectories(dir.resolve(".camel"));
+        Files.writeString(dir.resolve(".camel/order-1.json"), "{}");
+        assertThat(scanNames()).isEmpty();
+
+        // the route is still watched
+        Files.writeString(dir.resolve("shop.camel.yaml"), "one and two");

Review Comment:
   Done in 3c3effc259aa: the test writes `.camel-jbang/app.lock` as well, so it 
covers all five new excludes.
   
   _Claude Code on behalf of davsclaus_



-- 
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