Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[tycho-user] Skip specific junit test method(s)?

In maven its possible to exclude at test class - see
http://wiki.eclipse.org/Minerva#Headless_Tests:

  <build>
    <plugins>
      <plugin>
        <groupId>org.sonatype.tycho</groupId>
        <artifactId>maven-osgi-test-plugin</artifactId>
        <version>${tycho-version}</version>
        <configuration>
          <excludes>
            <!-- test mojo matches TestProject be default and treats
it as PojoTest -->
            <exclude>**/Test*.class</exclude>
          </excludes>
          <useUIHarness>false</useUIHarness>
          <useUIThread>false</useUIThread>
        </configuration>
      </plugin>
     </plugins>
    </build>

But is it possible to skip one or more test method(s). Like in the
below MyTest.java file I would like to skip test2() but only when
building with maven (it should still be possible to run the test from
eclipse):

public class MyTest {

  @Test
  public void test1() throws Exception {
    //
  }

  @Test
  public void test2() throws Exception {
    // does some heavy IO - primary for local testing
  }
}


Can this be done in the pom file somehow?


Back to the top