Hi All,

I'm trying to move a big decrepit ant build over to maven but have hit a bit
of a stumbling block with running the tests. We have a standard directory
structure with some tests in src/test/java but we also have a large number
of the tests (~2000) in public-static-classes of the class they test in
src/main/java, e.g.:

public class SimpleClass {
  public int returnOne {
    return 1;
  }

  public static class Test extends junit.framework.TestCase {
    public void testReturnOne() {
      assertEquals(1, new SimpleClass().returnOne());
    }
  }
}

If I run *mvn test*, it only picks up the tests in the test directory and
not the tests in the src directory. If I set the testDirectory in the build
section of my pom to the src/main/java/ directory *mvn test* then picks up
these tests but not those in the src/test/java/ directory.

There are good reasons why some of the tests should be within the file they
are testing (testing of private methods) so I can't rip them all out. So, my
question is:

How can I make maven run all tests in both the src/main/java/ and
src/main/test/ directories?

Thanks,

Paul.

Reply via email to