Search in sources :

Example 1 with TestFrameworkProvider

use of org.eclipse.tycho.surefire.provider.spi.TestFrameworkProvider in project tycho by eclipse.

the class ProviderHelperTest method testSelectJunit5WithJUnit4Present.

public void testSelectJunit5WithJUnit4Present() throws Exception {
    TestFrameworkProvider provider = providerHelper.selectProvider(classPath("org.junit:4.12", "org.junit.jupiter.api:5.0.0"), new Properties(), null);
    assertEquals(JUnit5Provider.class, provider.getClass());
}
Also used : TestFrameworkProvider(org.eclipse.tycho.surefire.provider.spi.TestFrameworkProvider) Properties(java.util.Properties)

Example 2 with TestFrameworkProvider

use of org.eclipse.tycho.surefire.provider.spi.TestFrameworkProvider in project tycho by eclipse.

the class ProviderHelperTest method testMultipleProviderTypesFound.

public void testMultipleProviderTypesFound() throws Exception {
    TestFrameworkProvider anotherProvider = new TestFrameworkProvider() {

        @Override
        public boolean isEnabled(List<ClasspathEntry> testBundleClassPath, Properties surefireProperties) {
            return true;
        }

        @Override
        public Version getVersion() {
            return new Version("1.0");
        }

        @Override
        public String getType() {
            return "another_test_fwk";
        }

        @Override
        public String getSurefireProviderClassName() {
            return "a.nother.test.framework.Provider";
        }

        @Override
        public List<Dependency> getRequiredBundles() {
            return emptyList();
        }

        @Override
        public Properties getProviderSpecificProperties() {
            return new Properties();
        }
    };
    PlexusContainer container = getContainer();
    container.addComponent(anotherProvider, TestFrameworkProvider.class, "another_test_fwk");
    ProviderHelper providerSelector = container.lookup(ProviderHelper.class);
    try {
        providerSelector.selectProvider(classPath("org.junit:4.8.1"), new Properties(), null);
        fail();
    } catch (MojoExecutionException e) {
    // expected
    } finally {
        container.release(anotherProvider);
    }
}
Also used : PlexusContainer(org.codehaus.plexus.PlexusContainer) MojoExecutionException(org.apache.maven.plugin.MojoExecutionException) Version(org.osgi.framework.Version) TestFrameworkProvider(org.eclipse.tycho.surefire.provider.spi.TestFrameworkProvider) Collections.emptyList(java.util.Collections.emptyList) List(java.util.List) Arrays.asList(java.util.Arrays.asList) Dependency(org.apache.maven.model.Dependency) Properties(java.util.Properties)

Example 3 with TestFrameworkProvider

use of org.eclipse.tycho.surefire.provider.spi.TestFrameworkProvider in project tycho by eclipse.

the class ProviderHelperTest method testSelectJunit47.

public void testSelectJunit47() throws Exception {
    Properties providerProperties = new Properties();
    providerProperties.setProperty("parallel", "classes");
    TestFrameworkProvider provider = providerHelper.selectProvider(classPath("org.junit:3.8.2", "org.junit4:4.8.1"), providerProperties, null);
    assertEquals(JUnit47Provider.class, provider.getClass());
}
Also used : TestFrameworkProvider(org.eclipse.tycho.surefire.provider.spi.TestFrameworkProvider) Properties(java.util.Properties)

Example 4 with TestFrameworkProvider

use of org.eclipse.tycho.surefire.provider.spi.TestFrameworkProvider in project tycho by eclipse.

the class ProviderHelperTest method testForceJunit3WithHint.

public void testForceJunit3WithHint() throws Exception {
    TestFrameworkProvider provider = providerHelper.selectProvider(classPath("org.junit:3.8.1", "org.junit:4.8.1"), new Properties(), "junit3");
    assertEquals(JUnit3Provider.class, provider.getClass());
}
Also used : TestFrameworkProvider(org.eclipse.tycho.surefire.provider.spi.TestFrameworkProvider) Properties(java.util.Properties)

Example 5 with TestFrameworkProvider

use of org.eclipse.tycho.surefire.provider.spi.TestFrameworkProvider in project tycho by eclipse.

the class ProviderHelperTest method testSelectJunit5.

public void testSelectJunit5() throws Exception {
    TestFrameworkProvider provider = providerHelper.selectProvider(classPath("org.junit.jupiter.api:5.0.0"), new Properties(), null);
    assertEquals(JUnit5Provider.class, provider.getClass());
}
Also used : TestFrameworkProvider(org.eclipse.tycho.surefire.provider.spi.TestFrameworkProvider) Properties(java.util.Properties)

Aggregations

TestFrameworkProvider (org.eclipse.tycho.surefire.provider.spi.TestFrameworkProvider)12 Properties (java.util.Properties)9 MojoExecutionException (org.apache.maven.plugin.MojoExecutionException)4 File (java.io.File)2 Artifact (org.apache.maven.artifact.Artifact)2 Dependency (org.apache.maven.model.Dependency)2 IOException (java.io.IOException)1 MalformedURLException (java.net.MalformedURLException)1 ArrayList (java.util.ArrayList)1 Arrays.asList (java.util.Arrays.asList)1 Collections.emptyList (java.util.Collections.emptyList)1 List (java.util.List)1 ArtifactResolutionException (org.apache.maven.artifact.resolver.ArtifactResolutionException)1 MojoFailureException (org.apache.maven.plugin.MojoFailureException)1 PlexusContainer (org.codehaus.plexus.PlexusContainer)1 BundleStartLevel (org.eclipse.sisu.equinox.launching.BundleStartLevel)1 DefaultEquinoxInstallationDescription (org.eclipse.sisu.equinox.launching.DefaultEquinoxInstallationDescription)1 EquinoxInstallationDescription (org.eclipse.sisu.equinox.launching.EquinoxInstallationDescription)1 ArtifactDescriptor (org.eclipse.tycho.ArtifactDescriptor)1 ArtifactKey (org.eclipse.tycho.ArtifactKey)1