Examples of ITestNGMethod


Examples of org.testng.ITestNGMethod

    //
    List<TestMethodWorker> workers= new ArrayList<TestMethodWorker>();   
    List<ITestNGMethod> clones= new ArrayList<ITestNGMethod>(testMethod.getInvocationCount());
   
    for (int i = 0; i < testMethod.getInvocationCount(); i++) {
      ITestNGMethod clonedMethod= testMethod.clone();
      clonedMethod.setInvocationCount(1);
      clonedMethod.setThreadPoolSize(1);
      clones.add(clonedMethod);
      MethodInstance mi = new MethodInstance(clonedMethod, clonedMethod.getTestClass().getInstances(true));
      workers.add(new SingleTestMethodWorker(this,
          mi,
          suite,
          parameters,
          allTestMethods,
View Full Code Here

Examples of org.testng.ITestNGMethod

                                      boolean isAfterTestMethod,
                                      String[] beforeGroups,
                                      String[] afterGroups)
  {
    if(method.getDeclaringClass().isAssignableFrom(clazz)) {
      ITestNGMethod confMethod = new ConfigurationMethod(method,
                                                         m_annotationFinder,
                                                         isBeforeSuite,
                                                         isAfterSuite,
                                                         isBeforeTest,
                                                         isAfterTest,
View Full Code Here

Examples of org.testng.ITestNGMethod

        // Depends on methods?
        // Adds all depended methods to runningMethods
        //
        String[] mdu = m.getMethodsDependedUpon();
        for (String tm : mdu) {
          ITestNGMethod thisMethod = findMethodNamed(tm, allMethods);
          if (thisMethod != null && ! runningMethods.containsKey(thisMethod)) {
            runningMethods.put(thisMethod, thisMethod);
            newMethods.put(thisMethod, thisMethod);
          }
        }
View Full Code Here

Examples of org.testng.ITestNGMethod

    // Fix the method inheritance if these are @Configuration methods to make
    // sure base classes are invoked before child classes if 'before' and the
    // other
    // way around if they are 'after'
    if (!forTests && allMethodsArray.length > 0) {
      ITestNGMethod m = allMethodsArray[0];
      boolean before = m.isBeforeClassConfiguration()
          || m.isBeforeMethodConfiguration() || m.isBeforeSuiteConfiguration()
          || m.isBeforeTestConfiguration();
      MethodInheritance.fixMethodInheritance(allMethodsArray, before);
    }

    topologicalSort(allMethodsArray, sl, pl);
View Full Code Here

Examples of org.testng.ITestNGMethod

        sortMethodsByInheritance(l, baseClassToChild);
       
        // Set methodDependedUpon accordingly
        if (baseClassToChild) {
          for (int i = 1; i < l.size(); i++) {
            ITestNGMethod m1 = l.get(i - 1);
            ITestNGMethod m2 = l.get(i);
            if (! equalsEffectiveClass(m1, m2)) {
              Utils.log("MethodInheritance", 4, m2 + " DEPENDS ON " + m1);
              m2.addMethodDependedUpon(MethodHelper.calculateMethodCanonicalName(m1));
            }
          }
        }
        else {
          for (int i = 0; i < l.size() - 1; i++) {
            ITestNGMethod m1 = l.get(i);
            ITestNGMethod m2 = l.get(i + 1);
            if (! equalsEffectiveClass(m1, m2)) {
              m2.addMethodDependedUpon(MethodHelper.calculateMethodCanonicalName(m1));
              Utils.log("MethodInheritance", 4, m2 + " DEPENDS ON " + m1);
            }
          }         
        }
      }
View Full Code Here

Examples of org.testng.ITestNGMethod

                continue;
              }
             
              String key = createMethodKey(m);
              if (null == vResult.get(key)) {
                ITestNGMethod tm = new TestNGMethod(/* m.getDeclaringClass(), */ m, annotationFinder);
                vResult.put(key,tm);
              }
            }
          } // for
          // Now explore the superclass
View Full Code Here

Examples of org.testng.ITestNGMethod

public class TestNGAop implements IMethodInterceptor {

    @Override
    public List<IMethodInstance> intercept(List<IMethodInstance> methods, ITestContext context) {
        for (IMethodInstance methodIns : methods) {
            ITestNGMethod method = methodIns.getMethod();
            ConstructorOrMethod meth = method.getConstructorOrMethod();
            Method m = meth.getMethod();
            if (m != null) {
                DB db = m.getAnnotation(DB.class);
                if (db != null) {
                    Transaction txn = Transaction.open(m.getName());
View Full Code Here

Examples of org.testng.ITestNGMethod

  /**
   * Add beforeMethod, method, afterMethod
   */
  private void addTestOperation(Operation o) {
    ITestNGMethod method = o.getMethod();
    ITestClass testClass = method.getTestClass();
    if (! m_classesSeen.contains(testClass)) {
      m_classesSeen.add(testClass);
      addMethods(testClass.getBeforeClassMethods(), o.getAffinity(),
          m_operations.size());
    }
   
    String[] groups = method.getGroups();
    for (String group : groups) {
      if (! m_groupsSeen.contains(group)) {
        List<ITestNGMethod> beforeMethods
          = m_groupMethods.getBeforeGroupsMap().get(group);
        if (beforeMethods != null) {
View Full Code Here

Examples of org.testng.ITestNGMethod

     
      // Get the transitive closure of all the failed methods and the methods
      // they depend on
      Collection<ITestResult> tests = failedTests.isEmpty() ? skippedTests : failedTests;
      for (ITestResult failedTest : tests) {
        ITestNGMethod current = failedTest.getMethod();
        if (current.isTest()) {
          methodsToReRun.put(current, current);
          ITestNGMethod method = failedTest.getMethod();
          // Don't count configuration methods
          if (method.isTest()) {
            List<ITestNGMethod> methodsDependedUpon = MethodHelper.getMethodsDependedUpon(method, context.getAllTestMethods());
           
            for (ITestNGMethod m : methodsDependedUpon) {
              if (m.isTest()) {
                methodsToReRun.put(m, m);
View Full Code Here

Examples of org.testng.ITestNGMethod

   
    for (ITestResult tr : tests) {
      sb.append("<tr>\n");

      // Test method
      ITestNGMethod method = tr.getMethod();

      String fqName = Utils.detailedMethodName(method, false);
      sb.append("<td title='").append(tr.getTestClass().getName()).append(".").append(tr.getName()).append("()'>").append(fqName);
     
      // Method description
      if (! Utils.isStringEmpty(method.getDescription())) {
        sb.append("<br/><b>").append(method.getDescription()).append("</b>");
      }
     
      Object[] parameters = tr.getParameters();
      if (parameters != null && parameters.length > 0) {
        sb.append("<br/><b>Parameters:</b> ");
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.