Skip to content

Commit

Permalink
Streamline Logging Across TestNG
Browse files Browse the repository at this point in the history
Closes testng-team#2646

We now use sl4j apis for our logging.
Internally TestNG makes use of SimpleLogger 
(Slf4j-simple) bindings for logging purposes.
  • Loading branch information
krmahadevan committed Dec 31, 2021
1 parent 7c7b216 commit b88f502
Show file tree
Hide file tree
Showing 9 changed files with 46 additions and 551 deletions.
1 change: 1 addition & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
Current
Fixed: GITHUB-2646: Streamline Logging Across TestNG (Krishnan Mahadevan)
Fixed: GITHUB-2664: Order for DependsOnGroups has changed after TestNg 7.4.0 (Krishnan Mahadevan)
Fixed: GITHUB-2501: TestNG 7.4.0 throws an exception "sun.net.www.protocol.file.FileURLConnection cannot be cast to java.net.HttpURLConnection" when xml file contain "ENTITY SYSTEM" grammer (Krishnan Mahadevan)
Fixed: GITHUB-2693: TestNG ignores 'dataproviderthreadcount' CLA (Krishnan Mahadevan)
Expand Down
10 changes: 4 additions & 6 deletions testng-ant/src/test/java/test/ant/AntTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,20 @@

import static org.assertj.core.api.Assertions.assertThat;

import java.io.File;
import java.io.IOException;
import java.util.regex.Pattern;
import org.apache.tools.ant.BuildFileRule;
import org.apache.tools.ant.FileUtilities;
import org.testng.annotations.Test;

public class AntTest {

private final BuildFileRule rule = new BuildFileRule();

@Test
public void testSimple() throws IOException {
public void testSimple() {
rule.configureProject("src/test/resources/ant/build-simple.xml");
rule.executeTarget("testng");
File expected = rule.getProject().resolveFile("expected/ant-simple.test");
assertThat(rule.getLog()).isEqualToIgnoringNewLines(FileUtilities.getFileContents(expected));
String expectedText = "Total tests run: 1, Passes: 1, Failures: 0, Skips: 0";
assertThat(rule.getLog()).containsPattern(Pattern.compile(expectedText));
}

@Test
Expand Down
4 changes: 0 additions & 4 deletions testng-ant/src/test/resources/ant/expected/ant-simple.test

This file was deleted.

Loading

0 comments on commit b88f502

Please sign in to comment.