Package org.testng.xml

Examples of org.testng.xml.XmlInclude


      XmlTest test = new XmlTest(suite);
      test.setName("Arquillian - " + className);
      List<XmlClass> testClasses = new ArrayList<XmlClass>();
      XmlClass testClass = new XmlClass(className);
      testClass.getIncludedMethods().add(new XmlInclude(methodName));
      testClasses.add(testClass);
      test.setXmlClasses(testClasses);
      return suite;
   }
View Full Code Here


      // @author Borojevic
      // Need to check all the methods, not just @Test ones.
      XmlClass xmlClass= new XmlClass(clazz.getName(), Boolean.FALSE);
      List<XmlInclude> methodNames= Lists.newArrayList(methodList.size());
      for(ITestNGMethod m: methodList) {
        methodNames.add(new XmlInclude(m.getMethod().getName(), m.getFailedInvocationNumbers()));
      }
      xmlClass.setIncludedMethods(methodNames);
      result.add(xmlClass);
     
    }
View Full Code Here

      XmlTest test = new XmlTest(suite);
      test.setName("Arquillian - " + className);
      List<XmlClass> testClasses = new ArrayList<XmlClass>();
      XmlClass testClass = new XmlClass(className);
      testClass.getIncludedMethods().add(new XmlInclude(methodName));
      testClasses.add(testClass);
      test.setXmlClasses(testClasses);
      return suite;
   }
View Full Code Here

        c1.getLocalParameters().put("a", "Correct");
      }
      t.getXmlClasses().add(c1);

      for (String method : new String[] { "f", "g" }) {
        XmlInclude include1 = new XmlInclude(method);
        if (status == S.PASS_INCLUDE) {
          include1.getLocalParameters().put("a", "Correct");
        }
        include1.setXmlClass(c1);
        c1.getIncludedMethods().add(include1);
      }

    }
View Full Code Here

  @Test(description = "Fix for https://github.com/cbeust/testng/issues/90")
  public void afterClassShouldRun() {
    XmlSuite s = createXmlSuite("Bug90");
    XmlTest t = createXmlTest(s, "Bug90 test", Sample.class.getName());
    XmlClass c = t.getClasses().get(0);
    c.setIncludedMethods(Arrays.asList(new XmlInclude("test1")));
    TestNG tng = create();
    tng.setXmlSuites(Arrays.asList(s));
    Sample.m_afterClassWasRun = false;
    tng.run();
View Full Code Here

    XmlSuite s = createXmlSuite("s");
    XmlTest t = createXmlTest(s, "t");

    {
      XmlClass c1 = new XmlClass(Shadow1SampleTest.class.getName());
      XmlInclude include1 = new XmlInclude("test1");
      include1.setXmlClass(c1);
      c1.getLocalParameters().put("a", "First");
      c1.getIncludedMethods().add(include1);
      t.getXmlClasses().add(c1);
    }

    {
      XmlClass c2 = new XmlClass(Shadow2SampleTest.class.getName());
      XmlInclude include2 = new XmlInclude("test2");
      include2.setXmlClass(c2);
      c2.getLocalParameters().put("a", "Second");
      c2.getIncludedMethods().add(include2);
      t.getXmlClasses().add(c2);
    }
View Full Code Here

      for (ITestNGMethod m : methodClosure) {
        String methodName =
         m.getMethod().getDeclaringClass().getName() + "." + m.getMethodName();
//        m_includedMethods.add(methodName);
        List<XmlInclude> includeList = m_includedMethods.get(methodName);
        XmlInclude xi = new XmlInclude(methodName);
        // TODO: set the XmlClass on this xi or we won't get inheritance of parameters
        m_includedMethods.put(methodName, xi);
        logInclusion("Including", "method ", methodName);
      }
    }
View Full Code Here

    for (XmlClass xc : xmlClasses) {
      for (String m : commandLineMethods) {
        String[] split = splitMethod(m);
        String className = split[0];
        if (xc.getName().equals(className)) {
          XmlInclude includedMethod = new XmlInclude(split[1]);
          xc.getIncludedMethods().add(includedMethod);
        }
      }
    }
View Full Code Here

  @Test
  public void afterClassShouldRun() {
    XmlSuite s = createXmlSuite("S");
    XmlTest t = createXmlTest(s, "T", Main.class.getName());
    XmlClass c = t.getXmlClasses().get(0);
    c.getIncludedMethods().add(new XmlInclude("test1"));
    t.setPreserveOrder("true");
    TestNG tng = create();
    tng.setXmlSuites(Arrays.asList(new XmlSuite[] { s }));
    Main.m_passed = false;
    tng.run();
View Full Code Here

  }

  protected void addMethods(XmlClass cls, String... methods) {
    int index = 0;
    for (String m : methods) {
      XmlInclude include = new XmlInclude(m, index++);
      cls.getIncludedMethods().add(include);
    }
  }
View Full Code Here

TOP

Related Classes of org.testng.xml.XmlInclude

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.