@Override public int getPriority() { if (m_allTestMethods.length == 1) { return m_allTestMethods[0].getPriority(); } else { return 0; } }
@Override public int getPriority() { return m_method.getPriority(); }
@Override public int getPriority() { return testNGMethod.getPriority(); }
@Override public int getPriority() { if (m_allTestMethods.length == 1) { return m_allTestMethods[0].getPriority(); } else { return 0; } }
@Override public int getPriority() { return m_method.getPriority(); }
@Override public int getPriority() { return testNGMethod.getPriority(); }
@Override public int compare(ITestResult o1, ITestResult o2) { return Integer.compare(o1.getMethod().getPriority(), o2.getMethod().getPriority()); } });
/** * The priority of a worker is the priority of the first method it's going to run. */ @Override public int getPriority() { return m_methodInstances.size() > 0 ? m_methodInstances.get(0).getMethod().getPriority() : 0; } }
private static Collection<ITestResult> sort(Set<ITestResult> results) { List<ITestResult> sortedResults = new ArrayList<>(results); sortedResults.sort(Comparator.comparingInt(o -> o.getMethod().getPriority())); return Collections.unmodifiableList(sortedResults); }
/** The priority of a worker is the priority of the first method it's going to run. */ @Override public int getPriority() { return m_methodInstances.size() > 0 ? m_methodInstances.get(0).getMethod().getPriority() : 0; }
public static int compareStatic(ITestNGMethod o1, ITestNGMethod o2) { int prePriDiff = o1.getInterceptedPriority() - o2.getInterceptedPriority(); if (prePriDiff != 0) { return prePriDiff; } int priDiff = o1.getPriority() - o2.getPriority(); if (priDiff != 0) { return priDiff; } return o1.getMethodName().compareTo(o2.getMethodName()); } }
Arrays.stream(interceptedOrder).anyMatch(m -> m.getPriority() != 0); Comparator<ITestNGMethod> methodComparator = needPrioritySort ? new TestMethodComparator() : null; graph.setVisualisers(this.visualisers);
methodsByPriority.put(method.getPriority(), method);
methodsByPriority.put(method.getPriority(), method); graph.addNode(method);
@Override public int getPriority() { return delegate.getPriority(); }
@Override public int getPriority() { return delegate.getPriority(); }
@Override public int getPriority() { return method.getPriority(); }
private static String adjustTestName(ITestNGMethod m) { String testName = Configuration.get(Configuration.Parameter.TEST_NAMING_PATTERN); testName = testName.replace(SpecialKeywords.METHOD_NAME, m.getMethodName()); testName = testName.replace(SpecialKeywords.METHOD_PRIORITY, String.valueOf(m.getPriority())); testName = testName.replace(SpecialKeywords.METHOD_THREAD_POOL_SIZE, String.valueOf(m.getThreadPoolSize())); if (m.getDescription() != null) { testName = testName.replace(SpecialKeywords.METHOD_DESCRIPTION, m.getDescription()); } else { testName = testName.replace(SpecialKeywords.METHOD_DESCRIPTION, ""); } return testName; }
private static String adjustTestName(ITestNGMethod m) { String testName = Configuration.get(Configuration.Parameter.TEST_NAMING_PATTERN); testName = testName.replace(SpecialKeywords.METHOD_NAME, m.getMethodName()); testName = testName.replace(SpecialKeywords.METHOD_PRIORITY, String.valueOf(m.getPriority())); testName = testName.replace(SpecialKeywords.METHOD_THREAD_POOL_SIZE, String.valueOf(m.getThreadPoolSize())); if (m.getDescription() != null) { testName = testName.replace(SpecialKeywords.METHOD_DESCRIPTION, m.getDescription()); } else { testName = testName.replace(SpecialKeywords.METHOD_DESCRIPTION, ""); } return testName; }
private boolean isPriorityUnique(IInvokedMethod method) { // Logic to check priorities of all test methods are unique. This is used in Session Sharing. Set<Integer> check = new HashSet<Integer>(); int length = method.getTestMethod().getTestClass().getTestMethods().length; int expectedSize = 0; for (int i = 0; i < length; i++) { //ignore @Test(enabled = false) methods if (!method.getTestMethod().getTestClass().getTestMethods()[i].getEnabled()) { continue; } check.add(method.getTestMethod().getTestClass().getTestMethods()[i].getPriority()); expectedSize += 1; if (check.size() != expectedSize) { return false; } } return true; }