Package org.testng

Examples of org.testng.ITestNGMethod


    return "<b>" + method.getMethodName() + "</b> " + addon;
  }

  private void resultDetail(IResultMap tests) {
    for (ITestResult result : tests.getAllResults()) {
      ITestNGMethod method = result.getMethod();
        m_methodIndex++;
        String cname = method.getTestClass().getName();
        m_out.println("<a id=\"m" + m_methodIndex + "\"></a><h2>" + cname + ":"
            + method.getMethodName() + "</h2>");
        Set<ITestResult> resultSet = tests.getResults(method);
        generateForResult(result, method, resultSet.size());
        m_out.println("<p class=\"totop\"><a href=\"#summary\">back to summary</a></p>");

    }
View Full Code Here


          failedTests, skippedTests
      };

      for (Collection<ITestResult> tests : allTests) {
        for (ITestResult failedTest : tests) {
          ITestNGMethod current = failedTest.getMethod();
          if (current.isTest()) {
            methodsToReRun.add(current);
            ITestNGMethod method = failedTest.getMethod();
            // Don't count configuration methods
            if (method.isTest()) {
              List<ITestNGMethod> methodsDependedUpon =
                  MethodHelper.getMethodsDependedUpon(method, context.getAllTestMethods());

              for (ITestNGMethod m : methodsDependedUpon) {
                if (m.isTest()) {
View Full Code Here

* @since 7.0
*/
public class FailAllSetupTestNGHook implements IConfigurable {
   @Override
   public void run(IConfigureCallBack callBack, ITestResult testResult) {
      ITestNGMethod testMethod = testResult.getMethod();
      System.out.println("Running " + testMethod.getDescription());

      callBack.runConfigurationMethod(testResult);

      if (testMethod.isBeforeMethodConfiguration() || testMethod.isBeforeClassConfiguration() || testMethod.isBeforeTestConfiguration()) {
         throw new RuntimeException("Induced failure");
      }
   }
View Full Code Here

      {
        List<ITestResult> testResults = TestNGTAPUtils.getTestNGResultsOrderedByExecutionDate(suiteResult.getTestContext());
       
        for(ITestResult testResult : testResults)
        {
          ITestNGMethod method = testResult.getMethod();
         
          String[] groupsNm = findInWhatGroupsMethodIs(method, groups);
         
          for(String gpNm : groupsNm)
          {
View Full Code Here

    }
  }

  private String getFqMethod(ITestResult result) {
    IClass cls = result.getTestClass();
    ITestNGMethod method = result.getMethod();

    return cls.getName() + "#" + method.getMethodName();
  }
View Full Code Here

  public void onTestFailure(ITestResult tr) {
    super.onTestFailure(tr);

    IClass cls = tr.getTestClass();
    ITestNGMethod method = tr.getMethod();

    String fqMethod = cls.getName() + "#" + method.getMethodName();

    StringBuilder failureInfo = new StringBuilder();
    failureInfo.append("Failed Test:  ").append(fqMethod).append(EOL);
    Object[] parameters = tr.getParameters();
View Full Code Here

  public void onConfigurationFailure(ITestResult tr) {
    super.onConfigurationFailure(tr);

    IClass cls = tr.getTestClass();
    ITestNGMethod method = tr.getMethod();

    String fqMethod = cls.getName() + "#" + method.getMethodName();

    StringBuilder failureInfo = new StringBuilder();
    failureInfo.append("Failed Test:  ").append(fqMethod).append(EOL);
    Object[] parameters = tr.getParameters();
View Full Code Here

    public void skipTestFireTestCaseStartedEvent() {
        ITestResult testResult = mock(ITestResult.class);
        when(testResult.getName()).thenReturn(DEFAULT_TEST_NAME);
        when(testResult.getTestContext()).thenReturn(testContext);
        doReturn(new Annotation[0]).when(testngListener).getMethodAnnotations(testResult);
        ITestNGMethod method = mock(ITestNGMethod.class);
        when(method.getDescription()).thenReturn(null);
        when(testResult.getMethod()).thenReturn(method);

        testngListener.onTestSkipped(testResult);

        String suiteUid = testngListener.getSuiteUid(testContext);
View Full Code Here

        ITestResult testResult = mock(ITestResult.class);
        Throwable throwable = new NullPointerException();
        when(testResult.getTestContext()).thenReturn(testContext);
        when(testResult.getThrowable()).thenReturn(throwable);
        when(testResult.getName()).thenReturn(DEFAULT_TEST_NAME);
        ITestNGMethod method = mock(ITestNGMethod.class);
        when(method.getDescription()).thenReturn(null);
        when(testResult.getMethod()).thenReturn(method);
       
        doReturn(new Annotation[0]).when(testngListener).getMethodAnnotations(testResult);

        testngListener.onTestSkipped(testResult);
View Full Code Here

    @Test
    public void skipTestWithoutThrowable() {
        ITestResult testResult = mock(ITestResult.class);
        when(testResult.getTestContext()).thenReturn(testContext);
        when(testResult.getName()).thenReturn(DEFAULT_TEST_NAME);
        ITestNGMethod method = mock(ITestNGMethod.class);
        when(method.getDescription()).thenReturn(null);
        when(testResult.getMethod()).thenReturn(method);
       
        doReturn(new Annotation[0]).when(testngListener).getMethodAnnotations(testResult);

        testngListener.onTestSkipped(testResult);
View Full Code Here

TOP

Related Classes of org.testng.ITestNGMethod

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.