Package org.testng.internal

Examples of org.testng.internal.TestMethodWorker


    // All the sequential tests are place in one worker, guaranteeing they
    // will be invoked sequentially
    if (sequentialList.size() > 0) {
      for (List<ITestNGMethod> sl : sequentialList) {
       
        workers.add(new TestMethodWorker(m_invoker,
                                         methodsToMethodInstances(sl),
                                         m_xmlTest.getSuite(),
                                         params,
                                         beforeClassMethods,
                                         afterClassMethods,
                                         m_allTestMethods,
                                         m_groupMethods,
                                         cmm,
                                         this));
      }
    }

    // All the parallel tests are placed in a separate worker, so they can be
    // invoked in parallel
    if (parallelList.size() > 0) {
      for (ITestNGMethod tm : parallelList) {
//        MethodInstance mi = new MethodInstance(tm, tm.getTestClass().getInstances(true));
        MethodInstance[] methodInstances = methodsToMultipleMethodInstances(Arrays.asList(new ITestNGMethod[] {tm}));
        for (MethodInstance mi : methodInstances) {
          workers.add(new TestMethodWorker(m_invoker,
                                           new MethodInstance[] { mi },
                                           m_xmlTest.getSuite(),
                                           params,
                                           beforeClassMethods,
                                           afterClassMethods,
View Full Code Here


      }
      log(3, "===");
    }

    for (IMethodInstance mi : methodInstances) {
      workers.add(new TestMethodWorker(m_invoker,
                                       new IMethodInstance[] { mi },
                                       m_xmlTest.getSuite(),
                                       params,
                                       m_allTestMethods,
                                       m_groupMethods,
View Full Code Here

    if(sequentialList.isEmpty()) return;
   
    // All the sequential tests are place in one worker, guaranteeing they
    // will be invoked sequentially
    for (List<ITestNGMethod> sl : sequentialList) {       
      workers.add(new TestMethodWorker(m_invoker,
                                       methodsToMethodInstances(sl),
                                       m_xmlTest.getSuite(),
                                       params,
                                       m_allTestMethods,
                                       m_groupMethods,
View Full Code Here

        // If the current class is marked sequential, we want to run all its method
        // in one TestMethodWorker to guarantee a sequential order. Otherwise, we
        // create one worker per method
        if (sequentialClasses.contains(c)) {
          // Sequential class: all methods in one worker
          TestMethodWorker worker = new TestMethodWorker(m_invoker,
              s.toArray(new IMethodInstance[s.size()]),
              m_xmlTest.getSuite(),
              params,
              m_allTestMethods,
              m_groupMethods,
              m_classMethodMap,
              this);
          result.add(worker);
        }
        else {
          // Parallel class: each method in its own worker
          for (IMethodInstance imi : s) {
            TestMethodWorker worker = new TestMethodWorker(m_invoker,
                new IMethodInstance[] { imi },
                m_xmlTest.getSuite(),
                params,
                m_allTestMethods,
                m_groupMethods,
                m_classMethodMap,
                this);
            result.add(worker);
          }
        }
      }
    } else {
      Set<Class<?>> processedClasses = Sets.newHashSet();
      for (IMethodInstance im : methodInstances) {
        Class<?> c = im.getMethod().getTestClass().getRealClass();
        if (sequentialClasses.contains(c)) {
          if (!processedClasses.contains(c)) {
            processedClasses.add(c);
            // Sequential class: all methods in one worker
            TestMethodWorker worker = new TestMethodWorker(m_invoker,
                findClasses(methodInstances, c),
                m_xmlTest.getSuite(),
                params,
                m_allTestMethods,
                m_groupMethods,
                m_classMethodMap,
                this);
            result.add(worker);
          }
        }
        else {
          // Parallel class: each method in its own worker
            TestMethodWorker worker = new TestMethodWorker(m_invoker,
                new IMethodInstance[] { im },
                m_xmlTest.getSuite(),
                params,
                m_allTestMethods,
                m_groupMethods,
View Full Code Here

    // it until I'm sure the new implementation is working fine.
    // @deprecated
    if (XmlSuite.PARALLEL_CLASSES.equals(xmlTest.getParallel())) {
      Map<Class, Set<IMethodInstance>> list = groupMethodInstancesByClass(methodInstances);
      for (Set<IMethodInstance> s : list.values()) {
          workers.add(new TestMethodWorker(m_invoker,
              s.toArray(new IMethodInstance[s.size()]),
              m_xmlTest.getSuite(),
              params,
              m_allTestMethods,
              m_groupMethods,
              cmm,
              this));         
      }
    }
    else {
      for (IMethodInstance mi : methodInstances) {
        workers.add(new TestMethodWorker(m_invoker,
                                         new IMethodInstance[] { mi },
                                         m_xmlTest.getSuite(),
                                         params,
                                         m_allTestMethods,
                                         m_groupMethods,
View Full Code Here

    if(sequentialList.isEmpty()) return;
   
    // All the sequential tests are place in one worker, guaranteeing they
    // will be invoked sequentially
    for (List<ITestNGMethod> sl : sequentialList) {       
      workers.add(new TestMethodWorker(m_invoker,
                                       methodsToMethodInstances(sl),
                                       m_xmlTest.getSuite(),
                                       params,
                                       m_allTestMethods,
                                       m_groupMethods,
View Full Code Here

    MapList<Integer, TestMethodWorker> result = new MapList<Integer, TestMethodWorker>();
    // All the sequential tests are place in one worker, guaranteeing they
    // will be invoked sequentially
    for (Integer i : mapList.getKeys()) {
      result.put(i,
          new TestMethodWorker(m_invoker, methodsToMethodInstances(mapList.get(i)),
          m_xmlTest.getSuite(), params, m_allTestMethods, m_groupMethods, cmm, this));
    }

    if (getVerbose() >= 2) {
      log(3, "WILL BE RUN SEQUENTIALLY:" + result);
View Full Code Here

        // If the current class is marked sequential, we want to run all its method
        // in one TestMethodWorker to guarantee a sequential order. Otherwise, we
        // create one worker per method
        if (sequentialClasses.contains(c)) {
          // Sequential class: all methods in one worker
          TestMethodWorker worker = new TestMethodWorker(m_invoker,
              s.toArray(new IMethodInstance[s.size()]),
              m_xmlTest.getSuite(),
              params,
              m_allTestMethods,
              m_groupMethods,
              m_classMethodMap,
              this);
          result.add(worker);
        }
        else {
          // Parallel class: each method in its own worker
          for (IMethodInstance imi : s) {
            TestMethodWorker worker = new TestMethodWorker(m_invoker,
                new IMethodInstance[] { imi },
                m_xmlTest.getSuite(),
                params,
                m_allTestMethods,
                m_groupMethods,
                m_classMethodMap,
                this);
            result.add(worker);
          }
        }
      }
    } else {
      Set<Class<?>> processedClasses = Sets.newHashSet();
      for (IMethodInstance im : methodInstances) {
        Class<?> c = im.getMethod().getTestClass().getRealClass();
        if (sequentialClasses.contains(c)) {
          if (!processedClasses.contains(c)) {
            processedClasses.add(c);
            // Sequential class: all methods in one worker
            TestMethodWorker worker = new TestMethodWorker(m_invoker,
                findClasses(methodInstances, c),
                m_xmlTest.getSuite(),
                params,
                m_allTestMethods,
                m_groupMethods,
                m_classMethodMap,
                this);
            result.add(worker);
          }
        }
        else {
          // Parallel class: each method in its own worker
            TestMethodWorker worker = new TestMethodWorker(m_invoker,
                new IMethodInstance[] { im },
                m_xmlTest.getSuite(),
                params,
                m_allTestMethods,
                m_groupMethods,
View Full Code Here

    // it until I'm sure the new implementation is working fine.
    // @deprecated
    if (XmlSuite.PARALLEL_CLASSES.equals(xmlTest.getParallel())) {
      Map<Class, Set<IMethodInstance>> list = groupMethodInstancesByClass(methodInstances);
      for (Set<IMethodInstance> s : list.values()) {
          workers.add(new TestMethodWorker(m_invoker,
              s.toArray(new IMethodInstance[s.size()]),
              m_xmlTest.getSuite(),
              params,
              m_allTestMethods,
              m_groupMethods,
              cmm,
              this));         
      }
    }
    else {
      for (IMethodInstance mi : methodInstances) {
        workers.add(new TestMethodWorker(m_invoker,
                                         new IMethodInstance[] { mi },
                                         m_xmlTest.getSuite(),
                                         params,
                                         m_allTestMethods,
                                         m_groupMethods,
View Full Code Here

    if(sequentialList.isEmpty()) return;
   
    // All the sequential tests are place in one worker, guaranteeing they
    // will be invoked sequentially
    for (List<ITestNGMethod> sl : sequentialList) {       
      workers.add(new TestMethodWorker(m_invoker,
                                       methodsToMethodInstances(sl),
                                       m_xmlTest.getSuite(),
                                       params,
                                       m_allTestMethods,
                                       m_groupMethods,
View Full Code Here

TOP

Related Classes of org.testng.internal.TestMethodWorker

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.