No tests found matching - @RunsWith(PowerMockRunner.class)

2,401 views
Skip to first unread message

Michael Schumacher

unread,
Jan 25, 2016, 11:13:18 PM1/25/16
to PowerMock

I have a very strange problem.  My co-worker can run the individual method tests, yet when I run this test (strip down version of the class), the error (below) happens...

 

I've been searching Google with no luck of getting any solutions to this problem.

 

I'll try to provide more information to help:

 

Properties for project - Java Build Path - Source

pxi/META-INF

pxi/src/java

pxi/testfiles

pxi/tests  ß this is where the class is located in…

 

Properties for project - Java Build Path - Libraries

Powermock-mockito-1.4.12-full.jar

JUnit4  ß Assuming library (based on icon)

-          org.junit_4.12.0.v201504281640

-          org.hamcrest.core_1.3.0.v201303031735.jar

 

Using Weblogic12, Spring 3.2.13, JDK 1.8.0_45

 

If any other information would be helpful, let me know and I’ll try to get it.

 

package com.chw.pxi.impl.oneway.formatter;

 

import org.junit.Before;

import org.junit.Test;

import org.junit.runner.RunWith;

import org.mockito.MockitoAnnotations;

import org.powermock.modules.junit4.PowerMockRunner;

//import org.powermock.modules.junit4.legacy.PowerMockRunner;

 

import com.chw.dbobjects.comm.pms.PmsBusinessEventQueue;

import com.chw.dbobjects.comm.pms.PmsIoQueue;

 

@RunWith(PowerMockRunner.class)

public class OnewayOldFormatterNew

{

 

     @Before

     public void setUp()

     {

          MockitoAnnotations.initMocks(this);

     }

    

     @Test

     public void

     test_instanceOf()

     {

          Object lQueue = null;

          if (lQueue instanceof PmsIoQueue)

          {

              System.out.println("Yep - PmsIoQueue");

          }

          else if (lQueue instanceof PmsBusinessEventQueue)

          {

              System.out.println("Yep - BusinessEventQueue");

          }

          System.out.println("Done");

     }

 

}

 

 

java.lang.Exception: No tests found matching [{ExactMatcher:fDisplayName=test_instanceOf], {ExactMatcher:fDisplayName=test_instanceOf(com.chw.pxi.impl.oneway.formatter.OnewayOldFormatterTestsNew)], {LeadingIdentifierMatcher:fClassName=com.chw.pxi.impl.oneway.formatter.OnewayOldFormatterTestsNew,fLeadingIdentifier=test_instanceOf]] from org.junit.internal.requests.ClassRequest@1a407d53

       at org.junit.internal.requests.FilterRequest.getRunner(FilterRequest.java:40)

       at org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.createFilteredTest(JUnit4TestLoader.java:77)

       at org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.createTest(JUnit4TestLoader.java:68)

       at org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.loadTests(JUnit4TestLoader.java:43)

       at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:444)

       at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675)

       at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)

       at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)

 

 


Reply all
Reply to author
Forward
0 new messages