Package org.testng

Examples of org.testng.TestNGAntTask


public class TestNG {

  public static void test(MxTest mxtest, String jvmarg) {
   
    // use default TestNG reports
    TestNGAntTask testng = new TestNGAntTask();
    testng.setTaskName("test");
    testng.setProject(mxtest.getProject());
    testng.init();
       
    if (!StringUtils.isEmpty(jvmarg)) {
      testng.createJvmarg().setValue(jvmarg);
    }

    testng.setWorkingDir(mxtest.getProject().getBaseDir());
    testng.setOutputDir(mxtest.getTestReports());
    testng.setFailureProperty(mxtest.getFailureProperty());
   
    testng.createClasspath().add(mxtest.getUnitTestClasspath());
    testng.addClassfileset(mxtest.getUnitTests());
   
    // Cobertura properties
    testng.addSysproperty(mxtest.getCoberturaFileProperty());
   
    // EMMA properties
    testng.addSysproperty(mxtest.getEmmaFileProperty());
    testng.addSysproperty(mxtest.getEmmaMergeProperty());
 
    // configure properties from Moxie file
    MaxmlMap attributes = mxtest.getBuild().getConfig().getTaskAttributes("testng");
    if (attributes != null) {
      AttributeReflector.setAttributes(mxtest.getProject(), testng, attributes);
    }

    testng.execute();
  }
View Full Code Here

TOP

Related Classes of org.testng.TestNGAntTask

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.