Move alltests plugin to the Trace Compass namespace
[deliverable/tracecompass.git] / org.eclipse.tracecompass.tmf.core.tests / shared / org / eclipse / linuxtools / tmf / core / tests / shared / DebugListener.java
1 /*******************************************************************************
2 * Copyright (c) 2013 Ericsson
3 *
4 * All rights reserved. This program and the accompanying materials are
5 * made available under the terms of the Eclipse Public License v1.0 which
6 * accompanies this distribution, and is available at
7 * http://www.eclipse.org/legal/epl-v10.html
8 *
9 * Contributors:
10 * Alexandre Montplaisir - Initial API and implementation
11 *******************************************************************************/
12
13 package org.eclipse.linuxtools.tmf.core.tests.shared;
14
15 import org.junit.runner.Description;
16 import org.junit.runner.notification.Failure;
17 import org.junit.runner.notification.RunListener;
18
19 /**
20 * Debugging RunListener, which will print to stdout the name of the tests being
21 * run.
22 *
23 * @author Alexandre Montplaisir
24 */
25 public class DebugListener extends RunListener {
26
27 @Override
28 public void testStarted(Description description) {
29 System.out.println("Running " + getTestName(description));
30 }
31
32 @Override
33 public void testAssumptionFailure(Failure failure) {
34 System.out.println("SKIPPING TEST: " + getTestName(failure.getDescription()));
35 System.out.println(failure.getMessage());
36 }
37
38 /**
39 * Get the className#methodName from a Description.
40 */
41 private static String getTestName(Description description) {
42 return description.getClassName() + '#' + description.getMethodName();
43 }
44 }
This page took 0.038236 seconds and 5 git commands to generate.