/** * Log the passed string to the HTML reports * @param s The message to log */ public static void log(String s) { log(s, getCurrentTestResult()); }
/** * Log the passed string to the HTML reports. If logToStandardOut * is true, the string will also be printed on standard out. * * @param s The message to log * @param logToStandardOut Whether to print this string on standard * out too */ public static void log(String s, boolean logToStandardOut) { log(s, getCurrentTestResult()); if (logToStandardOut) { System.out.println(s); } } /**
/** * Log the passed string to the HTML reports. * * @param s The message to log */ public static void log(String s) { log(s, getCurrentTestResult()); }
/** * Log the passed string to the HTML reports. If logToStandardOut is true, the string will also be * printed on standard out. * * @param s The message to log * @param logToStandardOut Whether to print this string on standard out too */ public static void log(String s, boolean logToStandardOut) { log(s, getCurrentTestResult()); if (logToStandardOut) { System.out.println(s); } } /**
/** * Log the passed string to the HTML reports if the current verbosity * is equal or greater than the one passed in parameter * * @param s The message to log * @param level The verbosity of this message */ public static void log(String s, int level) { if (TestRunner.getVerbose() >= level) { log(s, getCurrentTestResult()); } }
/** * Log the passed string to the HTML reports if the current verbosity * is equal or greater than the one passed in parameter. If logToStandardOut * is true, the string will also be printed on standard out. * * @param s The message to log * @param level The verbosity of this message * @param logToStandardOut Whether to print this string on standard * out too */ public static void log(String s, int level, boolean logToStandardOut) { if (TestRunner.getVerbose() >= level) { log(s, getCurrentTestResult()); if (logToStandardOut) { System.out.println(s); } } }
/** * Log the passed string to the HTML reports if the current verbosity is equal to or greater than the * one passed as a parameter. If logToStandardOut is true, the string will also be printed on * standard out. * * @param s The message to log * @param level The verbosity of this message * @param logToStandardOut Whether to print this string on standard out too */ public static void log(String s, int level, boolean logToStandardOut) { if (TestRunner.getVerbose() >= level) { log(s, getCurrentTestResult()); if (logToStandardOut) { System.out.println(s); } } }
/** * Log the passed string to the HTML reports if the current verbosity is equal to or greater than the * one passed as a parameter. * * @param s The message to log * @param level The verbosity of this message */ public static void log(String s, int level) { if (TestRunner.getVerbose() >= level) { log(s, getCurrentTestResult()); } }
@Test(expectedExceptions = IllegalStateException.class, enabled = false) public void failedTest2() { Reporter.getCurrentTestResult().setStatus(ITestResult.FAILURE); throw new IllegalStateException(); }
@Test public void succeedTest() { Reporter.getCurrentTestResult().setStatus(ITestResult.SUCCESS); Assert.fail(); }
@Test public void succeedTest2() { Reporter.getCurrentTestResult().setStatus(ITestResult.SUCCESS); throw new IllegalStateException(); } }
@Test public void failedTest() { Reporter.getCurrentTestResult().setStatus(ITestResult.FAILURE); }
@Test public void skippedTest() { Reporter.getCurrentTestResult().setStatus(ITestResult.SKIP); }
@Test public void testPlugin() { ITestResult result = Reporter.getCurrentTestResult(); Assert.assertEquals(result.getAttribute("class").toString(), getClass().getName()); Assert.assertNotNull(result.getAttribute("toString")); } }
@Test public void pass() { Assert.assertEquals(Reporter.getCurrentTestResult().getAttribute("before"), 10); Assert.assertEquals(m_testResult.getAttribute("before"), 10); }
static void performTest(String username, String password) { String method = Reporter.getCurrentTestResult().getMethod().getMethodName(); String txt = String.format("%s() Assertion for (%s, %s)", method, username, password); fail(txt); }
@Test public void birds() { String methodName = Reporter.getCurrentTestResult().getMethod().getMethodName(); Reporter.log(methodName); Assert.assertNotNull(methodName); }
@Test public void angry() { String methodName = Reporter.getCurrentTestResult().getMethod().getMethodName(); Reporter.log(methodName); Assert.assertNotNull(methodName); }
@Test public void android() { String methodName = Reporter.getCurrentTestResult().getMethod().getMethodName(); Reporter.log(methodName); Assert.assertNotNull(methodName); } }
protected static void logMessage() { ITestResult iTestResult = Reporter.getCurrentTestResult(); String method = iTestResult.getMethod().getMethodName(); String clazz = iTestResult.getMethod().getTestClass().getName(); messages.add(clazz + "." + method); } }