微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

org.junit.internal.runners.model.ReflectiveCallable的实例源码

项目:easy-test    文件EasyJUnit4.java   
protected Statement methodBlock(FrameworkMethod method) {
    Object test;
    try {
        test = new ReflectiveCallable() {
            @Override
            protected Object runReflectiveCall() throws Throwable {
                return createtest();
            }
        }.run();
    } catch (Throwable e) {
        return new Fail(e);
    }

    Statement statement = methodInvoker(method,test);
    statement = possiblyExpectingExceptions(method,test,statement);
    statement = withPotentialTimeout(method,statement);
    statement = withBefores(method,statement);
    statement = withAfters(method,statement);
    statement = withRules(method,statement);
    return statement;
}
项目:spring4-understanding    文件SpringJUnit4ClassRunner.java   
/**
 * Augment the default JUnit behavior
 * {@linkplain #withPotentialRepeat with potential repeats} of the entire
 * execution chain.
 * <p>Furthermore,support for timeouts has been moved down the execution
 * chain in order to include execution of {@link org.junit.Before @Before}
 * and {@link org.junit.After @After} methods within the timed execution.
 * Note that this differs from the default JUnit behavior of executing
 * {@code @Before} and {@code @After} methods in the main thread while
 * executing the actual test method in a separate thread. Thus,the net
 * effect is that {@code @Before} and {@code @After} methods will be
 * executed in the same thread as the test method. As a consequence,* JUnit-specified timeouts will work fine in combination with Spring
 * transactions. However,JUnit-specific timeouts still differ from
 * Spring-specific timeouts in that the former execute in a separate
 * thread while the latter simply execute in the main thread (like regular
 * tests).
 * @see #possiblyExpectingExceptions(FrameworkMethod,Object,Statement)
 * @see #withBefores(FrameworkMethod,Statement)
 * @see #withAfters(FrameworkMethod,Statement)
 * @see #withRulesReflectively(FrameworkMethod,Statement)
 * @see #withPotentialRepeat(FrameworkMethod,Statement)
 * @see #withPotentialTimeout(FrameworkMethod,Statement)
 */
@Override
protected Statement methodBlock(FrameworkMethod frameworkMethod) {
    Object testInstance;
    try {
        testInstance = new ReflectiveCallable() {
            @Override
            protected Object runReflectiveCall() throws Throwable {
                return createtest();
            }
        }.run();
    }
    catch (Throwable ex) {
        return new Fail(ex);
    }

    Statement statement = methodInvoker(frameworkMethod,testInstance);
    statement = possiblyExpectingExceptions(frameworkMethod,testInstance,statement);
    statement = withBefores(frameworkMethod,statement);
    statement = withAfters(frameworkMethod,statement);
    statement = withRulesReflectively(frameworkMethod,statement);
    statement = withPotentialRepeat(frameworkMethod,statement);
    statement = withPotentialTimeout(frameworkMethod,statement);
    return statement;
}
项目:parameterized-suite    文件BlockJUnit4ClassRunnerWithParametersUtil.java   
/**
 * Extends a given {@link Statement} for a {@link TestClass} with the evaluation of
 * {@link TestRule},{@link ClassRule},{@link Before} and {@link After}.
 * <p>
 * Therefore the test class will be instantiated and parameters will be injected with the same
 * mechanism as in {@link Parameterized}.
 * 
 * Implementation has been extracted from BlockJUnit4ClassRunner#methodBlock(FrameworkMethod).
 * 
 * @param baseStatementWithChildren - A {@link Statement} that includes execution of the test's
 *        children
 * @param testClass - The {@link TestClass} of the test.
 * @param description - The {@link Description} will be passed to the {@link Rule}s and
 *        {@link ClassRule}s.
 * @param singleParameter - The parameters will be injected in attributes annotated with
 *        {@link Parameterized.Parameter} or passed to the constructor otherwise.
 * 
 * @see BlockJUnit4ClassRunnerWithParameters#createtest()
 * @see BlockJUnit4ClassRunner#methodBlock(FrameworkMethod)
 */
public static Statement buildStatementWithTestRules(Statement baseStatementWithChildren,final TestClass testClass,Description description,final Object[] singleParameter) {
    final Object test;
    try {
        test = new ReflectiveCallable() {
            protected Object runReflectiveCall() throws Throwable {
                return createInstanceOfParameterizedTest(testClass,singleParameter);
            }
        }.run();
    } catch (Throwable e) {
        return new Fail(e);
    }

    List<TestRule> testRules = BlockJUnit4ClassRunnerUtil.getTestRules(test,testClass);
    Statement statement = BlockJUnit4ClassRunnerUtil.withTestRules(testRules,description,baseStatementWithChildren);

    statement = ParentRunnerUtil.withBeforeClasses(statement,testClass);
    statement = ParentRunnerUtil.withAfterClasses(statement,testClass);
    statement = ParentRunnerUtil.withClassRules(statement,testClass,description);
    return statement;
}
项目:jspare-container    文件JspareUnitRunner.java   
/**
 * Augment the default JUnit behavior
 * <p>Furthermore,JUnit-specific timeouts still differ from
 * Spring-specific timeouts in that the former execute in a separate
 * thread while the latter simply execute in the main thread (like regular
 * tests).
 *
 * @see #methodInvoker(FrameworkMethod,Object)
 * @see #possiblyExpectingExceptions(FrameworkMethod,Statement)
 */
@Override
protected Statement methodBlock(FrameworkMethod frameworkMethod) {
  Object testInstance;
  try {
    testInstance = new ReflectiveCallable() {
      @Override
      protected Object runReflectiveCall() throws Throwable {
        return createtest();
      }
    }.run();
  } catch (Throwable ex) {
    return new Fail(ex);
  }

  Environment.inject(testInstance);

  Statement statement = methodInvoker(frameworkMethod,testInstance);
  statement = possiblyExpectingExceptions(frameworkMethod,statement);
  statement = withBefores(frameworkMethod,statement);
  statement = withAfters(frameworkMethod,statement);
  statement = withPotentialTimeout(frameworkMethod,statement);
  return statement;
}
项目:vertx-jspare    文件VertxJspareUnitRunner.java   
@Override
protected Statement methodBlock(FrameworkMethod frameworkMethod) {
  testContext = new TestContextImpl(new HashMap<>(classAttributes),null);
  Object testInstance;
  try {
    testInstance = new ReflectiveCallable() {
      @Override
      protected Object runReflectiveCall() throws Throwable {
        return createtest();
      }
    }.run();
  } catch (Throwable ex) {
    return new Fail(ex);
  }

  Environment.inject(testInstance);

  Statement statement = methodInvoker(frameworkMethod,statement);
  testContext = null;
  return statement;
}
项目:junit-composite-runner    文件RunnerChainLinkFactory.java   
public ParentRunner<?> makeLink(Class<? extends ParentRunner<?>> runnerClass,final Class<?> testClass,final CompositeRunner compositeRunner,final ParentRunner<?> nextRunner,boolean isTestStructureProvider) throws InitializationError {
    Classpool pool = Classpool.getDefault();

    String newClassName = runnerClass.getName() + (isTestStructureProvider ? "TestStructureProvider" : "ChainLink");
    final Class<?> newRunnerCtClass = makeLinkClass(pool,newClassName,runnerClass,isTestStructureProvider);

    try {
        return (ParentRunner<?>) new ReflectiveCallable() {
            @Override
            protected Object runReflectiveCall() throws Throwable {
                return newRunnerCtClass.getConstructor(Class.class,CompositeRunner.class,ParentRunner.class)
                    .newInstance(testClass,compositeRunner,nextRunner);
            }
        }.run();
    } catch (InitializationError e) {
        throw e;
    } catch (Throwable throwable) {
        throw new RuntimeException(throwable);
    }
}
项目:FuzzUnit    文件FuzzUnitTestRunner.java   
protected Statement methodBlock( FuzzUnitTestMethod testMethod )
{
        Object test;
        try {
                test = new ReflectiveCallable()
                {
                        @Override
                        protected Object runReflectiveCall() throws Throwable
                        {
                                return createtest();
                        }
                }.run();
        } catch( Throwable e ) {
                return new Fail( e );
        }

        Statement statement = methodInvoker( testMethod,test );
        statement = withRules( testMethod,statement );
        return statement;
}
项目:contiperf    文件BlockContiPerfClassRunner.java   
/**
    * method taken as is from BlockJUnit4ClassRunner 4.7 in order to preserve
    * its functionality over following versions
    */
   @Override
   protected Statement methodBlock(FrameworkMethod method) {
Object test;
try {
    test = new ReflectiveCallable() {
    @Override
    protected Object runReflectiveCall() throws Throwable {
        return createtest();
    }
    }.run();
} catch (Throwable e) {
    return new Fail(e);
}

Statement statement = methodInvoker(method,test);
statement = possiblyExpectingExceptions(method,statement);
statement = withPotentialTimeout(method,statement);
statement = withRules(method,statement);
statement = withBefores(method,statement);
statement = withAfters(method,statement);
return statement;
   }
项目:tomee    文件MetaRunner.java   
@Override
protected Statement methodBlock(final FrameworkMethod method) {
    final Object test;
    try {
        test = new ReflectiveCallable() {
            @Override
            protected Object runReflectiveCall() throws Throwable {
                return createtest();
            }
        }.run();
    } catch (final Throwable e) {
        return new Fail(e);
    }
    Statement statement = new MetaTest.$(method,test);
    statement = withBefores(method,statement);
    return statement;
}
项目:tomee    文件ValidationRunner.java   
@Override
protected Statement methodBlock(final FrameworkMethod method) {
    final Object test;
    try {
        test = new ReflectiveCallable() {
            @Override
            protected Object runReflectiveCall() throws Throwable {
                return createtest();
            }
        }.run();
    } catch (final Throwable e) {
        return new Fail(e);
    }
    Statement statement = new InvokeMethod(method,statement);
    return statement;
}
项目:multiverse-test    文件UnfinalizingTestRunner.java   
/**
 * had to override this whole method to get enough overall control to wrap
 * all method invocations...  javadoc says that this can be overridden
 */
@Override
protected Statement methodBlock(FrameworkMethod method) {
    Object test;
    try {
        test= new ReflectiveCallable() {
            @Override
            protected Object runReflectiveCall() throws Throwable {
                return createtest();
            }
        }.run();
    } catch (Throwable e) {
        return new Fail(e);
    }

    Statement statement= methodInvoker(method,test);
    statement= possiblyExpectingExceptions(method,statement);
    statement= withPotentialTimeout(method,statement);
    statement= withBefores(method,statement);
    statement= withAfters(method,statement);
    statement= withRules(method,statement);
    return statement;
}
项目:junit-composite-runner    文件FrameworkMethodChainLink.java   
@Override
public Object invokeExplosively(Object target,Object... params) throws Throwable {
    // Todo: ok to ignore parameters here? i guess it depends on the Runner if they are used.
    return new ReflectiveCallable() {
        @Override
        protected Object runReflectiveCall() throws Throwable {
            return nextRunnerrunchild.invoke(nextRunner,wrapped,runNotifier);
        }
    }.run();
}
项目:junit-composite-runner    文件RunnerChainLinkFactory.java   
public static Statement invokeClassBlock(final ParentRunner<?> nextRunner,final RunNotifier notifier) {
    try {
        return (Statement)new ReflectiveCallable() {
            @Override
            protected Object runReflectiveCall() throws Throwable {
                Method classBlockMethod = ParentRunner.class.getDeclaredMethod("classBlock",RunNotifier.class);
                classBlockMethod.setAccessible(true);
                return classBlockMethod.invoke(nextRunner,notifier);
            }
        }.run();
    } catch (Throwable throwable) {
        throw new RuntimeException(throwable);
    }
}
项目:junit-composite-runner    文件RunnerChainLinkFactory.java   
public static List invokeGetChildren(final ParentRunner<?> runner) {
    try {
        return (List)new ReflectiveCallable() {
            @Override
            protected Object runReflectiveCall() throws Throwable {
                Method getChildrenMethod = ParentRunner.class.getDeclaredMethod("getChildren");
                getChildrenMethod.setAccessible(true);
                return getChildrenMethod.invoke(runner);
            }
        }.run();
    } catch (Throwable throwable) {
        throw new RuntimeException(throwable);
    }
}
项目:junit-composite-runner    文件RunnerChainLinkFactory.java   
public static Description invokeDescribeChild(final ParentRunner<?> runner,final Object child) {
    try {
        return (Description) new ReflectiveCallable() {
            @Override
            protected Object runReflectiveCall() throws Throwable {
                Method describeChildMethod = ParentRunner.class.getDeclaredMethod("describeChild",Object.class);
                describeChildMethod.setAccessible(true);
                return describeChildMethod.invoke(runner,child);
            }
        }.run();
    } catch (Throwable throwable) {
        throw new RuntimeException(throwable);
    }
}
项目:junit-composite-runner    文件runchildren.java   
@Override
public void evaluate() throws Throwable {
    final Method runchildrenMethod = ParentRunner.class.getDeclaredMethod("runchildren",RunNotifier.class);
    runchildrenMethod.setAccessible(true);

    new ReflectiveCallable() {
        @Override
        protected Object runReflectiveCall() throws Throwable {
            return runchildrenMethod.invoke(runner,notifier);
        }
    }.run();
}
项目:junit-composite-runner    文件TestObjectInstanceContainer.java   
public static Object invoke(final Method method,final Object... args) {
    try {
        return new ReflectiveCallable() {
            @Override
            protected Object runReflectiveCall() throws Throwable {
                return method.invoke(currentTestInstance.peek(),args);
            }
        }.run();
    } catch (Throwable throwable) {
        throw new RuntimeException(throwable);
    }
}
项目:junit-composite-runner    文件TestRunner.java   
private Statement methodBlock(FrameworkMethod method) {
    Object testObject;
    try {
        testObject = new ReflectiveCallable() {
            @Override
            protected Object runReflectiveCall() throws Throwable {
                return getTestClass().getonlyConstructor().newInstance(new Object[0]);
            }
        }.run();
    } catch (Throwable throwable) {
        return new Fail(throwable);
    }

    return new InvokeMethod(method,testObject);
}
项目:sosiefier    文件FrameworkMethod.java   
/**
 * Returns the result of invoking this method on {@code target} with
 * parameters {@code params}. {@link InvocationTargetException}s thrown are
 * unwrapped,and their causes rethrown.
 */
public Object invokeExplosively(final Object target,final Object... params)
        throws Throwable {
    return new ReflectiveCallable() {
        @Override
        protected Object runReflectiveCall() throws Throwable {
            return fMethod.invoke(target,params);
        }
    }.run();
}
项目:burst    文件BurstMethod.java   
@Override public Object invokeExplosively(final Object target,Object... params)
    throws Throwable {
  checkNotNull(target,"target");

  ReflectiveCallable callable = new ReflectiveCallable() {
    @Override protected Object runReflectiveCall() throws Throwable {
      return getmethod().invoke(target,methodArgs);
    }
  };
  return callable.run();
}
项目:class-guard    文件SpringJUnit4ClassRunner.java   
/**
 * Augments the default JUnit behavior
 * {@link #withPotentialRepeat(FrameworkMethod,Statement) with
 * potential repeats} of the entire execution chain.
 * <p>Furthermore,support for timeouts has been moved down the execution chain
 * in order to include execution of {@link org.junit.Before &#064;Before}
 * and {@link org.junit.After &#064;After} methods within the timed
 * execution. Note that this differs from the default JUnit behavior of
 * executing {@code &#064;Before} and {@code &#064;After} methods
 * in the main thread while executing the actual test method in a separate
 * thread. Thus,the end effect is that {@code &#064;Before} and
 * {@code &#064;After} methods will be executed in the same thread as
 * the test method. As a consequence,JUnit-specified timeouts will work
 * fine in combination with Spring transactions. Note that JUnit-specific
 * timeouts still differ from Spring-specific timeouts in that the former
 * execute in a separate thread while the latter simply execute in the main
 * thread (like regular tests).
 * @see #possiblyExpectingExceptions(FrameworkMethod,Statement)
 */
@Override
protected Statement methodBlock(FrameworkMethod frameworkMethod) {
    Object testInstance;
    try {
        testInstance = new ReflectiveCallable() {

            @Override
            protected Object runReflectiveCall() throws Throwable {
                return createtest();
            }
        }.run();
    }
    catch (Throwable ex) {
        return new Fail(ex);
    }

    Statement statement = methodInvoker(frameworkMethod,statement);

    return statement;
}
项目:cJUnit-mc626    文件ConcurrentRunner.java   
protected Object createTestObject() throws Throwable {
    return new ReflectiveCallable() {
        @Override
        protected Object runReflectiveCall() throws Throwable {
            return createtest();
        }
    }.run();
}
项目:lcm    文件FrameworkMethod.java   
/**
 * Returns the result of invoking this method on {@code target} with
 * parameters {@code params}. {@link InvocationTargetException}s thrown are
 * unwrapped,params);
        }
    }.run();
}
项目:junit-seasar2    文件Seasar24.java   
@SuppressWarnings("deprecation")
@Override
protected Statement methodBlock(final FrameworkMethod method) {
    Object test;
    try {
        test = new ReflectiveCallable() {
            @Override
            protected Object runReflectiveCall() throws Throwable {
                return createtest();
            }
        }.run();
    } catch (Throwable e) {
        return new Fail(e);
    }

    Statement statement = methodInvoker(method,test);
    statement = withTransaction(method,statement);
    statement = possiblyExpectingExceptions(method,statement);
    statement = withFieldsBinding(method,statement);
    statement = withContainer(method,statement);
    statement = withContext(method,statement);
    statement = withRootContainer(method,statement);
    statement = withClassLoader(statement);
    statement = withRules(method,statement);
    return statement;
}
项目:KoPeMe    文件TimeBasedTestRunner.java   
/**
 * Gets the PerformanceJUnitStatement for the test execution of the given method.
 * 
 * @param currentMethod
 *            Method that should be tested
 * @return PerformanceJUnitStatement for testing the method
 * @throws NoSuchMethodException
 *             Thrown if the method does not exist
 * @throws SecurityException
 *             Thrown if the method is not accessible
 * @throws illegalaccessexception
 *             Thrown if the method is not accessible
 * @throws IllegalArgumentException
 *             Thrown if the method has arguments
 * @throws InvocationTargetException
 *             Thrown if the method is not accessible
 */
private PerformanceJUnitStatement getStatement(final FrameworkMethod currentMethod) throws NoSuchMethodException,SecurityException,illegalaccessexception,IllegalArgumentException,InvocationTargetException {

    try {
        final Object testObject = new ReflectiveCallable() {
            @Override
            protected Object runReflectiveCall() throws Throwable {
                return createtest();
            }
        }.run();
        if (classFinished){
            return null;
        }
        LOG.debug("Statement: " + currentMethod.getName() + " " + classFinished);

        Statement testExceptionTimeoutStatement = methodInvoker(currentMethod,testObject);

        testExceptionTimeoutStatement = possiblyExpectingExceptions(currentMethod,testObject,testExceptionTimeoutStatement);
        // testExceptionTimeoutStatement = withPotentialTimeout(currentMethod,testExceptionTimeoutStatement);

        final Method withRulesMethod = BlockJUnit4ClassRunner.class.getDeclaredMethod("withRules",FrameworkMethod.class,Object.class,Statement.class);
        withRulesMethod.setAccessible(true);

        final Statement withRuleStatement = (Statement) withRulesMethod.invoke(this,new Object[] { currentMethod,testExceptionTimeoutStatement });
        final PerformanceJUnitStatement perfStatement = new PerformanceJUnitStatement(withRuleStatement,testObject);
        final List<FrameworkMethod> befores = getTestClass().getAnnotatedMethods(Before.class);
        final List<FrameworkMethod> afters = getTestClass().getAnnotatedMethods(After.class);
        perfStatement.setBefores(befores);
        perfStatement.setAfters(afters);

        return perfStatement;
    } catch (final Throwable e) {
        return new PerformanceFail(e);
    }
}
项目:KoPeMe    文件PerformanceTestRunnerJUnit.java   
/**
 * Gets the PerformanceJUnitStatement for the test execution of the given method.
 * 
 * @param currentMethod
 *            Method that should be tested
 * @return PerformanceJUnitStatement for testing the method
 * @throws NoSuchMethodException
 *             Thrown if the method does not exist
 * @throws SecurityException
 *             Thrown if the method is not accessible
 * @throws illegalaccessexception
 *             Thrown if the method is not accessible
 * @throws IllegalArgumentException
 *             Thrown if the method has arguments
 * @throws InvocationTargetException
 *             Thrown if the method is not accessible
 */
private PerformanceJUnitStatement getStatement(final FrameworkMethod currentMethod) throws NoSuchMethodException,testObject);
        final List<FrameworkMethod> befores = getTestClass().getAnnotatedMethods(Before.class);
        final List<FrameworkMethod> afters = getTestClass().getAnnotatedMethods(After.class);
        perfStatement.setBefores(befores);
        perfStatement.setAfters(afters);

        return perfStatement;
    } catch (final Throwable e) {
        return new PerformanceFail(e);
    }
}
项目:tomee    文件JUnit4Runner.java   
/**
 * Creates a new test instance
 *
 * @return new instance
 */
private Object newTestInstance() {
    try {
        return new ReflectiveCallable() {
            @Override
            protected Object runReflectiveCall() throws Throwable {
                return createtest();
            }
        }.run();
    } catch (final Throwable e) {
        return new Fail(e);
    }
}
项目:tomee    文件LocalClientRunner.java   
/**
 * Creates a new test instance
 *
 * @return new instance
 */
private Object newTestInstance() {
    try {
        return new ReflectiveCallable() {
            @Override
            protected Object runReflectiveCall() throws Throwable {
                return createtest();
            }
        }.run();
    } catch (final Throwable e) {
        return new Fail(e);
    }
}
项目:junit    文件FrameworkMethod.java   
/**
 * Returns the result of invoking this method on {@code target} with
 * parameters {@code params}. {@link InvocationTargetException}s thrown are
 * unwrapped,params);
        }
    }.run();
}
项目:org.openntf.domino    文件FrameworkMethod.java   
/**
 * Returns the result of invoking this method on {@code target} with
 * parameters {@code params}. {@link InvocationTargetException}s thrown are
 * unwrapped,params);
        }
    }.run();
}
项目:kc-rice    文件LoadTimeWeavableTestRunner.java   
/**
 * Returns a Statement that,when executed,either returns normally if
 * {@code method} passes,or throws an exception if {@code method} fails.
 *
 * Here is an outline of the default implementation:
 *
 * <ul>
 * <li>Invoke {@code method} on the result of {@code createtest()},and
 * throw any exceptions thrown by either operation.
 * <li>HOWEVER,if {@code method}'s {@code @Test} annotation has the {@code
 * expecting} attribute,return normally only if the prevIoUs step threw an
 * exception of the correct type,and throw an exception otherwise.
 * <li>HOWEVER,if {@code method}'s {@code @Test} annotation has the {@code
 * timeout} attribute,throw an exception if the prevIoUs step takes more
 * than the specified number of milliseconds.
 * <li>ALWAYS run all non-overridden {@code @Before} methods on this class
 * and superclasses before any of the prevIoUs steps; if any throws an
 * Exception,stop execution and pass the exception on.
 * <li>ALWAYS run all non-overridden {@code @After} methods on this class
 * and superclasses after any of the prevIoUs steps; all After methods are
 * always executed: exceptions thrown by prevIoUs steps are combined,if
 * necessary,with exceptions from After methods into a
 * {@link org.junit.runners.model.MultipleFailureException}.
 * <li>ALWAYS allow {@code @Rule} fields to modify the execution of the
 * above steps. A {@code Rule} may prevent all execution of the above steps,* or add additional behavior before and after,or modify thrown exceptions.
 * For more @R_122_4045@ion,see {@link org.junit.rules.TestRule}
 * </ul>
 *
 * This can be overridden in subclasses,either by overriding this method,* or the implementations creating each sub-statement.
 */
protected Statement methodBlock(FrameworkMethod method) {
    Object test;
    try {
        test = new ReflectiveCallable() {
            @Override
            protected Object runReflectiveCall() throws Throwable {
                return createtest();
            }
        }.run();
    } catch (Throwable e) {
        return new Fail(e);
    }

    Statement statement = methodInvoker(method,statement);
    return statement;
}
项目:cloudera-framework    文件TestRunner.java   
@Override
@SuppressWarnings("deprecation")
protected Statement methodBlock(FrameworkMethod method) {
  Object test;
  try {
    test = new ReflectiveCallable() {
      @Override
      protected Object runReflectiveCall() throws Throwable {
        return createtest();
      }
    }.run();
  } catch (Throwable e) {
    return new Fail(e);
  }
  boolean validated = true;
  for (CdhServer cdhServer : getTestClass().getAnnotatedFieldValues(test,ClassRule.class,CdhServer.class)) {
    validated = validated && cdhServer.isValid();
    if (validated) {
      for (CdhServer cdhServerDependency : cdhServer.getDependencies()) {
        validated = validated && cdhServerDependency.isValid();
      }
    }
  }
  Statement statement;
  if (validated) {
    statement = methodInvoker(method,test);
    statement = withLogging(method,statement);
    statement = withServerRules(method,statement);
  } else {
    statement = new Statement() {
      @Override
      public void evaluate() throws Throwable {
        if (LOG.isWarnEnabled()) {
          LOG.warn("Skipping [" + method.getDeclaringClass().getCanonicalName() + "." + method.getName() + "],invalid classpath");
        }
      }
    };
  }
  return statement;
}
项目:sosiefier    文件BlockJUnit4ClassRunner.java   
/**
 * Returns a Statement that,with exceptions from After methods into a
 * {@link MultipleFailureException}.
 * <li>ALWAYS allow {@code @Rule} fields to modify the execution of the
 * above steps. A {@code Rule} may prevent all execution of the above steps,see {@link TestRule}
 * </ul>
 *
 * This can be overridden in subclasses,statement);
    return statement;
}
项目:lcm    文件BlockJUnit4ClassRunner.java   
/**
 * Returns a Statement that,statement);
    return statement;
}
项目:rice    文件LoadTimeWeavableTestRunner.java   
/**
 * Returns a Statement that,statement);
    return statement;
}
项目:org.technbolts.junit    文件FrameworkMethodRunner.java   
/**
 * Returns a Statement that,or throws an exception if {@code method} fails.
 * <p/>
 * Here is an outline of the default implementation:
 * <p/>
 * <ul>
 * <li>Invoke {@code method} on the result of {@code createtest()},see {@link org.junit.rules.TestRule}
 * </ul>
 * <p/>
 * This can be overridden in subclasses,statement);
    return statement;
}
项目:junit    文件BlockJUnit4ClassRunner.java   
/**
 * Returns a Statement that,statement);
    return statement;
}
项目:org.openntf.domino    文件BlockJUnit4ClassRunner.java   
/**
 * Returns a Statement that,statement);
    return statement;
}

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。