Discussion:
Error running Maven Tests with powermock and junit
Chiara
2011-07-15 13:35:09 UTC
Permalink
Hi,
I am not being able to run Powermock through maven.
I've an ejb 2.0 project and i've put under test folder my test's classes.

Here's the test:

*@RunWith(PowerMockRunner.class)
public class AdapterTest{

@Test
public void testForSqlDate() {
......*

I haven't configured anyting special for running my test. My pom references
the following deps:


* * junit | junit | 4.8.2
* org.easymock |easymock |3.0
* org.powermock | powermock-easymock-release-full |1.4.7*


This part of pom is like this :

*...
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.8.2</version>
<type>jar</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.easymock</groupId>
<artifactId>easymock</artifactId>
<version>3.0</version>
<type>jar</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-easymock-release-full</artifactId>
<version>1.4.7</version>
<type>jar</type>
<classifier>full</classifier>
<scope>test</scope>
</dependency>
...*

When i run Maven Test i obtain the following error :

*-------------------------------------------------------
T E S T S
-------------------------------------------------------
Running TestSuite
Running TestSuite
Tests run: 0, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.454 sec
There are no tests to run.

Results :

Tests run: 0, Failures: 0, Errors: 0, Skipped: 0
*


why it doesn't recognise my tests??

Pls help me, i'm new in maven..

Thk's a lot

Chiara




--
View this message in context: http://maven.40175.n5.nabble.com/Error-running-Maven-Tests-with-powermock-and-junit-tp4590688p4590688.html
Sent from the Maven - Users mailing list archive at Nabble.com.
Greg Akins
2011-07-15 13:41:47 UTC
Permalink
Post by Chiara
Hi,
I am not being able to run Powermock through maven.
I've an ejb 2.0 project and i've put under test folder my test's classes.
Everything looked ok to me. But to make sure.. Did you put the tests
in <project root>/src/test/java ?
--
Greg Akins
http://twitter.com/akinsgre
Chiara
2011-07-15 13:44:58 UTC
Permalink
Hi, yes i've put all test under this folder.
I don't know what to do seriously.. 'cause if i try to run test using run as junit tests it works..

Date: Fri, 15 Jul 2011 06:42:28 -0700
From: ml-node+4590720-191037357-***@n5.nabble.com
To: ***@hotmail.it
Subject: Re: Error running Maven Tests with powermock and junit
Post by Chiara
Hi,
I am not being able to run Powermock through maven.
I've an ejb 2.0 project and i've put under test folder my test's classes.
Everything looked ok to me. But to make sure.. Did you put the tests

in <project root>/src/test/java ?
--
Greg Akins

http://twitter.com/akinsgre

---------------------------------------------------------------------

To unsubscribe, e-mail: [hidden email]

For additional commands, e-mail: [hidden email]










If you reply to this email, your message will be added to the discussion below:
http://maven.40175.n5.nabble.com/Error-running-Maven-Tests-with-powermock-and-junit-tp4590673p4590720.html



To unsubscribe from Error running Maven Tests with powermock and junit, click here.


--
View this message in context: http://maven.40175.n5.nabble.com/Error-running-Maven-Tests-with-powermock-and-junit-tp4590673p4590726.html
Sent from the Maven - Users mailing list archive at Nabble.com.
Greg Akins
2011-07-15 13:51:53 UTC
Permalink
Post by Chiara
Hi, yes i've put all test under this folder.
I don't know what to do seriously.. 'cause if i try to run test using run as junit tests it works..
So the only change you make.. after the JUnit tests run, is to add the
@RunWith(PowerMockRunner.class) attribute?

And then the tests are not recognized?
--
Greg Akins
http://twitter.com/akinsgre
Guillaume Polet
2011-07-15 13:54:54 UTC
Permalink
Does your class containing the tests matches the default include patterns?

http://maven.apache.org/plugins/maven-surefire-plugin/test-mojo.html#includes

<includes>
<include>**/Test*.java</include>
<include>**/*Test.java</include>
<include>**/*TestCase.java</include>
</includes>

Guillaume
Post by Greg Akins
Post by Chiara
Hi, yes i've put all test under this folder.
I don't know what to do seriously.. 'cause if i try to run test using run as junit tests it works..
So the only change you make.. after the JUnit tests run, is to add the
@RunWith(PowerMockRunner.class) attribute?
And then the tests are not recognized?
Chiara
2011-07-15 14:18:04 UTC
Permalink
Yes 'cause my test class is AdapterTest.java

I have to add some specific plugin ??

Plugin i've added to project are :

<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>was6-maven-plugin</artifactId>
<version>1.1.2</version>
<executions>
<execution>
<goals>
<goal>ejbdeploy</goal>
</goals>
</execution>
</executions>
<configuration>
<wasHome>${was61.home}</wasHome>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-ejb-plugin</artifactId>
<version>2.3</version>
<configuration>
<ejbVersion>2.1</ejbVersion>
<generateClient>true</generateClient>
<archive>
<manifest>
<addClasspath>true</addClasspath>
</manifest>
<index>false</index>
<addMavenDescriptor>false</addMavenDescriptor>
</archive>
</configuration>
</plugin>

thk a lot

Date: Fri, 15 Jul 2011 07:05:39 -0700
From: ml-node+4590805-1772571158-***@n5.nabble.com
To: ***@hotmail.it
Subject: Re: Error running Maven Tests with powermock and junit



Does your class containing the tests matches the default include patterns?



http://maven.apache.org/plugins/maven-surefire-plugin/test-mojo.html#includes

<includes>

<include>**/Test*.java</include>

<include>**/*Test.java</include>

<include>**/*TestCase.java</include>

</includes>


Guillaume
Post by Greg Akins
Post by Chiara
Hi, yes i've put all test under this folder.
I don't know what to do seriously.. 'cause if i try to run test using run as junit tests it works..
So the only change you make.. after the JUnit tests run, is to add the
@RunWith(PowerMockRunner.class) attribute?
And then the tests are not recognized?
---------------------------------------------------------------------

To unsubscribe, e-mail: [hidden email]

For additional commands, e-mail: [hidden email]










If you reply to this email, your message will be added to the discussion below:
http://maven.40175.n5.nabble.com/Error-running-Maven-Tests-with-powermock-and-junit-tp4590673p4590805.html



To unsubscribe from Error running Maven Tests with powermock and junit, click here.


--
View this message in context: http://maven.40175.n5.nabble.com/Error-running-Maven-Tests-with-powermock-and-junit-tp4590673p4590845.html
Sent from the Maven - Users mailing list archive at Nabble.com.
Wayne Fay
2011-07-15 17:18:21 UTC
Permalink
Post by Chiara
Yes 'cause my test class is AdapterTest.java
I have to add some specific plugin ??
Perhaps try "mvn -X ..." and see if you notice anything interesting in
the debug output? Otherwise maybe post the output of that command to
www.pastebin.com and send a link here (please do NOT send the full log
via email) and someone can take a look at it.

Also, if you can package up a sample project that demonstrates this
behavior consistently, that may be helpful for diagnosing the problem
and providing a fix.

Wayne

Chiara
2011-07-15 13:31:55 UTC
Permalink
Hi,
I am not being able to run Powermock through maven.
I've an ejb 2.0 project and i've put under test folder my test's classes.

Here's the test:

*@RunWith(PowerMockRunner.class)
public class AdapterTest{

@Test
public void testForSqlDate() {
......*

I haven't configured anyting special for running my test. My pom references
the following deps:


* * junit | junit | 4.8.2
* org.easymock |easymock |3.0
* org.powermock | powermock-easymock-release-full |1.4.7*


This part of pom is like this :

*...
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.8.2</version>
<type>jar</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.easymock</groupId>
<artifactId>easymock</artifactId>
<version>3.0</version>
<type>jar</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-easymock-release-full</artifactId>
<version>1.4.7</version>
<type>jar</type>
<classifier>full</classifier>
<scope>test</scope>
</dependency>
...*

When i run Maven Test i obtain the following error :

*-------------------------------------------------------
T E S T S
-------------------------------------------------------
Running TestSuite
Running TestSuite
Tests run: 0, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.454 sec
There are no tests to run.

Results :

Tests run: 0, Failures: 0, Errors: 0, Skipped: 0
*


why it doesn't recognise my tests??

Pls help me, i'm new in maven..

Thk's a lot

Chiara




--
View this message in context: http://maven.40175.n5.nabble.com/Error-running-Maven-Tests-with-powermock-and-junit-tp4590673p4590673.html
Sent from the Maven - Users mailing list archive at Nabble.com.
Loading...