Return-Path: X-Original-To: apmail-maven-users-archive@www.apache.org Delivered-To: apmail-maven-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id DB853E7B7 for ; Sun, 20 Jan 2013 23:55:34 +0000 (UTC) Received: (qmail 94159 invoked by uid 500); 20 Jan 2013 23:55:32 -0000 Delivered-To: apmail-maven-users-archive@maven.apache.org Received: (qmail 93964 invoked by uid 500); 20 Jan 2013 23:55:32 -0000 Mailing-List: contact users-help@maven.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Maven Users List" Reply-To: "Maven Users List" Delivered-To: mailing list users@maven.apache.org Received: (qmail 93956 invoked by uid 99); 20 Jan 2013 23:55:32 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 20 Jan 2013 23:55:32 +0000 X-ASF-Spam-Status: No, hits=-2.3 required=5.0 tests=RCVD_IN_DNSWL_MED,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [209.65.160.94] (HELO nbfkord-smmo06.seg.att.com) (209.65.160.94) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 20 Jan 2013 23:55:22 +0000 Received: from unknown [144.160.112.28] (EHLO tlpi048.enaf.dadc.sbc.com) by nbfkord-smmo06.seg.att.com(mxl_mta-6.15.0-1) over TLS secured channel with ESMTP id 5d38cf05.0.150369.00-433.397506.nbfkord-smmo06.seg.att.com (envelope-from ); Sun, 20 Jan 2013 23:55:01 +0000 (UTC) X-MXL-Hash: 50fc83d5507f5d5a-261a9433590168b6affd20f5490ae322d5ce9d1b Received: from enaf.dadc.sbc.com (localhost.localdomain [127.0.0.1]) by tlpi048.enaf.dadc.sbc.com (8.14.5/8.14.5) with ESMTP id r0KNt0PM009660 for ; Sun, 20 Jan 2013 17:55:00 -0600 Received: from dalint01.pst.cso.att.com (dalint01.pst.cso.att.com [135.31.133.159]) by tlpi048.enaf.dadc.sbc.com (8.14.5/8.14.5) with ESMTP id r0KNst96009651 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Sun, 20 Jan 2013 17:54:55 -0600 Received: from WABOTH9MSGHUB8E.ITServices.sbc.com (minint-0pc0fnb.itservices.sbc.com [135.163.35.85]) by dalint01.pst.cso.att.com (RSA Interceptor) for ; Sun, 20 Jan 2013 17:54:34 -0600 Received: from WABOTH9MSGUSR8C.ITServices.sbc.com ([135.163.35.214]) by WABOTH9MSGHUB8E.ITServices.sbc.com ([135.163.35.85]) with mapi id 14.02.0328.009; Sun, 20 Jan 2013 15:54:33 -0800 From: "KARR, DAVID" To: "users@maven.apache.org" Subject: PowerMock tests work fine in Eclipse, but don't execute in Maven build Thread-Topic: PowerMock tests work fine in Eclipse, but don't execute in Maven build Thread-Index: Ac33aQFSqcbTNNORQfmjFm2pzTQy/A== Date: Sun, 20 Jan 2013 23:54:33 +0000 Message-ID: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [135.70.88.202] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-RSA-Inspected: yes X-RSA-Classifications: public X-Spam: [F=0.2000000000; CM=0.500; S=0.200(2010122901)] X-MAIL-FROM: X-SOURCE-IP: [144.160.112.28] X-AnalysisOut: [v=2.0 cv=Wfi7nTdX c=1 sm=0 a=srMsL6ituuWTYeky9Bs9mA==:17 a] X-AnalysisOut: [=8hPWuiFuIIIA:10 a=wGzWpy5zho0A:10 a=ofMgfj31e3cA:10 a=BLc] X-AnalysisOut: [eEmwcHowA:10 a=kj9zAlcOel0A:10 a=zQP7CpKOAAAA:8 a=XIqpo32R] X-AnalysisOut: [AAAA:8 a=VkyotEev5pAA:10 a=mV9VRH-2AAAA:8 a=SSmOFEACAAAA:8] X-AnalysisOut: [ a=Qi4P6DhPlTyElRVgYdQA:9 a=CjuIK1q_8ugA:10] X-Virus-Checked: Checked by ClamAV on apache.org I normally use Mockito and JUnit with Maven. I'm trying to write some test= s using PowerMock. I got the PowerMock test working fine in Eclipse, but n= ow I'm noticing that the test is not running in the Maven build. Maven fin= ds the test class, but it seems to think there are no tests. It's also try= ing to run it with TestNG instead of JUnit, which is surprising. This is the build output I see: ---------------------- ------------------------------------------------------- T E S T S ------------------------------------------------------- Running com.foo.tv.client.UiFeatureManagerTest Configuring TestNG with: org.apache.maven.surefire.testng.conf.TestNG652Con= figurator@76cbf7 Tests run: 0, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.69 sec Results : Tests run: 0, Failures: 0, Errors: 0, Skipped: 0 --------------------------- My very elided test class looks like this: ------------------------ @RunWith(PowerMockRunner.class) @PrepareForTest({...}) public class UiFeatureManagerTest { private UiFeatureManager uiFeatureManager; =20 ... =20 @Before public void setup() { uiFeatureManager =3D new UiFeatureManager(...); ... PowerMockito.mockStatic(Blio.class, OrderUtil.class); } @Test public void lookupstuff() { when(...).thenReturn(...); ... } ------------------- This is my entire POM: ----------------------------- 4.0.0 powermockdemo powermockdemo 0.0.1-SNAPSHOT maven-compiler-plugin 2.3.2 1.6 1.6 org.apache.maven.plugins maven-surefire-plugin 2.12.4 true methods true src/test/resources ${project.build.directo= ry}/classes ${project.build.directo= ry}/test-classes ${surefire.argLine} ${project.build.directory}/generated-= classes/classes once commons-collections commons-collections 3.2.1 commons-lang commons-lang 2.6 org.powermock powermock-mockito-release-full 1.5 full test org.easytesting fest-assert 1.4 test junit junit 4.11 test -------------------- --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@maven.apache.org For additional commands, e-mail: users-help@maven.apache.org