1   /*
2    * Logback: the reliable, generic, fast and flexible logging framework.
3    * Copyright (C) 1999-2024, QOS.ch. All rights reserved.
4    *
5    * This program and the accompanying materials are dual-licensed under
6    * either the terms of the Eclipse Public License v1.0 as published by
7    * the Eclipse Foundation
8    *
9    *   or (per the licensee's choosing)
10   *
11   * under the terms of the GNU Lesser General Public License version 2.1
12   * as published by the Free Software Foundation.
13   */
14  
15  package ch.qos.logback.classic.blackbox.joran;
16  
17  import ch.qos.logback.core.Context;
18  import ch.qos.logback.core.status.StatusManager;
19  import ch.qos.logback.core.status.StatusUtil;
20  import org.junit.jupiter.api.Assertions;
21  
22  public class StatusChecker extends StatusUtil  {
23  
24      public StatusChecker(StatusManager sm) {
25          super(sm);
26      }
27  
28      public StatusChecker(Context context) {
29          super(context);
30      }
31  
32      public void assertContainsMatch(int level, String regex) {
33          Assertions.assertTrue(containsMatch(level, regex));
34      }
35  
36      public void assertNoMatch(String regex) {
37          Assertions.assertFalse(containsMatch(regex));
38      }
39  
40      public void assertContainsMatch(String regex) {
41          Assertions.assertTrue(containsMatch(regex));
42      }
43  
44      public void assertContainsException(Class<?> scanExceptionClass) {
45          Assertions.assertTrue(containsException(scanExceptionClass));
46      }
47  
48      public void assertContainsException(Class<?> scanExceptionClass, String msg) {
49          Assertions.assertTrue(containsException(scanExceptionClass, msg));
50      }
51  
52      public void assertIsErrorFree() {
53          Assertions.assertTrue(isErrorFree(0));
54      }
55  
56      public void assertIsErrorFree(long treshhold) {
57          Assertions.assertTrue(isErrorFree(treshhold));
58      }
59  
60      public void assertIsWarningOrErrorFree() {
61          Assertions.assertTrue(isWarningOrErrorFree(0));
62      }
63  
64      public void assertErrorCount(int i) {
65      }
66  }