当前位置: 首页>>代码示例>>Java>>正文


Java IRetryAnalyzer类代码示例

本文整理汇总了Java中org.testng.IRetryAnalyzer的典型用法代码示例。如果您正苦于以下问题:Java IRetryAnalyzer类的具体用法?Java IRetryAnalyzer怎么用?Java IRetryAnalyzer使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


IRetryAnalyzer类属于org.testng包,在下文中一共展示了IRetryAnalyzer类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: transform

import org.testng.IRetryAnalyzer; //导入依赖的package包/类
@Override
@SuppressWarnings("rawtypes")
public void transform(final ITestAnnotation test, final Class testClass, final Constructor testConstructor, final Method testMethod) {

    //Set DataProvider for the test
    if (testMethod != null){
        if(dataType(testMethod)!=null) {
            if(dataType(testMethod).equals(Data.PROPERTIES)) {
                test.setDataProviderClass(DataSources.class);
                test.setDataProvider(dataPropertiesSource);
            } else if(dataType(testMethod).equals(Data.EXCEL)){
                test.setDataProviderClass(DataSources.class);
                test.setDataProvider(dataExcelSource);
            }
        }
    }

    //Set retry analyzer class for all @Test methods
    IRetryAnalyzer retry = test.getRetryAnalyzer();
    if (retry==null){
        test.setRetryAnalyzer(RetryAnalyzer.class);
    }
}
 
开发者ID:GiannisPapadakis,项目名称:seletest,代码行数:24,代码来源:AnnotationTransformer.java

示例2: onTestFailure

import org.testng.IRetryAnalyzer; //导入依赖的package包/类
@Override
public void onTestFailure(ITestResult result)
{
	int count = RetryCounter.getRunCount();
	int maxCount = RetryAnalyzer.getMaxRetryCountForTest();
	LOGGER.debug("count: " + count + "; maxCount:" + maxCount);

	IRetryAnalyzer retry = result.getMethod().getRetryAnalyzer();
	if (count < maxCount && retry == null)
	{
		LOGGER.error("retry_count will be ignored as RetryAnalyzer is not declared for "
				+ result.getMethod().getMethodName());
	}

	if (count < maxCount && retry != null && !Jira.isRetryDisabled(result))
	{
		failRetryItem(result, Messager.RETRY_RETRY_FAILED, count, maxCount);
	} else
	{
		failItem(result, Messager.TEST_FAILED);
		afterTest(result);
	}
	
	super.onTestFailure(result);
}
 
开发者ID:qaprosoft,项目名称:carina,代码行数:26,代码来源:AbstractTestListener.java

示例3: transform

import org.testng.IRetryAnalyzer; //导入依赖的package包/类
@SuppressWarnings("rawtypes")
@Override
public void transform(ITestAnnotation annotation, Class testClass, Constructor testConstructor, Method testMethod) {

	IRetryAnalyzer retry = annotation.getRetryAnalyzer();
	if (retry == null) {
		annotation.setRetryAnalyzer(TestngRetry.class);
	}

	// 设置 默认循环次数
	ConfigUtil property = ConfigUtil.getInstance();
	int count = Integer.valueOf(property.getProperty("loopCount"));
	LogUtil.info("默认每个方法循环" + count + "次");
	annotation.setInvocationCount(count);

	// 设置 需要特殊处理方法的循环次数
	String excepLoopCount = property.getProperty("excepLoopCount");
	String[] excepCount = excepLoopCount.split(";");
	for (int i = 0; i < excepCount.length; i++) {
		String[] temp = excepCount[i].split(",");
		if (testMethod.getName().equals(temp[0])) {
			LogUtil.info("该方法循环" + temp[1] + "次");

			annotation.setInvocationCount(Integer.valueOf(temp[1]));
		}

	}

}
 
开发者ID:quanqinle,项目名称:WebAndAppUITesting,代码行数:30,代码来源:RetryListener.java

示例4: transform

import org.testng.IRetryAnalyzer; //导入依赖的package包/类
@SuppressWarnings("rawtypes")
public void transform(final ITestAnnotation annotation, final Class testClass, final Constructor testConstructor,
        final Method testMethod)
{
    final IRetryAnalyzer retry = annotation.getRetryAnalyzer();
    if (retry == null)
    {
        annotation.setRetryAnalyzer(Retry.class);
    }
}
 
开发者ID:pradeeptaswain,项目名称:oldmonk,代码行数:11,代码来源:RetryListener.java

示例5: transform

import org.testng.IRetryAnalyzer; //导入依赖的package包/类
@Override
public void transform(ITestAnnotation annotation, Class testClass, Constructor testConstructor, Method testMethod) {
	IRetryAnalyzer retry = annotation.getRetryAnalyzer();
       if (retry == null) {
           annotation.setRetryAnalyzer(TestngRetry.class);
       }		
}
 
开发者ID:HarrisChu,项目名称:webUIAuto,代码行数:8,代码来源:RetryListener.java

示例6: transform

import org.testng.IRetryAnalyzer; //导入依赖的package包/类
public void transform(final ITestAnnotation annotation, final Class testClass, final Constructor testConstructor,
        final Method testMethod) {
    IRetryAnalyzer retryAnalyzer = annotation.getRetryAnalyzer();
    if (retryAnalyzer == null) {
        annotation.setRetryAnalyzer(TestRetryAnalyzer.class);
    }
}
 
开发者ID:tarun3kumar,项目名称:seleniumtestsframework,代码行数:8,代码来源:TestRetryListener.java

示例7: transform

import org.testng.IRetryAnalyzer; //导入依赖的package包/类
public void transform(ITestAnnotation annotation, Class testClass,
		Constructor testConstructor, Method testMethod) {
	IRetryAnalyzer analyzer = annotation.getRetryAnalyzer();

	if (analyzer == null) {
		annotation.setRetryAnalyzer(FailedTestsRetryListner.class);
	}

}
 
开发者ID:toolsqa,项目名称:OptimusPrime,代码行数:10,代码来源:AnnotationTransformer.java

示例8: onTestStart

import org.testng.IRetryAnalyzer; //导入依赖的package包/类
/**
 *
 * @param result
 */
@Override
  public void onTestStart(ITestResult result) {
      RetryTestContext context = getRetryContext(result);
      if (context != null) {
          
          if (result.getMethod().getRetryAnalyzer() == null) {
              IRetryAnalyzer retryAnalyzer = new RetryTestAnalyzer(context);
              result.getMethod().setRetryAnalyzer(retryAnalyzer);
          }
      }
  }
 
开发者ID:BenjaminLimb,项目名称:web-test-framework,代码行数:16,代码来源:RetryTestListener.java

示例9: onTestFailure

import org.testng.IRetryAnalyzer; //导入依赖的package包/类
/**
   *
   * @param result
   */
  @Override
    public void onTestFailure(ITestResult result) {
        IRetryAnalyzer retryAnalyzer = result.getMethod().getRetryAnalyzer();
        if(retryAnalyzer instanceof RetryTestAnalyzer){
            RetryTestAnalyzer retryTestAnalyzer = (RetryTestAnalyzer) retryAnalyzer;
            
            if (retryTestAnalyzer.willRetry()) {
                result.setStatus(TestResult.SKIP);
            }
            
        }
        
//        RetryTestContext context = getRetryContext(result);
//        if (context != null) {
//
//            IRetryAnalyzer retryAnalyzer = result.getMethod().getRetryAnalyzer();
//            Assert.assertTrue(retryAnalyzer instanceof RetryTestAnalyzer, "RetryAnalyzer wasn't initialized first.");
//            RetryTestAnalyzer analyzer = (RetryTestAnalyzer) retryAnalyzer;
//            
//            // It's too late to change the TestResult Status in the Retry Analyzer so it
//            // must be set here. Feel free to set it to PASS if desired.
//            if (analyzer.willRetry()) {
//                result.setStatus(TestResult.SKIP);
//            }
//        }
        
    }
 
开发者ID:BenjaminLimb,项目名称:web-test-framework,代码行数:32,代码来源:RetryTestListener.java

示例10: onTestSkipped

import org.testng.IRetryAnalyzer; //导入依赖的package包/类
@Override
public void onTestSkipped(ITestResult result) {
    ExtentTestManager.extent.removeTest(ExtentTestManager.getTest());
    IRetryAnalyzer retryAnalyzer = result.getMethod().getRetryAnalyzer();
    if (((Retry) retryAnalyzer).retryCountForTest == ((Retry) retryAnalyzer).maxRetryCount) {
        (reportManager.parentTest.get()).getModel().setStatus(Status.SKIP);
        (reportManager.childTest.get()).getModel().setStatus(Status.SKIP);
        ExtentManager.getExtent().flush();
    }
}
 
开发者ID:saikrishna321,项目名称:AppiumTestDistribution,代码行数:11,代码来源:AppiumParallelMethodTestListener.java

示例11: transform

import org.testng.IRetryAnalyzer; //导入依赖的package包/类
@Override
public void transform(ITestAnnotation iTestAnnotation,
                      Class aClass, Constructor constructor, Method method) {
    IRetryAnalyzer retry = iTestAnnotation.getRetryAnalyzer();

    if (retry == null) {
        iTestAnnotation.setRetryAnalyzer(Retry.class);
    }
}
 
开发者ID:saikrishna321,项目名称:AppiumTestDistribution,代码行数:10,代码来源:RetryListener.java

示例12: getIRA

import org.testng.IRetryAnalyzer; //导入依赖的package包/类
public static BaseTestRetryAnalyzer getIRA(ITestResult result) {
  IRetryAnalyzer ira = result.getMethod().getRetryAnalyzer();
  if (ira instanceof BaseTestRetryAnalyzer) {
    ira = (BaseTestRetryAnalyzer)ira;
  } else {
    ira = new BaseTestRetryAnalyzer();
  }
  return (BaseTestRetryAnalyzer) ira;
}
 
开发者ID:web-auto,项目名称:wtf-core,代码行数:10,代码来源:BaseListener.java

示例13: transform

import org.testng.IRetryAnalyzer; //导入依赖的package包/类
@Override
public void transform(ITestAnnotation annotation, Class testClass, Constructor constructor, Method method) {
  IRetryAnalyzer retry = annotation.getRetryAnalyzer();

  if(retry == null) {
    annotation.setRetryAnalyzer(RetryFailed.class);
  }
}
 
开发者ID:IntelligentSigma,项目名称:selenium-test-automation-framework,代码行数:9,代码来源:RetryListener.java

示例14: transform

import org.testng.IRetryAnalyzer; //导入依赖的package包/类
@SuppressWarnings("rawtypes")
@Override
public void transform(ITestAnnotation testAnnotation, Class clazz, Constructor test, Method method)
{
	IRetryAnalyzer retry = testAnnotation.getRetryAnalyzer();
	if (retry == null)
	{
		testAnnotation.setRetryAnalyzer(RetryAnalyzer.class);
	}
	LOGGER.debug("retry analyzer: " + method.getName() + testAnnotation.getRetryAnalyzer());
}
 
开发者ID:qaprosoft,项目名称:carina,代码行数:12,代码来源:AnnotationTransformer.java

示例15: getRetryAnalyzer

import org.testng.IRetryAnalyzer; //导入依赖的package包/类
@Override
public IRetryAnalyzer getRetryAnalyzer()
{
    return delegate.getRetryAnalyzer();
}
 
开发者ID:prestodb,项目名称:tempto,代码行数:6,代码来源:DelegateTestNGMethod.java


注:本文中的org.testng.IRetryAnalyzer类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。