/** * Since the methods will be sorted chronologically, we want to return * the ITestNGMethod from the invoked methods. */ private Collection<ITestNGMethod> getMethodSet(IResultMap tests, ISuite suite) { List<IInvokedMethod> r = Lists.newArrayList(); List<IInvokedMethod> invokedMethods = suite.getAllInvokedMethods(); for (IInvokedMethod im : invokedMethods) { if (tests.getAllMethods().contains(im.getTestMethod())) { r.add(im); } } Arrays.sort(r.toArray(new IInvokedMethod[r.size()]), new TestSorter()); List<ITestNGMethod> result = Lists.newArrayList(); // Add all the invoked methods for (IInvokedMethod m : r) { result.add(m.getTestMethod()); } // Add all the methods that weren't invoked (e.g. skipped) that we // haven't added yet for (ITestNGMethod m : tests.getAllMethods()) { if (!result.contains(m)) { result.add(m); } } return result; }
bw.append("<small><i>(Hover the method name to see the test class name)</i></small><p/>\n"); Collection<IInvokedMethod> invokedMethods = suite.getAllInvokedMethods(); if (alphabetical) { @SuppressWarnings({"unchecked"})
/** * Since the methods will be sorted chronologically, we want to return the ITestNGMethod from the * invoked methods. */ private Collection<ITestNGMethod> getMethodSet(IResultMap tests, ISuite suite) { List<IInvokedMethod> r = Lists.newArrayList(); List<IInvokedMethod> invokedMethods = suite.getAllInvokedMethods(); for (IInvokedMethod im : invokedMethods) { if (tests.getAllMethods().contains(im.getTestMethod())) { r.add(im); } } Arrays.sort(r.toArray(new IInvokedMethod[r.size()]), new TestSorter()); List<ITestNGMethod> result = Lists.newArrayList(); // Add all the invoked methods for (IInvokedMethod m : r) { result.add(m.getTestMethod()); } // Add all the methods that weren't invoked (e.g. skipped) that we // haven't added yet for (ITestNGMethod m : tests.getAllMethods()) { if (!result.contains(m)) { result.add(m); } } return result; }
@Override public void generateReport(List<XmlSuite> xmlSuites, List<ISuite> suites, String outputDirectory) { Assert.assertEquals(suites.size(), 1); ISuite suite = suites.get(0); List<IInvokedMethod> invoked = suite.getAllInvokedMethods(); Assert.assertEquals(invoked.size(), m_included.length); for (String s : m_included) { Assert.assertTrue(containsInvokedMethod(invoked, s)); } Collection<ITestNGMethod> excluded = suite.getExcludedMethods(); Assert.assertEquals(excluded.size(), m_excluded.length); for (String s : m_excluded) { Assert.assertTrue(containsMethod(excluded, s)); } }
bw.append("<small><i>(Hover the method name to see the test class name)</i></small><p/>\n"); List<IInvokedMethod> invokedMethods = suite.getAllInvokedMethods(); if (alphabetical) { invokedMethods.sort(Comparator.comparing(o -> o.getTestMethod().getMethodName()));
@AfterClass public void afterClass(ITestContext context) { ITestResult result = context.getSuite().getAllInvokedMethods().get(0).getTestResult(); endTimestamp = result.getEndMillis(); endStatus = ITestResult.SUCCESS; } }
@Override public void generateReport(List<XmlSuite> xmlSuites, List<ISuite> suites, String outDir) { suites.stream() .flatMap(suite -> suite.getResults().values().stream()) .flatMap(suiteResult -> suiteResult.getTestContext().getSkippedTests().getAllResults().stream()) .forEach(this::generateReport); suites.stream() .flatMap(iSuite -> iSuite.getAllInvokedMethods().stream()) .collect(Collectors.toList()) .forEach(im -> { results.put(im.getTestMethod().getMethodName(), im.getTestResult().getStatus()); }); }
private static Throwable getConfigFailureException(ITestContext context) { for (IInvokedMethod method : context.getSuite().getAllInvokedMethods()) { ITestNGMethod m = method.getTestMethod(); if (m.isBeforeSuiteConfiguration() && (!method.getTestResult().isSuccess())) { return method.getTestResult().getThrowable(); } } return null; }
@BeforeClass public void beforeClass(ITestContext context) throws InterruptedException { TimeUnit.SECONDS.sleep(1); ITestResult result = context.getSuite().getAllInvokedMethods().get(0).getTestResult(); startStatus = result.getStatus(); startTimestamp = result.getEndMillis(); }
@Override public void generateReport(List<XmlSuite> xmlSuites, List<ISuite> suites, String outputDirectory) { for (ISuite suite : suites) { for (IInvokedMethod method : suite.getAllInvokedMethods()) { names.add(method.getTestResult().getName()); testNames.add(method.getTestResult().getTestName()); } } }
private static Throwable getConfigFailureException(ITestContext context) { for (IInvokedMethod method : context.getSuite().getAllInvokedMethods()) { ITestNGMethod m = method.getTestMethod(); if (m.isBeforeSuiteConfiguration() && (!method.getTestResult().isSuccess())) { return method.getTestResult().getThrowable(); } } return null; } }
@Override public String getContent(ISuite suite, XMLStringBuffer main) { XMLStringBuffer xsb = new XMLStringBuffer(main.getCurrentIndent()); List<IInvokedMethod> invokedMethods = suite.getAllInvokedMethods();
@Override public String getContent(ISuite suite, XMLStringBuffer main) { XMLStringBuffer xsb = new XMLStringBuffer(main.getCurrentIndent()); List<IInvokedMethod> invokedMethods = suite.getAllInvokedMethods();
if (suite != null && suite.getAllInvokedMethods().size() < suite.getAllMethods().size()) { for (ITestNGMethod ngMethod : suite.getAllMethods()) { if (ngMethod.isTest()) { boolean methodInvoked = false; for (IInvokedMethod invokedMethod : suite.getAllInvokedMethods()) { if (invokedMethod.getTestMethod() == ngMethod) { methodInvoked = true;
List<IInvokedMethod> invoked = suite.getAllInvokedMethods(); Map<String, Tuple<FullResult, List<Testcase>>> full = new HashMap<>(); for(IInvokedMethod meth: invoked) {