Example #1
0
 public TCKRunner() {
   setName("JSR363-TCK 0.1");
   XmlTest test = new XmlTest(this);
   test.setName("TCK/Test Setup");
   List<XmlClass> classes = new ArrayList<>();
   classes.add(new XmlClass(TCKSetup.class));
   test.setXmlClasses(classes);
 }
  private XmlSuite createXmlSuite() {
    XmlSuite result = new XmlSuite();
    result.setName(getDefaultSuiteName());
    XmlTest test = new XmlTest(result);
    test.setName(getDefaultTestName());

    updateXmlSuite(result);

    return result;
  }
Example #3
0
  protected XmlTest createXmlTest(XmlSuite suite, String name, String... classes) {
    XmlTest result = new XmlTest(suite);
    int index = 0;
    result.setName(name);
    for (String c : classes) {
      XmlClass xc = new XmlClass(c, index++, true /* load classes */);
      result.getXmlClasses().add(xc);
    }

    return result;
  }
Example #4
0
  private XmlSuite createSuite(String name, Class[] classes) {
    XmlSuite result = new XmlSuite();
    result.setName(name);

    for (Class c : classes) {
      XmlTest test1 = new XmlTest(result);
      test1.setName(c.getName());
      XmlClass class1 = new XmlClass(c);
      test1.getXmlClasses().add(class1);
    }

    return result;
  }
Example #5
0
 /** Generate testng-failed.xml */
 private void createXmlTest(
     ITestContext context, List<ITestNGMethod> methods, XmlTest srcXmlTest) {
   XmlTest xmlTest = new XmlTest(m_xmlSuite);
   xmlTest.setName(context.getName() + "(failed)");
   xmlTest.setBeanShellExpression(srcXmlTest.getExpression());
   xmlTest.setIncludedGroups(srcXmlTest.getIncludedGroups());
   xmlTest.setExcludedGroups(srcXmlTest.getExcludedGroups());
   xmlTest.setParallel(srcXmlTest.getParallel());
   xmlTest.setParameters(srcXmlTest.getLocalParameters());
   xmlTest.setJUnit(srcXmlTest.isJUnit());
   List<XmlClass> xmlClasses = createXmlClasses(methods, srcXmlTest);
   xmlTest.setXmlClasses(xmlClasses);
 }
 /**
  * Returns this test as a TestNG XmlTest
  *
  * @param suite
  * @param loadClasses whether to load classes when creating the XmlTest
  * @return this test as TestNG XmlTest
  */
 public XmlTest getTestAsXmlTest(XmlSuite suite, boolean loadClasses) {
   XmlTest xmltest = new XmlTest(suite);
   xmltest.setName(this.id + "." + this.name); // set name like
   // "<id>.<name>"
   // add parameters to this test case
   Properties params = this.getParametersAsProperties();
   for (Enumeration<?> e = params.keys(); e.hasMoreElements(); ) {
     String key = (String) e.nextElement();
     xmltest.addParameter(key, params.getProperty(key));
   }
   // add test classes
   xmltest.setXmlClasses(this.getXmlClasses(loadClasses));
   return xmltest;
 }
Example #7
0
 /** Constructor. */
 public TCKRunner() {
   setName("JSR354-TCK, version 1.1");
   XmlTest test = new XmlTest(this);
   test.setName("TCK/Test Setup");
   List<XmlClass> classes = new ArrayList<>();
   classes.add(new XmlClass(TCKTestSetup.class));
   classes.add(new XmlClass(ModellingCurrenciesTest.class));
   classes.add(new XmlClass(ModellingMonetaryAmountsTest.class));
   classes.add(new XmlClass(CreatingMonetaryAmountsTest.class));
   classes.add(new XmlClass(ExternalizingNumericValueTest.class));
   classes.add(new XmlClass(FunctionalExtensionPointsTest.class));
   classes.add(new XmlClass(AccessingCurrenciesAmountsRoundingsTest.class));
   classes.add(new XmlClass(MonetaryConversionsTest.class));
   classes.add(new XmlClass(ExchangeRatesAndRateProvidersTest.class));
   classes.add(new XmlClass(ConvertingAmountsTest.class));
   classes.add(new XmlClass(ProviderChainsTest.class));
   classes.add(new XmlClass(FormattingMonetaryAmountsTest.class));
   test.setXmlClasses(classes);
 }
Example #8
0
  /**
   * Clone the <TT>source</TT> <CODE>XmlTest</CODE> by including: - test attributes - groups
   * definitions - parameters
   *
   * <p>The &lt;classes&gt; sub element is ignored for the moment.
   *
   * @return a clone of the current XmlTest
   */
  @Override
  public Object clone() {
    XmlTest result = new XmlTest(getSuite());

    result.setName(getName());
    result.setIncludedGroups(getIncludedGroups());
    result.setExcludedGroups(getExcludedGroups());
    result.setJUnit(isJUnit());
    result.setParallel(getParallel());
    result.setVerbose(getVerbose());
    result.setParameters(getParameters());
    result.setXmlPackages(getXmlPackages());

    Map<String, List<String>> metagroups = getMetaGroups();
    for (Map.Entry<String, List<String>> group : metagroups.entrySet()) {
      result.addMetaGroup(group.getKey(), group.getValue());
    }

    return result;
  }