當前位置: 首頁>>代碼示例>>Java>>正文


Java MethodRule.apply方法代碼示例

本文整理匯總了Java中org.junit.rules.MethodRule.apply方法的典型用法代碼示例。如果您正苦於以下問題:Java MethodRule.apply方法的具體用法?Java MethodRule.apply怎麽用?Java MethodRule.apply使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.junit.rules.MethodRule的用法示例。


在下文中一共展示了MethodRule.apply方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: apply

import org.junit.rules.MethodRule; //導入方法依賴的package包/類
@Override
public Statement apply(final Statement result, final FrameworkMethod method, final Object target) {
    Statement lastResult = result;

    for (final MethodRule rule : getRules()) {
        lastResult = rule.apply(lastResult, method, target);
    }

    return lastResult;
}
 
開發者ID:dadrus,項目名稱:jpa-unit,代碼行數:11,代碼來源:JpaUnitRule.java

示例2: withRules

import org.junit.rules.MethodRule; //導入方法依賴的package包/類
private Statement withRules( FrameworkMethod method, Object target, Statement statement )
{
        Statement result = statement;
        for( MethodRule each : rules( target ) )
                result = each.apply( result, method, target );
        return result;
}
 
開發者ID:JoeBeeton,項目名稱:FuzzUnit,代碼行數:8,代碼來源:FuzzUnitTestRunner.java

示例3: withRules

import org.junit.rules.MethodRule; //導入方法依賴的package包/類
/**
    * method taken as is from BlockJUnit4ClassRunner 4.7 in order to preserve
    * its functionality over following versions
    */
   private Statement withRules(FrameworkMethod method, Object target,
    Statement statement) {
Statement result = statement;
for (MethodRule each : rules(target)) {
    result = each.apply(result, method, target);
}
return result;
   }
 
開發者ID:lucaspouzac,項目名稱:contiperf,代碼行數:13,代碼來源:BlockContiPerfClassRunner.java

示例4: apply

import org.junit.rules.MethodRule; //導入方法依賴的package包/類
/**
 * {@inheritDoc} Before evaluation of the base statement, the test instance
 * will initialized.
 */
@Override
public Statement apply(final Statement base, final FrameworkMethod method, final Object target) {
    Statement appliedStatement = base;
    for (MethodRule rule : methodRuleChain) {
        appliedStatement = rule.apply(appliedStatement, method, target);
    }

    return statement(appliedStatement, target);

}
 
開發者ID:needle4j,項目名稱:needle4j,代碼行數:15,代碼來源:NeedleRule.java

示例5: withRules

import org.junit.rules.MethodRule; //導入方法依賴的package包/類
/**
 * Simply copied from BlockJUnit4ClassRunner, since its not accessible.
 */
private Statement withRules(FrameworkMethod method, Object target, Statement statement) {
    Statement result = statement;
    for (MethodRule each : getTestClass().getAnnotatedFieldValues(target, Rule.class,
            MethodRule.class))
        result = each.apply(result, method, target);
    return result;
}
 
開發者ID:deephacks,項目名稱:confit,代碼行數:11,代碼來源:FeatureTestsRunner.java

示例6: applyRuleToLastStatement

import org.junit.rules.MethodRule; //導入方法依賴的package包/類
protected Statement applyRuleToLastStatement(final Method method, final Object testInstance, Field field,
                                             final LastRuleTestExecutorStatement lastStatement) throws IllegalAccessException {
    MethodRule rule = (MethodRule) field.get(testInstance);
    Statement statement = rule.apply(lastStatement, new FrameworkMethod(method), testInstance);
    return statement;
}
 
開發者ID:awenblue,項目名稱:powermock,代碼行數:7,代碼來源:PowerMockJUnit47RunnerDelegateImpl.java


注:本文中的org.junit.rules.MethodRule.apply方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。