private void updateXmlSuite(XmlSuite suite) {
   p("Updating XML suite");
   XmlTest test = suite.getTests().get(0);
   test.getXmlClasses().clear();
   test.getXmlPackages().clear();
   if (m_selectionCombo.getSelectionIndex() == 0) {
     test.getXmlClasses().addAll(m_classes);
   } else {
     test.getXmlPackages().addAll(m_packages);
   }
   p("Done updating XML suite");
 }
Esempio n. 2
0
  private static void toYaml(StringBuilder result, String sp, XmlTest t) {
    String sp2 = sp + "  ";
    result.append(sp).append("- name: ").append(t.getName()).append("\n");

    maybeAdd(result, sp2, "junit", t.isJUnit(), XmlSuite.DEFAULT_JUNIT);
    maybeAdd(result, sp2, "verbose", t.getVerbose(), XmlSuite.DEFAULT_VERBOSE);
    maybeAdd(result, sp2, "timeOut", t.getTimeOut(), null);
    maybeAdd(result, sp2, "parallel", t.getParallel(), XmlSuite.DEFAULT_PARALLEL);
    maybeAdd(
        result,
        sp2,
        "skipFailedInvocationCounts",
        t.skipFailedInvocationCounts(),
        XmlSuite.DEFAULT_SKIP_FAILED_INVOCATION_COUNTS);

    maybeAdd(result, "preserveOrder", sp2, t.getPreserveOrder(), XmlSuite.DEFAULT_PRESERVE_ORDER);

    toYaml(result, "parameters", sp2, t.getTestParameters());

    if (t.getIncludedGroups().size() > 0) {
      result
          .append(sp2)
          .append("includedGroups: [ ")
          .append(Utils.join(t.getIncludedGroups(), ","))
          .append(" ]\n");
    }

    if (t.getExcludedGroups().size() > 0) {
      result
          .append(sp2)
          .append("excludedGroups: [ ")
          .append(Utils.join(t.getExcludedGroups(), ","))
          .append(" ]\n");
    }

    Map<String, List<String>> mg = t.getMetaGroups();
    if (mg.size() > 0) {
      result.append(sp2).append("metaGroups: { ");
      boolean first = true;
      for (String group : mg.keySet()) {
        if (!first) result.append(", ");
        result.append(group).append(": [ ").append(Utils.join(mg.get(group), ",")).append(" ] ");
        first = false;
      }
      result.append(" }\n");
    }

    if (t.getXmlPackages().size() > 0) {
      result.append(sp2).append("xmlPackages:\n");
      for (XmlPackage xp : t.getXmlPackages()) {
        toYaml(result, sp2 + "  - ", xp);
      }
    }

    if (t.getXmlClasses().size() > 0) {
      result.append(sp2).append("classes:\n");
      for (XmlClass xc : t.getXmlClasses()) {
        toYaml(result, sp2 + "  ", xc);
      }
    }

    result.append("\n");
  }