github
Advanced Search
  • Home
  • Pricing and Signup
  • Explore GitHub
  • Blog
  • Login

KentBeck / junit

  • Admin
  • Watch Unwatch
  • Fork
  • Your Fork
  • Pull Request
  • Download Source
    • 126
    • 24
  • Source
  • Commits
  • Network (24)
  • Issues (60)
  • Downloads (43)
  • Wiki (1)
  • Graphs
  • Branch: master

click here to add a description

click here to add a homepage

  • Branches (2)
    • gh-pages
    • master ✓
  • Tags (7)
    • r4.8b3
    • r4.8b2
    • r4.8b1
    • r4.8.1
    • r4.8
    • r4.7
    • r4.6
Sending Request…
Click here to lend your support to: junit and make a donation at www.pledgie.com ! Edit Pledgie Setup

Pledgie Donations

Once activated, we'll place the following badge in your repository's detail box:
Pledgie_example
This service is courtesy of Pledgie.

A programmer-oriented testing framework for Java. — Read more

  cancel

www.junit.org

  cancel
  • Private
  • Read-Only
  • HTTP Read-Only

This URL has Read+Write access

CategoriesMark2 reuse code properly from TestClass 
David Saff (author)
Mon Feb 08 20:10:47 -0800 2010
commit  1bbab715de4c64943948ecc3739c8d5569378672
tree    ce97d8157bf4acc94924343e4ec5718d4940258e
parent  04189a834a01ae7ff3189bfa869e90d1a7f83acf
junit / src / main / java / org / junit / rules / MethodRule.java src/main/java/org/junit/rules/MethodRule.java
100644 39 lines (37 sloc) 1.765 kb
edit raw blame history
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
package org.junit.rules;
 
import org.junit.Rule;
import org.junit.runners.model.FrameworkMethod;
import org.junit.runners.model.Statement;
 
/**
* A MethodRule is an alteration in how a test method is run and reported.
* Multiple {@link MethodRule}s can be applied to a test method. The
* {@link Statement} that executes the method is passed to each annotated
* {@link Rule} in turn, and each may return a substitute or modified
* {@link Statement}, which is passed to the next {@link Rule}, if any. For
* examples of how this can be useful, see these provided MethodRules,
* or write your own:
*
* <ul>
* <li>{@link ErrorCollector}: collect multiple errors in one test method</li>
* <li>{@link ExpectedException}: make flexible assertions about thrown exceptions</li>
* <li>{@link ExternalResource}: start and stop a server, for example</li>
* <li>{@link TemporaryFolder}: create fresh files, and delete after test</li>
* <li>{@link TestName}: remember the test name for use during the method</li>
* <li>{@link TestWatchman}: add logic at events during method execution</li>
* <li>{@link Timeout}: cause test to fail after a set time</li>
* <li>{@link Verifier}: fail test if object state ends up incorrect</li>
* </ul>
*/
public interface MethodRule {
/**
* Modifies the method-running {@link Statement} to implement an additional
* test-running rule.
*
* @param base The {@link Statement} to be modified
* @param method The method to be run
* @param target The object on with the method will be run.
* @return a new statement, which may be the same as {@code base},
* a wrapper around {@code base}, or a completely new Statement.
*/
Statement apply(Statement base, FrameworkMethod method, Object target);
}
Blog | Support | Training | Contact | API | Status | Twitter | Help | Security
© 2010 GitHub Inc. All rights reserved. | Terms of Service | Privacy Policy
Powered by the Dedicated Servers and
Cloud Computing of Rackspace Hosting®
Dedicated Server