Skip to main content

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

why not move the test method to be excluded to a separate test class and exclude the class?

Jan

-----Original Message-----
From: tycho-user-bounces@xxxxxxxxxxx [mailto:tycho-user-bounces@xxxxxxxxxxx] On Behalf Of motes motes
Sent: Donnerstag, 22. September 2011 11:23
To: Tycho user list
Subject: [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?
_______________________________________________
tycho-user mailing list
tycho-user@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/tycho-user


Back to the top