Return-Path: X-Original-To: apmail-maven-issues-archive@minotaur.apache.org Delivered-To: apmail-maven-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id E1D1718403 for ; Wed, 23 Dec 2015 21:13:46 +0000 (UTC) Received: (qmail 92811 invoked by uid 500); 23 Dec 2015 21:13:46 -0000 Delivered-To: apmail-maven-issues-archive@maven.apache.org Received: (qmail 92740 invoked by uid 500); 23 Dec 2015 21:13:46 -0000 Mailing-List: contact issues-help@maven.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@maven.apache.org Delivered-To: mailing list issues@maven.apache.org Received: (qmail 92724 invoked by uid 99); 23 Dec 2015 21:13:46 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 23 Dec 2015 21:13:46 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 98FC82C1F54 for ; Wed, 23 Dec 2015 21:13:46 +0000 (UTC) Date: Wed, 23 Dec 2015 21:13:46 +0000 (UTC) From: "Tibor Digana (JIRA)" To: issues@maven.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (SUREFIRE-1211) surefire-testng runs JUnit tests MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/SUREFIRE-1211?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15070199#comment-15070199 ] Tibor Digana commented on SUREFIRE-1211: ---------------------------------------- >>Compare the abridged test output with junit=false: >>I expect surefire-testng to only run the testng tests (1 test). Yes, remove both providers and use junit=false and you will see only TestNG tests in the entire build summary. The integration test proves this working. Notice that we, first of all, discover providers in dependency structure. Then we run them in a loop. They are undergo their individual tasks. Due to TestNG is able to run JUnit tests just avoid surefire-junit47 or simply do not use any. >>I expect surefire-testng to run both the JUnit and testng tests (3 tests). No problem. This works so far 2.19. Feel free to use TestNG 6.x which is dependent on JUnit 4.x. (optional - non-inheritable dependency) and annotations can be used. > surefire-testng runs JUnit tests > -------------------------------- > > Key: SUREFIRE-1211 > URL: https://issues.apache.org/jira/browse/SUREFIRE-1211 > Project: Maven Surefire > Issue Type: Bug > Components: Maven Surefire Plugin > Affects Versions: 2.19 > Reporter: Andrew Gaul > Assignee: Tibor Digana > Fix For: 2.19.1 > > Attachments: pom.xml > > > When running two test classes, one using JUnit and the other testng annotations, I observe surefire-testng running both tests: > {noformat} > $ cat src/test/java/JunitTest.java > import org.junit.Test; > public final class JunitTest { > @Test public void junitMethod() throws Exception {} > } > $ cat src/test/java/TestngTest.java > import org.testng.annotations.Test; > public final class TestngTest { > @Test public void testngMethod() throws Exception {} > } > $ mvn clean test --quiet > ------------------------------------------------------- > T E S T S > ------------------------------------------------------- > Running JunitTest > Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.002 sec - in JunitTest > Results : > Tests run: 1, Failures: 0, Errors: 0, Skipped: 0 > ------------------------------------------------------- > T E S T S > ------------------------------------------------------- > Running TestSuite > Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.476 sec - in TestSuite > Results : > Tests run: 2, Failures: 0, Errors: 0, Skipped: 0 > {noformat} > Instead it should only run the single testng test. -- This message was sent by Atlassian JIRA (v6.3.4#6332)