This was a quick bugfix release for an important bug
4 |
5 |
Bug fixes
6 |
7 |
8 |
github#61: Category annotations on classes were not honored.
9 |
10 |
--------------------------------------------------------------------------------
/source_to_parse/junit-master/doc/ReleaseNotes4.8.1.md:
--------------------------------------------------------------------------------
1 | ## Summary of Changes in version 4.8.1 ##
2 |
3 | This was a quick bugfix release for an important bug
4 |
5 | ### Bug fixes ###
6 |
7 | - github#61: Category annotations on classes were not honored.
--------------------------------------------------------------------------------
/source_to_parse/junit-master/doc/ReleaseNotes4.8.1.txt:
--------------------------------------------------------------------------------
1 | Please see ReleaseNotes4.8.1.md
2 |
--------------------------------------------------------------------------------
/source_to_parse/junit-master/doc/ReleaseNotes4.8.2.html:
--------------------------------------------------------------------------------
1 |
Summary of Changes in version 4.8.2
2 |
3 |
This was a quick bugfix release
4 |
5 |
Bug fixes
6 |
7 |
8 |
github#96: TestSuite(MyTestCase.class) should dynamically detect if MyTestCase
9 | is a TestCase
10 |
11 |
--------------------------------------------------------------------------------
/source_to_parse/junit-master/doc/ReleaseNotes4.8.2.md:
--------------------------------------------------------------------------------
1 | ## Summary of Changes in version 4.8.2 ##
2 |
3 | This was a quick bugfix release
4 |
5 | ### Bug fixes ###
6 |
7 | - github#96: TestSuite(MyTestCase.class) should dynamically detect if MyTestCase
8 | is a TestCase
9 |
--------------------------------------------------------------------------------
/source_to_parse/junit-master/doc/ReleaseNotes4.8.2.txt:
--------------------------------------------------------------------------------
1 | Please see ReleaseNotes4.8.2.md
2 |
--------------------------------------------------------------------------------
/source_to_parse/junit-master/doc/ReleaseNotes4.8.md:
--------------------------------------------------------------------------------
1 | ## Summary of Changes in version 4.8 ##
2 |
3 | ### Categories ###
4 |
5 | From a given set of test classes, the `Categories` runner
6 | runs only the classes and methods
7 | that are annotated with either the category given with the `@IncludeCategory`
8 | annotation, or a subtype of that category. Either classes or interfaces can be
9 | used as categories. Subtyping works, so if you say `@IncludeCategory(SuperClass.class)`,
10 | a test marked `@Category({SubClass.class})` will be run.
11 |
12 | You can also exclude categories by using the `@ExcludeCategory` annotation
13 |
14 | Example:
15 |
16 | ```java
17 | public interface FastTests { /* category marker */ }
18 | public interface SlowTests { /* category marker */ }
19 |
20 | public class A {
21 | @Test
22 | public void a() {
23 | fail();
24 | }
25 |
26 | @Category(SlowTests.class)
27 | @Test
28 | public void b() {
29 | }
30 | }
31 |
32 | @Category({SlowTests.class, FastTests.class})
33 | public class B {
34 | @Test
35 | public void c() {
36 | }
37 | }
38 |
39 | @RunWith(Categories.class)
40 | @IncludeCategory(SlowTests.class)
41 | @SuiteClasses( { A.class, B.class }) // Note that Categories is a kind of Suite
42 | public class SlowTestSuite {
43 | // Will run A.b and B.c, but not A.a
44 | }
45 |
46 | @RunWith(Categories.class)
47 | @IncludeCategory(SlowTests.class)
48 | @ExcludeCategory(FastTests.class)
49 | @SuiteClasses( { A.class, B.class }) // Note that Categories is a kind of Suite
50 | public class SlowTestSuite {
51 | // Will run A.b, but not A.a or B.c
52 | }
53 | ```
54 |
55 | ### Bug fixes ###
56 |
57 | - github#16: thread safety of Result counting
58 |
--------------------------------------------------------------------------------
/source_to_parse/junit-master/doc/ReleaseNotes4.8.txt:
--------------------------------------------------------------------------------
1 | Please see ReleaseNotes4.8.md
2 |
--------------------------------------------------------------------------------
/source_to_parse/junit-master/doc/ReleaseNotes4.9.1.md:
--------------------------------------------------------------------------------
1 | ## Summary of Changes in version 4.9.1 [unreleased!] ##
2 |
3 | ### Theories ###
4 |
5 | The `Theories` runner does not anticipate theory parameters that have generic
6 | types, as reported by github#64. Fixing this won't happen until `Theories` is
7 | moved to junit-contrib. In anticipation of this, 4.9.1 adds some of the
8 | necessary machinery to the runner classes, and deprecates a method that only
9 | the `Theories` runner uses, `FrameworkMethod`#producesType().
10 | The Common Public License that JUnit is released under is now included
11 | in the source repository.
12 |
13 | Thanks to `@pholser` for identifying a potential resolution for github#64
14 | and initiating work on it.
15 |
--------------------------------------------------------------------------------
/source_to_parse/junit-master/doc/ReleaseNotes4.9.1.txt:
--------------------------------------------------------------------------------
1 | Please see ReleaseNotes4.9.1.md
2 |
--------------------------------------------------------------------------------
/source_to_parse/junit-master/doc/ReleaseNotes4.9.txt:
--------------------------------------------------------------------------------
1 | Please see ReleaseNotes4.9.md
2 |
--------------------------------------------------------------------------------
/source_to_parse/junit-master/doc/cookstour/Image1.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ftomassetti/analyze-java-code-examples/927e75173277cf0f3ac0001ddc6929cf3b72abdf/source_to_parse/junit-master/doc/cookstour/Image1.gif
--------------------------------------------------------------------------------
/source_to_parse/junit-master/doc/cookstour/Image2.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ftomassetti/analyze-java-code-examples/927e75173277cf0f3ac0001ddc6929cf3b72abdf/source_to_parse/junit-master/doc/cookstour/Image2.gif
--------------------------------------------------------------------------------
/source_to_parse/junit-master/doc/cookstour/Image3.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ftomassetti/analyze-java-code-examples/927e75173277cf0f3ac0001ddc6929cf3b72abdf/source_to_parse/junit-master/doc/cookstour/Image3.gif
--------------------------------------------------------------------------------
/source_to_parse/junit-master/doc/cookstour/Image4.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ftomassetti/analyze-java-code-examples/927e75173277cf0f3ac0001ddc6929cf3b72abdf/source_to_parse/junit-master/doc/cookstour/Image4.gif
--------------------------------------------------------------------------------
/source_to_parse/junit-master/doc/cookstour/Image5.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ftomassetti/analyze-java-code-examples/927e75173277cf0f3ac0001ddc6929cf3b72abdf/source_to_parse/junit-master/doc/cookstour/Image5.gif
--------------------------------------------------------------------------------
/source_to_parse/junit-master/doc/cookstour/Image6.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ftomassetti/analyze-java-code-examples/927e75173277cf0f3ac0001ddc6929cf3b72abdf/source_to_parse/junit-master/doc/cookstour/Image6.gif
--------------------------------------------------------------------------------
/source_to_parse/junit-master/doc/cookstour/Image7.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ftomassetti/analyze-java-code-examples/927e75173277cf0f3ac0001ddc6929cf3b72abdf/source_to_parse/junit-master/doc/cookstour/Image7.gif
--------------------------------------------------------------------------------
/source_to_parse/junit-master/doc/cookstour/cookstour.htm:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ftomassetti/analyze-java-code-examples/927e75173277cf0f3ac0001ddc6929cf3b72abdf/source_to_parse/junit-master/doc/cookstour/cookstour.htm
--------------------------------------------------------------------------------
/source_to_parse/junit-master/doc/index.htm:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | JUnit Documentation
7 |
8 |
9 |
10 |
11 | JUnit Documentation
12 |
13 |
14 | Kent Beck, Erich Gamma, David Saff
15 |
16 |
17 | We have just begun documenting the new JUnit 4 architecture. The
cookbook has already been updated. You can find the javadoc here.
18 | The JUnit home page is here.
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/source_to_parse/junit-master/doc/markdown.sh:
--------------------------------------------------------------------------------
1 | ~/bin/Markdown.pl ReleaseNotes4.8.txt >ReleaseNotes4.8.html
--------------------------------------------------------------------------------
/source_to_parse/junit-master/doc/testinfected/IMG00001.GIF:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ftomassetti/analyze-java-code-examples/927e75173277cf0f3ac0001ddc6929cf3b72abdf/source_to_parse/junit-master/doc/testinfected/IMG00001.GIF
--------------------------------------------------------------------------------
/source_to_parse/junit-master/doc/testinfected/IMG00002.GIF:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ftomassetti/analyze-java-code-examples/927e75173277cf0f3ac0001ddc6929cf3b72abdf/source_to_parse/junit-master/doc/testinfected/IMG00002.GIF
--------------------------------------------------------------------------------
/source_to_parse/junit-master/doc/testinfected/IMG00003.GIF:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ftomassetti/analyze-java-code-examples/927e75173277cf0f3ac0001ddc6929cf3b72abdf/source_to_parse/junit-master/doc/testinfected/IMG00003.GIF
--------------------------------------------------------------------------------
/source_to_parse/junit-master/doc/testinfected/logo.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ftomassetti/analyze-java-code-examples/927e75173277cf0f3ac0001ddc6929cf3b72abdf/source_to_parse/junit-master/doc/testinfected/logo.gif
--------------------------------------------------------------------------------
/source_to_parse/junit-master/doc/testinfected/testing.htm:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ftomassetti/analyze-java-code-examples/927e75173277cf0f3ac0001ddc6929cf3b72abdf/source_to_parse/junit-master/doc/testinfected/testing.htm
--------------------------------------------------------------------------------
/source_to_parse/junit-master/lib/hamcrest-core-1.3-sources.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ftomassetti/analyze-java-code-examples/927e75173277cf0f3ac0001ddc6929cf3b72abdf/source_to_parse/junit-master/lib/hamcrest-core-1.3-sources.jar
--------------------------------------------------------------------------------
/source_to_parse/junit-master/lib/hamcrest-core-1.3.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ftomassetti/analyze-java-code-examples/927e75173277cf0f3ac0001ddc6929cf3b72abdf/source_to_parse/junit-master/lib/hamcrest-core-1.3.jar
--------------------------------------------------------------------------------
/source_to_parse/junit-master/src/changes/changes.xml:
--------------------------------------------------------------------------------
1 |
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 |
--------------------------------------------------------------------------------
/source_to_parse/junit-master/src/main/java/junit/extensions/RepeatedTest.java:
--------------------------------------------------------------------------------
1 | package junit.extensions;
2 |
3 | import junit.framework.Test;
4 | import junit.framework.TestResult;
5 |
6 | /**
7 | * A Decorator that runs a test repeatedly.
8 | */
9 | public class RepeatedTest extends TestDecorator {
10 | private int fTimesRepeat;
11 |
12 | public RepeatedTest(Test test, int repeat) {
13 | super(test);
14 | if (repeat < 0) {
15 | throw new IllegalArgumentException("Repetition count must be >= 0");
16 | }
17 | fTimesRepeat = repeat;
18 | }
19 |
20 | @Override
21 | public int countTestCases() {
22 | return super.countTestCases() * fTimesRepeat;
23 | }
24 |
25 | @Override
26 | public void run(TestResult result) {
27 | for (int i = 0; i < fTimesRepeat; i++) {
28 | if (result.shouldStop()) {
29 | break;
30 | }
31 | super.run(result);
32 | }
33 | }
34 |
35 | @Override
36 | public String toString() {
37 | return super.toString() + "(repeated)";
38 | }
39 | }
--------------------------------------------------------------------------------
/source_to_parse/junit-master/src/main/java/junit/extensions/TestDecorator.java:
--------------------------------------------------------------------------------
1 | package junit.extensions;
2 |
3 | import junit.framework.Assert;
4 | import junit.framework.Test;
5 | import junit.framework.TestResult;
6 |
7 | /**
8 | * A Decorator for Tests. Use TestDecorator as the base class for defining new
9 | * test decorators. Test decorator subclasses can be introduced to add behaviour
10 | * before or after a test is run.
11 | */
12 | @SuppressWarnings("deprecation")
13 | public class TestDecorator extends Assert implements Test {
14 | protected Test fTest;
15 |
16 | public TestDecorator(Test test) {
17 | fTest = test;
18 | }
19 |
20 | /**
21 | * The basic run behaviour.
22 | */
23 | public void basicRun(TestResult result) {
24 | fTest.run(result);
25 | }
26 |
27 | public int countTestCases() {
28 | return fTest.countTestCases();
29 | }
30 |
31 | public void run(TestResult result) {
32 | basicRun(result);
33 | }
34 |
35 | @Override
36 | public String toString() {
37 | return fTest.toString();
38 | }
39 |
40 | public Test getTest() {
41 | return fTest;
42 | }
43 | }
--------------------------------------------------------------------------------
/source_to_parse/junit-master/src/main/java/junit/extensions/TestSetup.java:
--------------------------------------------------------------------------------
1 | package junit.extensions;
2 |
3 | import junit.framework.Protectable;
4 | import junit.framework.Test;
5 | import junit.framework.TestResult;
6 |
7 | /**
8 | * A Decorator to set up and tear down additional fixture state. Subclass
9 | * TestSetup and insert it into your tests when you want to set up additional
10 | * state once before the tests are run.
11 | */
12 | public class TestSetup extends TestDecorator {
13 |
14 | public TestSetup(Test test) {
15 | super(test);
16 | }
17 |
18 | @Override
19 | public void run(final TestResult result) {
20 | Protectable p = new Protectable() {
21 | public void protect() throws Exception {
22 | setUp();
23 | basicRun(result);
24 | tearDown();
25 | }
26 | };
27 | result.runProtected(this, p);
28 | }
29 |
30 | /**
31 | * Sets up the fixture. Override to set up additional fixture state.
32 | */
33 | protected void setUp() throws Exception {
34 | }
35 |
36 | /**
37 | * Tears down the fixture. Override to tear down the additional fixture
38 | * state.
39 | */
40 | protected void tearDown() throws Exception {
41 | }
42 | }
--------------------------------------------------------------------------------
/source_to_parse/junit-master/src/main/java/junit/extensions/package-info.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Provides extended functionality for JUnit v3.x.
3 | */
4 | package junit.extensions;
--------------------------------------------------------------------------------
/source_to_parse/junit-master/src/main/java/junit/framework/AssertionFailedError.java:
--------------------------------------------------------------------------------
1 | package junit.framework;
2 |
3 | /**
4 | * Thrown when an assertion failed.
5 | */
6 | public class AssertionFailedError extends AssertionError {
7 |
8 | private static final long serialVersionUID = 1L;
9 |
10 | /**
11 | * Constructs a new AssertionFailedError without a detail message.
12 | */
13 | public AssertionFailedError() {
14 | }
15 |
16 | /**
17 | * Constructs a new AssertionFailedError with the specified detail message.
18 | * A null message is replaced by an empty String.
19 | * @param message the detail message. The detail message is saved for later
20 | * retrieval by the {@code Throwable.getMessage()} method.
21 | */
22 | public AssertionFailedError(String message) {
23 | super(defaultString(message));
24 | }
25 |
26 | private static String defaultString(String message) {
27 | return message == null ? "" : message;
28 | }
29 | }
--------------------------------------------------------------------------------
/source_to_parse/junit-master/src/main/java/junit/framework/ComparisonFailure.java:
--------------------------------------------------------------------------------
1 | package junit.framework;
2 |
3 | /**
4 | * Thrown when an assert equals for Strings failed.
5 | *
6 | * Inspired by a patch from Alex Chaffee mailto:alex@purpletech.com
7 | */
8 | public class ComparisonFailure extends AssertionFailedError {
9 | private static final int MAX_CONTEXT_LENGTH = 20;
10 | private static final long serialVersionUID = 1L;
11 |
12 | private String fExpected;
13 | private String fActual;
14 |
15 | /**
16 | * Constructs a comparison failure.
17 | *
18 | * @param message the identifying message or null
19 | * @param expected the expected string value
20 | * @param actual the actual string value
21 | */
22 | public ComparisonFailure(String message, String expected, String actual) {
23 | super(message);
24 | fExpected = expected;
25 | fActual = actual;
26 | }
27 |
28 | /**
29 | * Returns "..." in place of common prefix and "..." in
30 | * place of common suffix between expected and actual.
31 | *
32 | * @see Throwable#getMessage()
33 | */
34 | @Override
35 | public String getMessage() {
36 | return new ComparisonCompactor(MAX_CONTEXT_LENGTH, fExpected, fActual).compact(super.getMessage());
37 | }
38 |
39 | /**
40 | * Gets the actual string value
41 | *
42 | * @return the actual string value
43 | */
44 | public String getActual() {
45 | return fActual;
46 | }
47 |
48 | /**
49 | * Gets the expected string value
50 | *
51 | * @return the expected string value
52 | */
53 | public String getExpected() {
54 | return fExpected;
55 | }
56 | }
--------------------------------------------------------------------------------
/source_to_parse/junit-master/src/main/java/junit/framework/JUnit4TestCaseFacade.java:
--------------------------------------------------------------------------------
1 | package junit.framework;
2 |
3 | import org.junit.runner.Describable;
4 | import org.junit.runner.Description;
5 |
6 | public class JUnit4TestCaseFacade implements Test, Describable {
7 | private final Description fDescription;
8 |
9 | JUnit4TestCaseFacade(Description description) {
10 | fDescription = description;
11 | }
12 |
13 | @Override
14 | public String toString() {
15 | return getDescription().toString();
16 | }
17 |
18 | public int countTestCases() {
19 | return 1;
20 | }
21 |
22 | public void run(TestResult result) {
23 | throw new RuntimeException(
24 | "This test stub created only for informational purposes.");
25 | }
26 |
27 | public Description getDescription() {
28 | return fDescription;
29 | }
30 | }
--------------------------------------------------------------------------------
/source_to_parse/junit-master/src/main/java/junit/framework/Protectable.java:
--------------------------------------------------------------------------------
1 | package junit.framework;
2 |
3 | /**
4 | * A Protectable can be run and can throw a Throwable.
5 | *
6 | * @see TestResult
7 | */
8 | public interface Protectable {
9 |
10 | /**
11 | * Run the the following method protected.
12 | */
13 | public abstract void protect() throws Throwable;
14 | }
--------------------------------------------------------------------------------
/source_to_parse/junit-master/src/main/java/junit/framework/Test.java:
--------------------------------------------------------------------------------
1 | package junit.framework;
2 |
3 | /**
4 | * A Test can be run and collect its results.
5 | *
6 | * @see TestResult
7 | */
8 | public interface Test {
9 | /**
10 | * Counts the number of test cases that will be run by this test.
11 | */
12 | public abstract int countTestCases();
13 |
14 | /**
15 | * Runs a test and collects its result in a TestResult instance.
16 | */
17 | public abstract void run(TestResult result);
18 | }
--------------------------------------------------------------------------------
/source_to_parse/junit-master/src/main/java/junit/framework/TestListener.java:
--------------------------------------------------------------------------------
1 | package junit.framework;
2 |
3 | /**
4 | * A Listener for test progress
5 | */
6 | public interface TestListener {
7 | /**
8 | * An error occurred.
9 | */
10 | public void addError(Test test, Throwable e);
11 |
12 | /**
13 | * A failure occurred.
14 | */
15 | public void addFailure(Test test, AssertionFailedError e);
16 |
17 | /**
18 | * A test ended.
19 | */
20 | public void endTest(Test test);
21 |
22 | /**
23 | * A test started.
24 | */
25 | public void startTest(Test test);
26 | }
--------------------------------------------------------------------------------
/source_to_parse/junit-master/src/main/java/junit/framework/package-info.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Provides JUnit v3.x core classes.
3 | */
4 | package junit.framework;
--------------------------------------------------------------------------------
/source_to_parse/junit-master/src/main/java/junit/runner/TestRunListener.java:
--------------------------------------------------------------------------------
1 | package junit.runner;
2 |
3 | /**
4 | * A listener interface for observing the
5 | * execution of a test run. Unlike TestListener,
6 | * this interface using only primitive objects,
7 | * making it suitable for remote test execution.
8 | */
9 | public interface TestRunListener {
10 | /* test status constants*/
11 | public static final int STATUS_ERROR = 1;
12 | public static final int STATUS_FAILURE = 2;
13 |
14 | public void testRunStarted(String testSuiteName, int testCount);
15 |
16 | public void testRunEnded(long elapsedTime);
17 |
18 | public void testRunStopped(long elapsedTime);
19 |
20 | public void testStarted(String testName);
21 |
22 | public void testEnded(String testName);
23 |
24 | public void testFailed(int status, String testName, String trace);
25 | }
26 |
--------------------------------------------------------------------------------
/source_to_parse/junit-master/src/main/java/junit/runner/Version.java:
--------------------------------------------------------------------------------
1 | package junit.runner;
2 |
3 | /**
4 | * This class defines the current version of JUnit
5 | */
6 | public class Version {
7 | private Version() {
8 | // don't instantiate
9 | }
10 |
11 | public static String id() {
12 | return "4.13-SNAPSHOT";
13 | }
14 |
15 | public static void main(String[] args) {
16 | System.out.println(id());
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/source_to_parse/junit-master/src/main/java/junit/runner/Version.java.template:
--------------------------------------------------------------------------------
1 | package junit.runner;
2 |
3 | /**
4 | * This class defines the current version of JUnit
5 | */
6 | public class Version {
7 | private Version() {
8 | // don't instantiate
9 | }
10 |
11 | public static String id() {
12 | return "@version@";
13 | }
14 |
15 | public static void main(String[] args) {
16 | System.out.println(id());
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/source_to_parse/junit-master/src/main/java/junit/runner/package-info.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Provides JUnit v3.x test runners.
3 | */
4 | package junit.runner;
--------------------------------------------------------------------------------
/source_to_parse/junit-master/src/main/java/junit/textui/package-info.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Provides JUnit v3.x command line based tool to run tests.
3 | */
4 | package junit.textui;
--------------------------------------------------------------------------------
/source_to_parse/junit-master/src/main/java/org/junit/After.java:
--------------------------------------------------------------------------------
1 | package org.junit;
2 |
3 | import java.lang.annotation.ElementType;
4 | import java.lang.annotation.Retention;
5 | import java.lang.annotation.RetentionPolicy;
6 | import java.lang.annotation.Target;
7 |
8 | /**
9 | * If you allocate external resources in a {@link org.junit.Before} method you need to release them
10 | * after the test runs. Annotating a public void method
11 | * with @After causes that method to be run after the {@link org.junit.Test} method. All @After
12 | * methods are guaranteed to run even if a {@link org.junit.Before} or {@link org.junit.Test} method throws an
13 | * exception. The @After methods declared in superclasses will be run after those of the current
14 | * class, unless they are overridden in the current class.
15 | *
16 | * Here is a simple example:
17 | *
18 | * public class Example {
19 | * File output;
20 | * @Before public void createOutputFile() {
21 | * output= new File(...);
22 | * }
23 | * @Test public void something() {
24 | * ...
25 | * }
26 | * @After public void deleteOutputFile() {
27 | * output.delete();
28 | * }
29 | * }
30 | *
31 | *
32 | * @see org.junit.Before
33 | * @see org.junit.Test
34 | * @since 4.0
35 | */
36 |
37 | @Retention(RetentionPolicy.RUNTIME)
38 | @Target(ElementType.METHOD)
39 | public @interface After {
40 | }
41 |
42 |
--------------------------------------------------------------------------------
/source_to_parse/junit-master/src/main/java/org/junit/AfterClass.java:
--------------------------------------------------------------------------------
1 | package org.junit;
2 |
3 | import java.lang.annotation.ElementType;
4 | import java.lang.annotation.Retention;
5 | import java.lang.annotation.RetentionPolicy;
6 | import java.lang.annotation.Target;
7 |
8 | /**
9 | * If you allocate expensive external resources in a {@link org.junit.BeforeClass} method you need to release them
10 | * after all the tests in the class have run. Annotating a public static void method
11 | * with @AfterClass causes that method to be run after all the tests in the class have been run. All @AfterClass
12 | * methods are guaranteed to run even if a {@link org.junit.BeforeClass} method throws an
13 | * exception. The @AfterClass methods declared in superclasses will be run after those of the current
14 | * class, unless they are shadowed in the current class.
15 | *
34 | *
35 | * @see org.junit.BeforeClass
36 | * @see org.junit.Test
37 | * @since 4.0
38 | */
39 | @Retention(RetentionPolicy.RUNTIME)
40 | @Target(ElementType.METHOD)
41 | public @interface AfterClass {
42 | }
43 |
--------------------------------------------------------------------------------
/source_to_parse/junit-master/src/main/java/org/junit/AssumptionViolatedException.java:
--------------------------------------------------------------------------------
1 | package org.junit;
2 |
3 | import org.hamcrest.Matcher;
4 |
5 | /**
6 | * An exception class used to implement assumptions (state in which a given test
7 | * is meaningful and should or should not be executed). A test for which an assumption
8 | * fails should not generate a test case failure.
9 | *
10 | * @see org.junit.Assume
11 | * @since 4.12
12 | */
13 | @SuppressWarnings("deprecation")
14 | public class AssumptionViolatedException extends org.junit.internal.AssumptionViolatedException {
15 | private static final long serialVersionUID = 1L;
16 |
17 | /**
18 | * An assumption exception with the given actual value and a matcher describing
19 | * the expectation that failed.
20 | */
21 | @Deprecated
22 | public AssumptionViolatedException(T actual, Matcher matcher) {
23 | super(actual, matcher);
24 | }
25 |
26 | /**
27 | * An assumption exception with a message with the given actual value and a
28 | * matcher describing the expectation that failed.
29 | */
30 | @Deprecated
31 | public AssumptionViolatedException(String message, T expected, Matcher matcher) {
32 | super(message, expected, matcher);
33 | }
34 |
35 | /**
36 | * An assumption exception with the given message only.
37 | */
38 | public AssumptionViolatedException(String message) {
39 | super(message);
40 | }
41 |
42 | /**
43 | * An assumption exception with the given message and a cause.
44 | */
45 | public AssumptionViolatedException(String assumption, Throwable t) {
46 | super(assumption, t);
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/source_to_parse/junit-master/src/main/java/org/junit/Before.java:
--------------------------------------------------------------------------------
1 | package org.junit;
2 |
3 | import java.lang.annotation.ElementType;
4 | import java.lang.annotation.Retention;
5 | import java.lang.annotation.RetentionPolicy;
6 | import java.lang.annotation.Target;
7 |
8 | /**
9 | * When writing tests, it is common to find that several tests need similar
10 | * objects created before they can run. Annotating a public void method
11 | * with @Before causes that method to be run before the {@link org.junit.Test} method.
12 | * The @Before methods of superclasses will be run before those of the current class,
13 | * unless they are overridden in the current class. No other ordering is defined.
14 | *
15 | * Here is a simple example:
16 | *
17 | * public class Example {
18 | * List empty;
19 | * @Before public void initialize() {
20 | * empty= new ArrayList();
21 | * }
22 | * @Test public void size() {
23 | * ...
24 | * }
25 | * @Test public void remove() {
26 | * ...
27 | * }
28 | * }
29 | *
30 | *
31 | * @see org.junit.BeforeClass
32 | * @see org.junit.After
33 | * @since 4.0
34 | */
35 | @Retention(RetentionPolicy.RUNTIME)
36 | @Target(ElementType.METHOD)
37 | public @interface Before {
38 | }
39 |
40 |
--------------------------------------------------------------------------------
/source_to_parse/junit-master/src/main/java/org/junit/BeforeClass.java:
--------------------------------------------------------------------------------
1 | package org.junit;
2 |
3 | import java.lang.annotation.ElementType;
4 | import java.lang.annotation.Retention;
5 | import java.lang.annotation.RetentionPolicy;
6 | import java.lang.annotation.Target;
7 |
8 | /**
9 | * Sometimes several tests need to share computationally expensive setup
10 | * (like logging into a database). While this can compromise the independence of
11 | * tests, sometimes it is a necessary optimization. Annotating a public static void no-arg method
12 | * with @BeforeClass causes it to be run once before any of
13 | * the test methods in the class. The @BeforeClass methods of superclasses
14 | * will be run before those of the current class, unless they are shadowed in the current class.
15 | *
30 | *
31 | * @see org.junit.AfterClass
32 | * @since 4.0
33 | */
34 | @Retention(RetentionPolicy.RUNTIME)
35 | @Target(ElementType.METHOD)
36 | public @interface BeforeClass {
37 | }
38 |
--------------------------------------------------------------------------------
/source_to_parse/junit-master/src/main/java/org/junit/FixMethodOrder.java:
--------------------------------------------------------------------------------
1 | package org.junit;
2 |
3 | import java.lang.annotation.ElementType;
4 | import java.lang.annotation.Retention;
5 | import java.lang.annotation.RetentionPolicy;
6 | import java.lang.annotation.Target;
7 |
8 | import org.junit.runners.MethodSorters;
9 |
10 | /**
11 | * This class allows the user to choose the order of execution of the methods within a test class.
12 | *
13 | *
The default order of execution of JUnit tests within a class is deterministic but not predictable.
14 | * The order of execution is not guaranteed for Java 7 (and some previous versions), and can even change
15 | * from run to run, so the order of execution was changed to be deterministic (in JUnit 4.11)
16 | *
17 | *
It is recommended that test methods be written so that they are independent of the order that they are executed.
18 | * However, there may be a number of dependent tests either through error or by design.
19 | * This class allows the user to specify the order of execution of test methods.
20 | *
21 | *
For possibilities, see {@link MethodSorters}
22 | *
23 | * Here is an example:
24 | *
25 | *
26 | * @FixMethodOrder(MethodSorters.NAME_ASCENDING)
27 | * public class MyTest {
28 | * }
29 | *
30 | *
31 | * @see org.junit.runners.MethodSorters
32 | * @since 4.11
33 | */
34 | @Retention(RetentionPolicy.RUNTIME)
35 | @Target({ElementType.TYPE})
36 | public @interface FixMethodOrder {
37 | /**
38 | * Optionally specify value to have the methods executed in a particular order
39 | */
40 | MethodSorters value() default MethodSorters.DEFAULT;
41 | }
42 |
--------------------------------------------------------------------------------
/source_to_parse/junit-master/src/main/java/org/junit/Ignore.java:
--------------------------------------------------------------------------------
1 | package org.junit;
2 |
3 | import java.lang.annotation.ElementType;
4 | import java.lang.annotation.Retention;
5 | import java.lang.annotation.RetentionPolicy;
6 | import java.lang.annotation.Target;
7 |
8 | /**
9 | * Sometimes you want to temporarily disable a test or a group of tests. Methods annotated with
10 | * {@link org.junit.Test} that are also annotated with @Ignore will not be executed as tests.
11 | * Also, you can annotate a class containing test methods with @Ignore and none of the containing
12 | * tests will be executed. Native JUnit 4 test runners should report the number of ignored tests along with the
13 | * number of tests that ran and the number of tests that failed.
14 | *
15 | *