Package org.testng.internal

Examples of org.testng.internal.TestMethodWorker


    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

    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 (!processedClasses.contains(c)) {
          processedClasses.add(c);
          if (System.getProperty("experimental") != null) {
            List<List<IMethodInstance>> instances = createInstances(methodInstances);
            for (List<IMethodInstance> inst : instances) {
              TestMethodWorker worker = createTestMethodWorker(inst, params, c);
              result.add(worker);
            }
          }
          else {
            // Sequential class: all methods in one worker
            TestMethodWorker worker = createTestMethodWorker(methodInstances, params, c);
            result.add(worker);
          }
        }
      }
      else {
        // Parallel class: each method in its own worker
        TestMethodWorker worker = createTestMethodWorker(Arrays.asList(im), params, c);
        result.add(worker);
      }
    }

    // Sort by priorities
View Full Code Here

    for (Map.Entry<Object, List<ITestNGMethod>> es : lmm.getEntrySet()) {
      List<IMethodInstance> methodInstances = Lists.newArrayList();
      for (ITestNGMethod m : es.getValue()) {
        methodInstances.add(new MethodInstance(m));
      }
      TestMethodWorker tmw = new TestMethodWorker(m_invoker,
          methodInstances.toArray(new IMethodInstance[methodInstances.size()]),
          m_xmlTest.getSuite(),
          m_xmlTest.getAllParameters(),
          m_allTestMethods,
          m_groupMethods,
View Full Code Here

  }

  private TestMethodWorker createTestMethodWorker(
      List<IMethodInstance> methodInstances, Map<String, String> params,
      Class<?> c) {
    return new TestMethodWorker(m_invoker,
        findClasses(methodInstances, c),
        m_xmlTest.getSuite(),
        params,
        m_allTestMethods,
        m_groupMethods,
View Full Code Here

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

    for (MethodInstance mi : methodInstances) {
      workers.add(new TestMethodWorker(m_invoker,
                                       new MethodInstance[] { 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.