public Boolean getAllowReturnValues() { if (m_allowReturnValues != null) return m_allowReturnValues; else return getSuite().getAllowReturnValues(); }
public int getThreadCount() { return m_threadCount > 0 ? m_threadCount : getSuite().getThreadCount(); }
public Boolean getPreserveOrder() { if (m_preserveOrder == null) { return getSuite().getPreserveOrder(); } return m_preserveOrder; }
/** * @return the parameters defined in this test tag and the tags above it. */ public Map<String, String> getAllParameters() { Map<String, String> result = Maps.newHashMap(); result.putAll(getSuite().getParameters()); result.putAll(m_parameters); return result; }
/** @return Returns the verbose. */ public int getVerbose() { Integer result = m_verbose; if (null == result || XmlSuite.DEFAULT_VERBOSE.equals(m_verbose)) { result = getSuite().getVerbose(); } if (null != result) { return result; } else { return 1; } }
public boolean getGroupByInstances() { Boolean result = m_groupByInstances; if (result == null || XmlSuite.DEFAULT_GROUP_BY_INSTANCES.equals(m_groupByInstances)) { result = getSuite().getGroupByInstances(); } if (result != null) { return result; } else { return XmlSuite.DEFAULT_GROUP_BY_INSTANCES; } }
/** @return Returns the isJUnit. */ public boolean isJUnit() { Boolean result = m_isJUnit; if (null == result || XmlSuite.DEFAULT_JUNIT.equals(result)) { result = getSuite().isJUnit(); } return result; }
public String getParameter(String name) { String result = m_parameters.get(name); if (null == result) { result = getSuite().getParameter(name); } return result; }
public XmlSuite.ParallelMode getParallel() { XmlSuite.ParallelMode result = getSuite().getParallel(); if (null != m_parallel) { result = m_parallel; } return result; }
public String getTimeOut() { String result = getSuite().getTimeOut(); if (null != m_timeOut) { result = m_timeOut; } return result; }
/** @return Returns the isJUnit. */ public boolean skipFailedInvocationCounts() { Boolean result = m_skipFailedInvocationCounts; if (null == result) { result = getSuite().skipFailedInvocationCounts(); } return result; }
/** @return the parameters defined in this test tag and the tags above it. */ public Map<String, String> getAllParameters() { Map<String, String> result = Maps.newHashMap(); result.putAll(getSuite().getParameters()); result.putAll(m_parameters); return result; }
public List<String> getExcludedGroups() { List<String> result = new ArrayList<>(); if (m_xmlGroups != null && m_xmlGroups.getRun() != null) { result.addAll(m_xmlGroups.getRun().getExcludes()); } result.addAll(getSuite().getExcludedGroups()); return Collections.unmodifiableList(result); }
/** @return the includedGroups. */ public List<String> getIncludedGroups() { List<String> result = Lists.newArrayList(); if (m_xmlGroups != null && m_xmlGroups.getRun() != null) { result.addAll(m_xmlGroups.getRun().getIncludes()); } result.addAll(getSuite().getIncludedGroups()); return Collections.unmodifiableList(result); }
private void afterRun() { // invoke @AfterTest ITestNGMethod[] testConfigurationMethods= getAfterTestConfigurationMethods(); if(null != testConfigurationMethods && testConfigurationMethods.length > 0) { m_invoker.invokeConfigurations(null, testConfigurationMethods, m_xmlTest.getSuite(), m_xmlTest.getAllParameters(), null, /* no parameter values */ null /* instance */); } // // Log the end date // m_endDate = new Date(System.currentTimeMillis()); dumpInvokedMethods(); // Invoke listeners fireEvent(false /*stop*/); }
/** Before run preparements. */ private void beforeRun() { // // Log the start date // m_startDate = new Date(System.currentTimeMillis()); // Log start logStart(); // Invoke listeners fireEvent(true /*start*/); // invoke @BeforeTest ITestNGMethod[] testConfigurationMethods= getBeforeTestConfigurationMethods(); if(null != testConfigurationMethods && testConfigurationMethods.length > 0) { m_invoker.invokeConfigurations(null, testConfigurationMethods, m_xmlTest.getSuite(), m_xmlTest.getAllParameters(), null, /* no parameter values */ null /* instance */); } }
protected void addPackage(String pkgName, String[] included, String[] excluded) { XmlPackage pkg= new XmlPackage(); pkg.setName(pkgName); pkg.getInclude().addAll(Arrays.asList(included)); pkg.getExclude().addAll(Arrays.asList(excluded)); getTest().getSuite().getXmlPackages().add(pkg); }
private static TestMethodWorker createTestMethodWorker(Arguments attributes, List<IMethodInstance> methodInstances, Map<String, String> params, Class<?> c) { return new TestMethodWorker(attributes.getInvoker(), findClasses(methodInstances, c), attributes.getTestContext().getCurrentXmlTest().getSuite(), params, attributes.getConfigMethods(), attributes.getClassMethodMap(), attributes.getTestContext(), attributes.getListeners()); }
private void invokeTestConfigurations(ITestNGMethod[] testConfigurationMethods) { if (null != testConfigurationMethods && testConfigurationMethods.length > 0) { ConfigMethodArguments arguments = new Builder() .usingConfigMethodsAs(testConfigurationMethods) .forSuite(m_xmlTest.getSuite()) .usingParameters(m_xmlTest.getAllParameters()) .build(); m_invoker.getConfigInvoker().invokeConfigurations(arguments); } }
@Override public List<IWorker<ITestNGMethod>> createWorkers(Arguments arguments) { ListMultiMap<Object, ITestNGMethod> lmm = Maps.newSortedListMultiMap(); for (ITestNGMethod m : arguments.getMethods()) { lmm.put(m.getInstance(), m); } List<IWorker<ITestNGMethod>> result = Lists.newArrayList(); for (Map.Entry<Object, List<ITestNGMethod>> es : lmm.entrySet()) { List<IMethodInstance> methodInstances = MethodHelper.methodsToMethodInstances(es.getValue()); TestMethodWorker tmw = new TestMethodWorker(arguments.getInvoker(), methodInstances, arguments.getTestContext().getCurrentXmlTest().getSuite(), arguments.getTestContext().getCurrentXmlTest().getAllParameters(), arguments.getConfigMethods(), arguments.getClassMethodMap(), arguments.getTestContext(), arguments.getListeners()); result.add(tmw); } return result; } }