org.tap4j.ext.junit
Class JUnitYAMLishUtils

Package class diagram package JUnitYAMLishUtils
java.lang.Object
  extended by org.tap4j.ext.junit.JUnitYAMLishUtils

public final class JUnitYAMLishUtils
extends Object

JUnit YAMLish utility class.

Since:
1.4.3

Field Summary
static SimpleDateFormat ISO_8061_DATE_FORMAT
          Date Format used to format a datetime in ISO-8061 for YAMLish diagnostic.
static String LINE_SEPARATOR
           
 
Method Summary
static String extractClassName(org.junit.runner.Description description)
          Extract the class name from a given junit test description
static String extractMethodName(org.junit.runner.Description description)
          Get the tested method name
static String extractSimpleClassName(org.junit.runner.Description description)
          Extract the simple class name from a given junit test description
static String getBacktrace(JUnitTestData testMethod)
          Get the backtrace from a given failed JUnit test result
static String getDatetime()
          Get a date time string
static String getError(JUnitTestData testMethod)
          Get the error message from a given failed JUnit test result
static String getFile(JUnitTestData testMethod)
          Get the file name of the tested method
static String getLine(JUnitTestData testMethod)
          Get the line of the error in the exception info
static String getLineNumberFromExceptionTraceLine(String exceptionTraceLine, String substrToSearch)
          Get the error line number from the exception stack trace
static String getMessage(JUnitTestData testMethod)
          Generate a message with the name of the tested method
static String getName(JUnitTestData testMethod)
          Get tested method name
static String getSeverity(JUnitTestData testMethod)
          Get the severity of the test
static String getSource(String testMethod, String testClass)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ISO_8061_DATE_FORMAT

public static final SimpleDateFormat ISO_8061_DATE_FORMAT
Date Format used to format a datetime in ISO-8061 for YAMLish diagnostic.


LINE_SEPARATOR

public static final String LINE_SEPARATOR
Method Detail

getMessage

public static String getMessage(JUnitTestData testMethod)
Generate a message with the name of the tested method

Parameters:
testMethod -
Returns:
test message

getSeverity

public static String getSeverity(JUnitTestData testMethod)
Get the severity of the test

Parameters:
testMethod -
Returns:
severity

getSource

public static String getSource(String testMethod,
                               String testClass)
Parameters:
testMethod -
testClass -
Returns:
test source

getDatetime

public static String getDatetime()
Get a date time string

Returns:
date time string

getFile

public static String getFile(JUnitTestData testMethod)
Get the file name of the tested method

Parameters:
testMethod -
Returns:
the file name

getLine

public static String getLine(JUnitTestData testMethod)
Get the line of the error in the exception info

Parameters:
testMethod -
Returns:
line of the error in the exception info

getLineNumberFromExceptionTraceLine

public static String getLineNumberFromExceptionTraceLine(String exceptionTraceLine,
                                                         String substrToSearch)
Get the error line number from the exception stack trace

Parameters:
exceptionTraceLine -
substrToSearch -
Returns:
error line number

getName

public static String getName(JUnitTestData testMethod)
Get tested method name

Parameters:
testMethod -
Returns:
tested method name

getError

public static String getError(JUnitTestData testMethod)
Get the error message from a given failed JUnit test result

Parameters:
testMethod -
Returns:
error message from a given failed JUnit test result

getBacktrace

public static String getBacktrace(JUnitTestData testMethod)
Get the backtrace from a given failed JUnit test result

Parameters:
testMethod -
Returns:
Backtrace from a given failed JUnit test result

extractClassName

public static String extractClassName(org.junit.runner.Description description)
Extract the class name from a given junit test description

Parameters:
description -
Returns:
a class name

extractSimpleClassName

public static String extractSimpleClassName(org.junit.runner.Description description)
Extract the simple class name from a given junit test description

Parameters:
description -
Returns:
a simple class name

extractMethodName

public static String extractMethodName(org.junit.runner.Description description)
Get the tested method name

Parameters:
description -
Returns:
tested methode name


Copyright © 2010-2012 TupiLabs. All Rights Reserved.