This is an automated email from the ASF dual-hosted git repository.
davsclaus pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/main by this push:
new 13c10473e33 CAMEL-20367: Adds logging levels tests (#15452)
13c10473e33 is described below
commit 13c10473e33acbbabee2fcc71d29788cc2a87d6f
Author: Jakub Vrubel <[email protected]>
AuthorDate: Thu Sep 5 15:06:47 2024 +0200
CAMEL-20367: Adds logging levels tests (#15452)
---
.../camel/dsl/jbang/it/LoggingLevelsITCase.java | 43 ++++++++++++++++++++++
1 file changed, 43 insertions(+)
diff --git
a/dsl/camel-jbang/camel-jbang-it/src/test/java/org/apache/camel/dsl/jbang/it/LoggingLevelsITCase.java
b/dsl/camel-jbang/camel-jbang-it/src/test/java/org/apache/camel/dsl/jbang/it/LoggingLevelsITCase.java
new file mode 100644
index 00000000000..0ad6a8e19ba
--- /dev/null
+++
b/dsl/camel-jbang/camel-jbang-it/src/test/java/org/apache/camel/dsl/jbang/it/LoggingLevelsITCase.java
@@ -0,0 +1,43 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.dsl.jbang.it;
+
+import java.io.IOException;
+
+import org.apache.camel.dsl.jbang.it.support.JBangTestSupport;
+import org.junit.jupiter.api.Test;
+
+public class LoggingLevelsITCase extends JBangTestSupport {
+
+ @Test
+ public void testLoggingLevelRuntime() throws IOException {
+ copyResourceInDataFolder(TestResources.DIR_ROUTE);
+ executeBackground(String.format("run %s/FromDirectoryRoute.java",
mountPoint()));
+ checkLogContains("Hello world!");
+ checkLogDoesNotContain("Invoke health-check (READINESS)
camel/context");
+ execute("cmd logger --logging-level=DEBUG FromDirectoryRoute");
+ checkLogContains("Invoke health-check (READINESS) camel/context");
+ }
+
+ @Test
+ public void testSetLoggingLevel() throws IOException {
+ copyResourceInDataFolder(TestResources.DIR_ROUTE);
+ executeBackground(String.format("run %s/FromDirectoryRoute.java
--logging-level=DEBUG", mountPoint()));
+ checkLogContains("Hello world!");
+ checkLogContains("Invoke health-check (READINESS) camel/context");
+ }
+}