public abstract class AbstractProbeListener
extends org.junit.runner.notification.RunListener
| Modifier and Type | Field and Description |
|---|---|
protected String |
category
Define the category of the test that are running.
|
protected static io.probedock.client.common.config.Configuration |
configuration
Probe Dock configuration
|
protected static String |
DEFAULT_CATEGORY
Default category when none is specified
|
protected Long |
runStartedDate
Store the date when the run started
|
protected Map<String,Long> |
testStartDates
Store the start date of a test to measure the approximative execution time of a each test.
|
| Constructor and Description |
|---|
AbstractProbeListener()
Constructor
|
AbstractProbeListener(String category)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
protected String |
createAndlogStackTrace(org.junit.runner.notification.Failure failure)
Build a stack trace string
|
protected io.probedock.client.common.model.v1.TestResult |
createTestResult(String fingerprint,
org.junit.runner.Description description,
io.probedock.client.annotations.ProbeTest mAnnotation,
io.probedock.client.annotations.ProbeTestClass cAnnotation,
boolean passed,
String message)
Create a test based on the different information gathered from class, method and description
|
protected String |
getCategory()
Retrive the category
|
protected io.probedock.client.annotations.ProbeTestClass |
getClassAnnotation(org.junit.runner.Description description)
Try to retrieve the
ProbeTestClass annotation of the test class |
protected String |
getFingerprint(org.junit.runner.Description description)
Retrieve the fingerprint of a test based on its description
|
protected io.probedock.client.annotations.ProbeTest |
getMethodAnnotation(org.junit.runner.Description description)
Try to retrieve the
ProbeTest annotation of the test method |
protected String |
getPackage(Class cls)
Retrieve the package name if available, if not, default package name is used.
|
void |
setFullStackTraces(Boolean fullStackTraces) |
void |
testFinished(org.junit.runner.Description description) |
void |
testRunStarted(org.junit.runner.Description description) |
void |
testStarted(org.junit.runner.Description description) |
protected static final io.probedock.client.common.config.Configuration configuration
protected static final String DEFAULT_CATEGORY
protected Long runStartedDate
protected Map<String,Long> testStartDates
protected String category
public AbstractProbeListener()
public AbstractProbeListener(String category)
category - The test categorypublic void testStarted(org.junit.runner.Description description)
throws Exception
testStarted in class org.junit.runner.notification.RunListenerExceptionpublic void testFinished(org.junit.runner.Description description)
throws Exception
testFinished in class org.junit.runner.notification.RunListenerExceptionpublic void setFullStackTraces(Boolean fullStackTraces)
fullStackTraces - The full stack trace modepublic void testRunStarted(org.junit.runner.Description description)
throws Exception
testRunStarted in class org.junit.runner.notification.RunListenerExceptionprotected io.probedock.client.annotations.ProbeTest getMethodAnnotation(org.junit.runner.Description description)
throws NoSuchMethodException
ProbeTest annotation of the test methoddescription - The representation of the testNoSuchMethodExceptionprotected io.probedock.client.annotations.ProbeTestClass getClassAnnotation(org.junit.runner.Description description)
ProbeTestClass annotation of the test classdescription - The representation of the testprotected io.probedock.client.common.model.v1.TestResult createTestResult(String fingerprint, org.junit.runner.Description description, io.probedock.client.annotations.ProbeTest mAnnotation, io.probedock.client.annotations.ProbeTestClass cAnnotation, boolean passed, String message)
fingerprint - The fingerprint of the testdescription - jUnit test descriptionmAnnotation - Method annotationcAnnotation - Class annotationpassed - Test passing or notmessage - Message associated to the test resultprotected String createAndlogStackTrace(org.junit.runner.notification.Failure failure)
failure - The failure to get the exceptions and so onprotected final String getFingerprint(org.junit.runner.Description description)
description - The descriptionprotected final String getCategory()
Copyright © 2016. All rights reserved.