JUnit 4.13.2 Source Code Files

JUnit Source Code Files are provided in the source package file, junit-4.13.2-sources.jar.

You can browse JUnit Source Code files below:

✍: FYIcenter.com

junit/extensions/TestSetup.java

package junit.extensions;

import junit.framework.Protectable;
import junit.framework.Test;
import junit.framework.TestResult;

/**
 * A Decorator to set up and tear down additional fixture state. Subclass
 * TestSetup and insert it into your tests when you want to set up additional
 * state once before the tests are run.
 */
public class TestSetup extends TestDecorator {

    public TestSetup(Test test) {
        super(test);
    }

    @Override
    public void run(final TestResult result) {
        Protectable p = new Protectable() {
            public void protect() throws Exception {
                setUp();
                basicRun(result);
                tearDown();
            }
        };
        result.runProtected(this, p);
    }

    /**
     * Sets up the fixture. Override to set up additional fixture state.
     */
    protected void setUp() throws Exception {
    }

    /**
     * Tears down the fixture. Override to tear down the additional fixture
     * state.
     */
    protected void tearDown() throws Exception {
    }
}

junit/extensions/TestSetup.java

 

Or download all of them as a single archive file:

File name: junit-4.13.2-sources.jar
File size: 234540 bytes
Release date: 2021-02-13
Download 

 

Download and Install junit-4.12.jar

Download and Install junit-4.13.2.jar

Download and Install JUnit (Java Unit) Testing

⇑⇑ FAQ for JUnit (Java Unit) Testing

2016-03-28, 11110👍, 0💬