Skip to content

Commit 8f96e8c

Browse files
committed
Add CustomLogLevelTest
1 parent 9bedbeb commit 8f96e8c

File tree

2 files changed

+40
-0
lines changed

2 files changed

+40
-0
lines changed
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
/*
2+
* Copyright 2025 EPAM Systems
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package com.epam.reportportal.example.testng.logback.logging;
18+
19+
import com.epam.reportportal.service.ReportPortal;
20+
import org.testng.annotations.Test;
21+
22+
import java.time.Instant;
23+
24+
/**
25+
* The test logs a message with CUSTOM log level to ReportPortal.
26+
*/
27+
public class CustomLogLevelTest {
28+
29+
@Test
30+
public void logWithCustomLogLevel() {
31+
// Logback does not have custom Log Level, so we can use ReportPortal's emitter
32+
ReportPortal.emitLog("Custom Log Level message", "CUSTOM", Instant.now());
33+
}
34+
}

example-testng-logback/suites/logging_tests.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,12 @@
2222
</classes>
2323
</test>
2424

25+
<test name="Custom Log Level">
26+
<classes>
27+
<class name="com.epam.reportportal.example.testng.logback.logging.CustomLogLevelTest" />
28+
</classes>
29+
</test>
30+
2531
<test verbose="1" name="Different logging types">
2632
<classes>
2733
<class name="com.epam.reportportal.example.testng.logback.logging.LoggingTest"/>

0 commit comments

Comments
 (0)