Squash TF Java Junit Runner

dchmn
Messages : 8
Inscription : mar. févr. 26, 2019 1:31 pm

Squash TF Java Junit Runner

Message par dchmn » mar. févr. 26, 2019 3:42 pm

Bonjour,

Suite à la sortie de la nouvelle solution Squash TF je me suis lancée dans l'install et les tests de celle-ci. En arrivant au niveau du fonctionnement du Runner Java Junit je me suis retrouvée bloquée. L’exécution de la commande suivante : "mvn clean compile test-compile org.squashtest.ta.galaxia:squash-ta-junit-runner-maven-plugin:1.0.0-RC1:list" comme présentée dans la doc https://squash-tf.readthedocs.io/projects/runner-java-junit/en/doc-stable/usage.html ne passe pas car le dépôt maven ne contient pas le plugin ou les dépendances nécessaire. Est-ce normal car ce module n'est pas encore sortie ou quelque chose m'aurait-il échappé ?

Merci de votre retour.

Avatar de l’utilisateur
bfranchet
Messages : 142
Inscription : jeu. nov. 22, 2012 1:36 pm

Squash TF Java Junit Runner

Message par bfranchet » mer. févr. 27, 2019 10:53 am

Bonjour,

Il y a effectivement une coquille dans notre doc que nous allons corriger. Le bon goal à utiliser est le suivant :

[ul]
[li]org.squashtest.ta.galaxia:squash-tf-junit-runner-maven-plugin:1.0.0-RELEASE:list[/li]
[/ul]

Par ailleurs pour une utilisation en dehors de Squash TF Execution Server, il faut s'assurer que le repo et le plugin repo de Squash sont tous les deux définis dans le maven settings

Bonne journée

alexis.berindei
Messages : 1
Inscription : mar. avr. 09, 2019 4:10 pm

Re: Squash TF Java Junit Runner

Message par alexis.berindei » mer. avr. 10, 2019 9:52 am

Hello all,

I still get a message while running TF project under Jenkins.

Here is my pom.xml

Code : Tout sélectionner

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apac                                                                               he.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>fr.pop-it.squash</groupId>
    <artifactId>Edeal</artifactId>
    <version>1.0-SNAPSHOT</version>

    <dependencies>
    <!-- https://mvnrepository.com/artifact/junit/junit -->
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-api</artifactId>
            <version>5.4.2</version>
        </dependency>
        <dependency>
            <groupId>org.seleniumhq.selenium</groupId>
            <artifactId>selenium-java</artifactId>
            <version>3.9.0</version>
        </dependency>


    </dependencies>
    <reporting>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-report-plugin</artifactId>
                <version>2.20.1</version>
            </plugin>
        </plugins>
    </reporting>
    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.19.1</version>
                <dependencies>
                    <dependency>
                        <groupId>org.junit.jupiter</groupId>
                        <artifactId>junit-jupiter-engine</artifactId>
                        <version>5.0.1</version>
                    </dependency>
                    <dependency>
                        <groupId>org.junit.platform</groupId>
                        <artifactId>junit-platform-surefire-provider</artifactId                                                                               >
                        <version>1.0.1</version>
                    </dependency>
                </dependencies>
            </plugin>
        </plugins>
    </build>
</project>
Part of error log :

Code : Tout sélectionner

[ERROR] Woops ! Could not find org.junit.platform.commons.util.ClassFilter
java.lang.ClassNotFoundException: org.junit.platform.commons.util.ClassFilter
	at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
	at org.squashtest.ta.squash.ta.plugin.junit.resources.JunitClassLoader.islandLoadingStrategy(JunitClassLoader.java:196)
	at org.squashtest.ta.squash.ta.plugin.junit.resources.JunitClassLoader.loadClass(JunitClassLoader.java:173)
	at org.junit.platform.engine.support.filter.ClasspathScanningSupport.buildClassFilter(ClasspathScanningSupport.java:61)
	at org.junit.jupiter.engine.discovery.DiscoverySelectorResolver.resolveSelectors(DiscoverySelectorResolver.java:48)
	at org.junit.jupiter.engine.JupiterTestEngine.discover(JupiterTestEngine.java:67)
	at org.junit.platform.launcher.core.DefaultLauncher.discoverEngineRoot(DefaultLauncher.java:168)
	at org.junit.platform.launcher.core.DefaultLauncher.discoverRoot(DefaultLauncher.java:155)
	at org.junit.platform.launcher.core.DefaultLauncher.discover(DefaultLauncher.java:120)
	at org.squashtest.ta.squash.ta.plugin.junit.library.context.ListAvailableJunit5Tests.perform(ListAvailableJunit5Tests.java:59)
	at org.squashtest.ta.squash.ta.plugin.junit.library.context.ListAvailableJunit5Tests.perform(ListAvailableJunit5Tests.java:1)
	at org.squashtest.ta.squash.ta.plugin.junit.library.context.Junit5ContextImpl.doInClassloadingFirewall(Junit5ContextImpl.java:80)
	at org.squashtest.ta.squash.ta.plugin.junit.library.context.Junit5ContextImpl.doInClassloadingFirewall(Junit5ContextImpl.java:98)
	at org.squashtest.ta.squash.ta.plugin.junit.library.context.Junit5ContextImpl.listAvailableTests(Junit5ContextImpl.java:55)
	at org.squashtest.ta.galaxia.squash.ta.junit.runner.explorer.JUnit5TestExplorer.listAvailableTests(JUnit5TestExplorer.java:67)
	at org.squashtest.ta.galaxia.squash.ta.junit.runner.link.JunitTestSpecparser.getAvailableJunitTests(JunitTestSpecparser.java:222)
	at org.squashtest.ta.galaxia.squash.ta.junit.runner.link.JunitTestSpecparser.addAllTestsWildCard(JunitTestSpecparser.java:127)
	at org.squashtest.ta.squash.ta.addon.logic.kit.TestSpecParserBase.addTestPointerSpec(TestSpecParserBase.java:77)
	at org.squashtest.ta.squash.ta.addon.logic.kit.TestSpecParserBase.parseTestList(TestSpecParserBase.java:67)
	at org.squashtest.ta.galaxia.squash.ta.junit.runner.maven.SquashTAJunitRunnerMojo.executeImpl(SquashTAJunitRunnerMojo.java:213)
	at org.squashtest.ta.maven.AbstractSquashTaMojo.execution(AbstractSquashTaMojo.java:100)
	at org.squashtest.ta.maven.AbstractBaseSquashTaMojo.execute(AbstractBaseSquashTaMojo.java:85)
	at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:154)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:146)
	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:117)
	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:81)
	at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
	at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:309)
	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:194)
	at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:107)
	at org.jvnet.hudson.maven3.launcher.Maven35Launcher.main(Maven35Launcher.java:130)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
	at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
	at jenkins.maven3.agent.Maven35Main.launch(Maven35Main.java:176)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at hudson.maven.Maven3Builder.call(Maven3Builder.java:139)
	at hudson.maven.Maven3Builder.call(Maven3Builder.java:70)
	at hudson.remoting.UserRequest.perform(UserRequest.java:207)
	at hudson.remoting.UserRequest.perform(UserRequest.java:53)
	at hudson.remoting.Request$2.run(Request.java:358)
	at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)

Avatar de l’utilisateur
bfranchet
Messages : 142
Inscription : jeu. nov. 22, 2012 1:36 pm

Re: Squash TF Java Junit Runner

Message par bfranchet » mar. avr. 23, 2019 2:16 pm

Hello,

What happens if you add the "junit-jupiter-engine" to project dependencies ? ( Currently you declare it only as a dependency of the surefire plugin)

Moreover it seems you don't use the same version for the "api" and the "engine", i'm not it's a good idea.

Regards
PO Squash TF

Répondre