org.testng.annotations.ObjectFactory#org.testng.IObjectFactory源码实例Demo

下面列出了org.testng.annotations.ObjectFactory#org.testng.IObjectFactory 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: activejpa   文件: BaseModelTest.java
@ObjectFactory
public IObjectFactory getObjectFactory(ITestContext context) throws Exception {
	Class<?> clazz = Class.forName("org.activejpa.enhancer.ActiveJpaAgentLoaderImpl");
	Method method = clazz.getMethod("loadAgent");
	method.invoke(null);
	return new ObjectFactoryImpl();
}
 
源代码2 项目: djl   文件: MxEngineTest.java
@ObjectFactory
public IObjectFactory getObjectFactory() {
    return new org.powermock.modules.testng.PowerMockObjectFactory();
}
 
源代码3 项目: djl   文件: AutogradTest.java
@ObjectFactory
public IObjectFactory getObjectFactory() {
    return new org.powermock.modules.testng.PowerMockObjectFactory();
}
 
源代码4 项目: djl   文件: CachedOpTest.java
@ObjectFactory
public IObjectFactory getObjectFactory() {
    return new org.powermock.modules.testng.PowerMockObjectFactory();
}
 
源代码5 项目: djl   文件: MxNDArrayTest.java
@ObjectFactory
public IObjectFactory getObjectFactory() {
    return new org.powermock.modules.testng.PowerMockObjectFactory();
}
 
源代码6 项目: djl   文件: JnaUtilsTest.java
@ObjectFactory
public IObjectFactory getObjectFactory() {
    return new org.powermock.modules.testng.PowerMockObjectFactory();
}
 
@Test
public void runAllTckTests() throws Throwable {
    TestNG testng = new TestNG();

    ObjectFactoryImpl delegate = new ObjectFactoryImpl();
    testng.setObjectFactory((IObjectFactory) (constructor, params) -> {
        if (constructor.getDeclaringClass().equals(ReactiveStreamsCdiTck.class)) {
            return tck;
        }
        else {
            return delegate.newInstance(constructor, params);
        }
    });

    testng.setUseDefaultListeners(false);
    ResultListener resultListener = new ResultListener();
    testng.addListener((ITestNGListener) resultListener);
    testng.setTestClasses(new Class[]{ ReactiveStreamsCdiTck.class });
    testng.setMethodInterceptor(new IMethodInterceptor() {
        @Override
        public List<IMethodInstance> intercept(List<IMethodInstance> methods, ITestContext context) {
            methods.sort(Comparator.comparing(m -> m.getInstance().getClass().getName()));
            return methods;
        }
    });
    testng.run();
    int total = resultListener.success.get() + resultListener.failed.get() + resultListener.skipped.get();
    System.out.println(String.format("Ran %d tests, %d passed, %d failed, %d skipped.", total, resultListener.success.get(),
        resultListener.failed.get(), resultListener.skipped.get()));
    System.out.println("Failed tests:");
    resultListener.failures.forEach(result -> {
        System.out.println(result.getInstance().getClass().getName() + "." + result.getMethod().getMethodName());
    });
    if (resultListener.failed.get() > 0) {
        if (resultListener.lastFailure.get() != null) {
            throw resultListener.lastFailure.get();
        }
        else {
            throw new Exception("Tests failed with no exception");
        }
    }
}
 
@ObjectFactory
public IObjectFactory getObjectFactory() {

    return new org.powermock.modules.testng.PowerMockObjectFactory();
}
 
@ObjectFactory
public IObjectFactory getObjectFactory() {
    return new org.powermock.modules.testng.PowerMockObjectFactory();
}
 
@ObjectFactory
public IObjectFactory getObjectFactory() {
    return new org.powermock.modules.testng.PowerMockObjectFactory();
}
 
@ObjectFactory
public IObjectFactory getObjectFactory() {
    return new org.powermock.modules.testng.PowerMockObjectFactory();
}
 
@ObjectFactory
public IObjectFactory getObjectFactory() {
    return new org.powermock.modules.testng.PowerMockObjectFactory();
}
 
@ObjectFactory
public IObjectFactory getObjectFactory() {

    return new org.powermock.modules.testng.PowerMockObjectFactory();
}
 
@ObjectFactory
public IObjectFactory getObjectFactory() {
    return new org.powermock.modules.testng.PowerMockObjectFactory();
}
 
源代码15 项目: mobi   文件: AuthRestTest.java
@ObjectFactory
public IObjectFactory getObjectFactory() {
    return new org.powermock.modules.testng.PowerMockObjectFactory();
}
 
源代码16 项目: pulsar   文件: BlobStoreTestBase.java
@ObjectFactory
// Necessary to make PowerMockito.mockStatic work with TestNG.
public IObjectFactory getObjectFactory() {
    return new org.powermock.modules.testng.PowerMockObjectFactory();
}
 
源代码17 项目: pulsar   文件: PulsarKafkaProducerTest.java
@ObjectFactory
// Necessary to make PowerMockito.mockStatic work with TestNG.
public IObjectFactory getObjectFactory() {
    return new org.powermock.modules.testng.PowerMockObjectFactory();
}
 
源代码18 项目: pulsar   文件: PulsarKafkaProducerTest.java
@ObjectFactory
// Necessary to make PowerMockito.mockStatic work with TestNG.
public IObjectFactory getObjectFactory() {
    return new org.powermock.modules.testng.PowerMockObjectFactory();
}
 
源代码19 项目: pulsar   文件: MongoSinkTest.java
@ObjectFactory
public IObjectFactory getObjectFactory() {
    return new org.powermock.modules.testng.PowerMockObjectFactory();
}
 
源代码20 项目: pulsar   文件: MongoSourceTest.java
@ObjectFactory
public IObjectFactory getObjectFactory() {
    return new org.powermock.modules.testng.PowerMockObjectFactory();
}
 
源代码21 项目: pulsar   文件: ProtocolHandlerUtilsTest.java
@ObjectFactory
public IObjectFactory getObjectFactory() {
    return new org.powermock.modules.testng.PowerMockObjectFactory();
}
 
@ObjectFactory
public IObjectFactory getObjectFactory() {
    return new org.powermock.modules.testng.PowerMockObjectFactory();
}
 
源代码23 项目: pulsar   文件: BrokerInterceptorUtilsTest.java
@ObjectFactory
public IObjectFactory getObjectFactory() {
    return new org.powermock.modules.testng.PowerMockObjectFactory();
}
 
源代码24 项目: pulsar   文件: TestCmdSources.java
@ObjectFactory
public IObjectFactory getObjectFactory() {
    return new org.powermock.modules.testng.PowerMockObjectFactory();
}
 
源代码25 项目: pulsar   文件: TestCmdSinks.java
@ObjectFactory
public IObjectFactory getObjectFactory() {
    return new org.powermock.modules.testng.PowerMockObjectFactory();
}
 
源代码26 项目: pulsar   文件: FunctionApiV2ResourceTest.java
@ObjectFactory
public IObjectFactory getObjectFactory() {
    return new org.powermock.modules.testng.PowerMockObjectFactory();
}
 
源代码27 项目: pulsar   文件: SourceApiV3ResourceTest.java
@ObjectFactory
public IObjectFactory getObjectFactory() {
    return new org.powermock.modules.testng.PowerMockObjectFactory();
}
 
源代码28 项目: pulsar   文件: SinkApiV3ResourceTest.java
@ObjectFactory
public IObjectFactory getObjectFactory() {
    return new org.powermock.modules.testng.PowerMockObjectFactory();
}
 
源代码29 项目: pulsar   文件: FunctionApiV3ResourceTest.java
@ObjectFactory
public IObjectFactory getObjectFactory() {
    return new org.powermock.modules.testng.PowerMockObjectFactory();
}
 
源代码30 项目: pulsar   文件: FunctionsImplTest.java
@ObjectFactory
public IObjectFactory getObjectFactory() {
    return new org.powermock.modules.testng.PowerMockObjectFactory();
}