Skip to content

Commit

Permalink
Fix test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
terrymanu committed Oct 30, 2023
1 parent 49d58dd commit 6c79646
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 18 deletions.
5 changes: 0 additions & 5 deletions bootstrap/src/test/resources/logback-test.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,11 @@
<pattern>${log.pattern}</pattern>
</encoder>
</appender>
<appender name="LogJobErrorHandlerTestAppender" class="ch.qos.logback.core.read.ListAppender" />

<root>
<appender-ref ref="STDOUT" />
</root>

<logger name="org.apache.shardingsphere.elasticjob.kernel.internal.snapshot.SnapshotService" level="OFF" />
<logger name="org.apache.shardingsphere.elasticjob.infra.handler.error.impl.LogJobErrorHandler" level="OFF" />
<logger name="org.apache.curator.framework.listen.MappingListenerManager" level="OFF" />
<logger name="org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.type.LogJobErrorHandler" level="error" additivity="false">
<appender-ref ref="LogJobErrorHandlerTestAppender" />
</logger>
</configuration>
26 changes: 23 additions & 3 deletions ecosystem/error-handler/normal/src/test/resources/logback-test.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,29 @@
-->

<configuration>
<property name="log.context.name" value="elasticjob-test" />
<property name="log.charset" value="UTF-8" />
<property name="log.pattern" value="[%-5level] %date --%thread-- [%logger] %msg %n" />

<contextName>${log.context.name}</contextName>

<statusListener class="ch.qos.logback.core.status.NopStatusListener" />
<appender name="DingtalkJobErrorHandlerTestAppender" class="ch.qos.logback.core.read.ListAppender" />
<logger name="org.apache.shardingsphere.elasticjob.error.handler.dingtalk.DingtalkJobErrorHandler" level="info" additivity="false">
<appender-ref ref="DingtalkJobErrorHandlerTestAppender" />

<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
<level>ERROR</level>
</filter>
<encoder charset="${log.charset}">
<pattern>${log.pattern}</pattern>
</encoder>
</appender>
<appender name="LogJobErrorHandlerTestAppender" class="ch.qos.logback.core.read.ListAppender" />

<root>
<appender-ref ref="STDOUT" />
</root>

<logger name="org.apache.shardingsphere.elasticjob.error.handler.normal.LogJobErrorHandler" level="error" additivity="false">
<appender-ref ref="LogJobErrorHandlerTestAppender" />
</logger>
</configuration>
5 changes: 0 additions & 5 deletions kernel/src/test/resources/logback-test.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,11 @@
<pattern>${log.pattern}</pattern>
</encoder>
</appender>
<appender name="LogJobErrorHandlerTestAppender" class="ch.qos.logback.core.read.ListAppender" />

<root>
<appender-ref ref="STDOUT" />
</root>

<logger name="org.apache.shardingsphere.elasticjob.kernel.internal.snapshot.SnapshotService" level="OFF" />
<logger name="org.apache.shardingsphere.elasticjob.infra.handler.error.impl.LogJobErrorHandler" level="OFF" />
<logger name="org.apache.curator.framework.listen.MappingListenerManager" level="OFF" />
<logger name="org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.type.LogJobErrorHandler" level="error" additivity="false">
<appender-ref ref="LogJobErrorHandlerTestAppender" />
</logger>
</configuration>
5 changes: 0 additions & 5 deletions test/e2e/src/test/resources/logback-test.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,11 @@
<pattern>${log.pattern}</pattern>
</encoder>
</appender>
<appender name="LogJobErrorHandlerTestAppender" class="ch.qos.logback.core.read.ListAppender" />

<root>
<appender-ref ref="STDOUT" />
</root>

<logger name="org.apache.shardingsphere.elasticjob.kernel.internal.snapshot.SnapshotService" level="OFF" />
<logger name="org.apache.shardingsphere.elasticjob.infra.handler.error.impl.LogJobErrorHandler" level="OFF" />
<logger name="org.apache.curator.framework.listen.MappingListenerManager" level="OFF" />
<logger name="org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.type.LogJobErrorHandler" level="error" additivity="false">
<appender-ref ref="LogJobErrorHandlerTestAppender" />
</logger>
</configuration>

0 comments on commit 6c79646

Please sign in to comment.