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


Java ConstructorOrMethod.getMethod方法代码示例

本文整理汇总了Java中org.testng.internal.ConstructorOrMethod.getMethod方法的典型用法代码示例。如果您正苦于以下问题:Java ConstructorOrMethod.getMethod方法的具体用法?Java ConstructorOrMethod.getMethod怎么用?Java ConstructorOrMethod.getMethod使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.testng.internal.ConstructorOrMethod的用法示例。


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

示例1: intercept

import org.testng.internal.ConstructorOrMethod; //导入方法依赖的package包/类
@Override
public List<IMethodInstance> intercept(List<IMethodInstance> methods, ITestContext context) {
    for (IMethodInstance methodIns : methods) {
        ITestNGMethod method = methodIns.getMethod();
        ConstructorOrMethod meth = method.getConstructorOrMethod();
        Method m = meth.getMethod();
        if (m != null) {
            DB db = m.getAnnotation(DB.class);
            if (db != null) {
                TransactionLegacy txn = TransactionLegacy.open(m.getName());
            }
        }
    }

    // TODO Auto-generated method stub
    return methods;
}
 
开发者ID:apache,项目名称:cloudstack,代码行数:18,代码来源:TestNGAop.java

示例2: getMethodAnnotation

import org.testng.internal.ConstructorOrMethod; //导入方法依赖的package包/类
/**
 * Returns method annotation by specified annotation class from
 * from TestNG Method or null if the method does not contain
 * such annotation.
 *
 * @param annotation Annotation class to find
 * @param testResult Where to find
 * @return {@link Annotation} or null if doesn't exists
 */
private <T extends Annotation> T getMethodAnnotation(Class<T> annotation, ITestResult testResult) {
	ITestNGMethod testNGMethod = testResult.getMethod();
	if (null != testNGMethod) {
		ConstructorOrMethod constructorOrMethod = testNGMethod.getConstructorOrMethod();
		if (null != constructorOrMethod) {
			Method method = constructorOrMethod.getMethod();
			if (null != method) {
				return method.getAnnotation(annotation);
			}
		}
	}
	return null;
}
 
开发者ID:reportportal,项目名称:agent-java-testNG,代码行数:23,代码来源:TestNGService.java

示例3: onFinish

import org.testng.internal.ConstructorOrMethod; //导入方法依赖的package包/类
@SuppressWarnings(
    { "rawtypes", "unchecked" } )
public void onFinish( ITestContext context )
{
    LOGGER.info( context.getCurrentXmlTest().toXml( "  " ) );
    /**
     * IResultMap results = context.getPassedTests(); Set<ITestResult>
     * testResults = results.getAllResults(); for(ITestResult tResult :
     * testResults) { //tResult. }
     */

    for ( ITestNGMethod method : context.getAllTestMethods() )
    {
        ConstructorOrMethod mOrC = method.getConstructorOrMethod();
        if ( mOrC == null )
        {
            LOGGER.info( "ConstructorOrMethod null" );
            continue;
        }
        Method m = mOrC.getMethod();
        if ( m == null )
        {
            LOGGER.info( "Method null" );
            continue;
        }
        Class c = m.getDeclaringClass();
        if ( c == null )
        {
            LOGGER.info( "Class null" );
            continue;
        }
        LOGGER.info( c.getCanonicalName() + ":" + m.getName() );
        CatsTestStep catsTestStepAnnotation = m.getAnnotation( CatsTestStep.class );
        CatsTestCase catsTestCaseAnnotation = ( CatsTestCase ) c.getAnnotation( CatsTestCase.class );
        if ( catsTestStepAnnotation == null || catsTestCaseAnnotation == null )
        {
            LOGGER.info( "Annotations not found" );
            continue;
        }
        LOGGER.info( catsTestCaseAnnotation.name() + ":" + catsTestStepAnnotation.name() );

    }
    LOGGER.info( "On Finish Found" );
}
 
开发者ID:Comcast,项目名称:cats,代码行数:45,代码来源:CatsTestListener.java


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