Created
August 15, 2014 12:13
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.clearqa.utils; | |
import org.testng.ITestResult; | |
import org.testng.TestListenerAdapter; | |
public class TestNgCustomLogger extends TestListenerAdapter{ | |
@Override | |
public void onTestFailure(ITestResult tr) { | |
logToStdOut(tr, "FAILED"); | |
} | |
@Override | |
public void onTestSkipped(ITestResult tr) { | |
logToStdOut(tr, "SKIPPED"); | |
} | |
@Override | |
public void onTestSuccess(ITestResult tr) { | |
logToStdOut(tr, "PASS"); | |
} | |
private void logToStdOut(ITestResult tr, String result){ | |
Object[] parameters = tr.getParameters(); | |
System.out.println("Test with parameters " + result); | |
for(Object o : parameters) { | |
System.out.println("\t -" + o.toString()); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment