0

I have 5 test classes in the package: X.Y.Z

Test Classes are those following: A,B,C,D,. They are identical. Everything is same in the classes. Only difference is that there is another fields in the class.

The main problem (confusing problem) is that, MVN runs A,B,C test cases but not "D".

In the log there is written only this:

------------------------------------------------------
 T E S T S
-------------------------------------------------------
Running ge.ddrc.transport.controller.rest
Running x.y.z.A
...
Running x.y.z.B
...
Running x.y.z.C

I use Eclipse. In eclipse I can run the test case (As A JUnit Launcher) without problem. This class looks Like this:

@Transactional
@RunWith(SpringJUnit4ClassRunner.class)
@WebAppConfiguration
@ContextConfiguration(locations = { "/junit/spring/config/root-context.xml" })
public class D{

    @Autowired
    private TestService testServ;


    private MockMvc mockMvc;

    @Autowired
    private FilterChainProxy springSecurityFilterChain;

    @Autowired
    private WebApplicationContext wac;

    @Before
    public void setup() {
        this.mockMvc = MockMvcBuilders.webAppContextSetup(this.wac).addFilters(this.springSecurityFilterChain).build();
    }


    @Test
    public void getInfo() throws Exception {
        System.out.println("OK INVOKED");

    }



}

Could you tell me what happens? why mvn does not want to run this class. Is there any issue? mvn run another test cases but not this.

grep
  • 5,465
  • 12
  • 60
  • 112
  • 5
    And what are the actual names of these classes? AFAIK the `surefire` plugin chooses classes by the `Test` suffix in their name. – Marko Topolnik Feb 11 '15 at 09:07
  • @MarkoTopolnik, agree – Mysterion Feb 11 '15 at 09:07
  • 1
    @MarkoTopolnik is correct. See [the plugin help](http://maven.apache.org/surefire/maven-surefire-plugin/test-mojo.html#includes) where it describes the standard inclusion pattern for test files. It must start with `Test` or end with `Test` or `TestCase`. – Duncan Jones Feb 11 '15 at 09:15
  • thank you. you can write this in to the answer and I will mark as an "ANSWERED". The actual name was "DataControllerTests". I have "Tests" instead of Test. :) – grep Feb 11 '15 at 09:21

0 Answers0