Package org.junit.runners.model

Examples of org.junit.runners.model.Statement


  private static final Log log = LoggerFactory.make();

  @Override
  public Statement apply(final Statement base, final Description description) {
    return new Statement() {
      @Override
      public void evaluate() throws Throwable {
        if ( TestHelper.backendSupportsTransactions() ) {
          base.evaluate();
        }
View Full Code Here


@SuppressWarnings( { "restriction", "deprecation" } )
public class TabrisEnvironment implements TestRule {

  @Override
  public Statement apply( final Statement base, Description description ) {
    return new Statement() {

      @Override
      public void evaluate() throws Throwable {
        try {
          Fixture.setSkipResourceRegistration( true );
View Full Code Here

  private ByteArrayOutputStream copy;

  @Override
  public Statement apply(final Statement base, Description description) {
    return new Statement() {
      @Override
      public void evaluate() throws Throwable {
        captureOutput();
        try {
          base.evaluate();
View Full Code Here

    return this.outputCapture.toString();
  }

  @Override
  public Statement apply(Statement base, Description description) {
    final Statement statement = CliTester.this.outputCapture.apply(new RunLauncherStatement(base), description);
    return new Statement() {

      @Override
      public void evaluate() throws Throwable {
        statement.evaluate();
      }
    };
  }
View Full Code Here

    public Statement apply(Statement base, Description description) {
        return statement(base);
    }

    private Statement statement(final Statement base) {
        return new Statement() {
            @Override
            public void evaluate() throws Throwable {
                before();
                try {
                    base.evaluate();
View Full Code Here

    public static class CallMethodOnlyOnceRule {
        static int countOfMethodCalls = 0;

        private static class Dummy implements TestRule {
            public Statement apply(final Statement base, Description description) {
                return new Statement() {
                    @Override
                    public void evaluate() throws Throwable {
                        base.evaluate();
                    }
View Full Code Here

    private static int runCount;

    private static class Increment implements MethodRule {
        public Statement apply(final Statement base,
                FrameworkMethod method, Object target) {
            return new Statement() {
                @Override
                public void evaluate() throws Throwable {
                    runCount++;
                    base.evaluate();
                }
View Full Code Here

    public static class CustomTestName implements TestRule {
        public String name = null;

        public Statement apply(final Statement base, final Description description) {
            return new Statement() {
                @Override
                public void evaluate() throws Throwable {
                    name = description.getMethodName();
                    base.evaluate();
                }
View Full Code Here

    public static class CallsMethodReturningRuleOnlyOnce {
        int callCount = 0;
       
        private static class Dummy implements MethodRule {
            public Statement apply(final Statement base, FrameworkMethod method, Object target) {
                return new Statement() {
                   
                    @Override
                    public void evaluate() throws Throwable {
                        base.evaluate();
                    }
View Full Code Here

public class BlockJUnit4ClassRunnerOverrideTest {
    public static class FlipBitRule implements MethodRule {
        public Statement apply(final Statement base, FrameworkMethod method,
                final Object target) {
            return new Statement() {
                @Override
                public void evaluate() throws Throwable {
                    target.getClass().getField("flipBit").set(target, true);
                    base.evaluate();
                }
View Full Code Here

TOP

Related Classes of org.junit.runners.model.Statement

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.