Quantcast
Channel: Active questions tagged selenium - Stack Overflow
Viewing all articles
Browse latest Browse all 99418

Run JunitCore.runClasses from Jenkins

$
0
0

I have two junit classes:

public class TestExample1 {

  @Test
  public void test() {
      System.out.println("running test1");
  }
}

and:

public class TestExample2 {

  @Test
  public void test() {
      System.out.println("running test2");
  }
}

I run this classes in Main:

public class Main{
    public static void main(String[] args) {
        result = JUnitCore.runClasses(TestExample1.class, TestExample2.class);
        for(Failure failure : result.getFailures()) {
            System.out.println(failure.toString());
        }
        System.out.println(result.wasSuccessful());

    }
}

How to run this code from Jenkins? Is there any possibility? For example using maven?


Viewing all articles
Browse latest Browse all 99418

Trending Articles