aboutsummaryrefslogtreecommitdiffstats
blob: ef51df81a97db37fa3d09bd512ffe4faaf5bb6a8 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
/*******************************************************************************
 * Copyright (c) 2012, 2016 SAP SE and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *     SAP SE - initial API and implementation
 *******************************************************************************/

package org.eclipse.tycho.surefire.provider.spi;

import java.util.List;
import java.util.Properties;

import org.apache.maven.model.Dependency;
import org.codehaus.plexus.component.annotations.Component;
import org.eclipse.tycho.classpath.ClasspathEntry;
import org.osgi.framework.Version;

/**
 * Surefire provider adapter for tycho. Any plexus {@link Component} in the classpath of
 * tycho-surefire-plugin implementing this interface is registered as a tycho test framework
 * provider.
 */
public interface TestFrameworkProvider {

    /**
     * The test framework type, such as junit or testng
     */
    public String getType();

    /**
     * The test framework version. If several providers of the same type are enabled, the one with
     * the highest version wins.
     */
    public Version getVersion();

    /**
     * Fully qualified class name of the surefire provider (must implement contract
     * http://maven.apache.org/plugins/maven-surefire-plugin/api.html ).
     */
    public String getSurefireProviderClassName();

    /**
     * Whether this provider should be enabled for the given test bundle classpath and surefire
     * properties.
     * 
     * @param testBundleClassPath
     *            classpath of the test bundle
     * @param providerProperties
     *            surefire provider properties
     */
    public boolean isEnabled(List<ClasspathEntry> testBundleClassPath, Properties providerProperties);

    /**
     * The list of OSGi bundles required by the test framework provider as maven artifacts. The
     * groupId, artifactId and optionally version (if != <code>null</code>) will be matched against
     * the plugin dependencies of tycho-surefire-plugin.
     */
    public List<Dependency> getRequiredBundles();

    /**
     * Provider specific properties that are added to the generic test properties. Implementations
     * must not return null.
     * 
     * @return
     */
    public Properties getProviderSpecificProperties();

}