1 /*******************************************************************************
2 * Copyright (c) 2013, 2014 Ericsson
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
10 * Alexandre Montplaisir - Initial API and implementation
11 *******************************************************************************/
13 package org
.eclipse
.tracecompass
.tmf
.core
.tests
.shared
;
15 import org
.junit
.runner
.notification
.RunNotifier
;
16 import org
.junit
.runners
.Suite
;
17 import org
.junit
.runners
.model
.InitializationError
;
20 * Test suite that adds a {@link DebugListener} to unit tests, to help debug
23 * Use with @RunWith(DebugSuite) and DebugSuite.SuiteClasses({ })
25 * @author Alexandre Montplaisir
27 public class DebugSuite
extends Suite
{
30 * Constructor (required by JUnit)
34 * @throws InitializationError
35 * If an error happened when getting the test classes
37 public DebugSuite(Class
<?
> klass
) throws InitializationError
{
38 super(klass
, getAnnotatedClasses(klass
));
42 public void run(RunNotifier runNotifier
) {
43 runNotifier
.addListener(new DebugListener());
44 super.run(runNotifier
);
47 private static Class
<?
>[] getAnnotatedClasses(Class
<?
> klass
) throws InitializationError
{
48 SuiteClasses annotation
= klass
.getAnnotation(SuiteClasses
.class);
49 if (annotation
== null) {
50 throw new InitializationError(String
.format("class '%s' must have a SuiteClasses annotation", klass
.getName()));
52 return annotation
.value();
This page took 0.031914 seconds and 5 git commands to generate.