├── settings.gradle ├── .gitignore ├── source_to_parse └── junit-master │ ├── doc │ ├── ReleaseNotes4.10.txt │ ├── ReleaseNotes4.11.txt │ ├── ReleaseNotes4.4.txt │ ├── ReleaseNotes4.5.txt │ ├── ReleaseNotes4.6.txt │ ├── ReleaseNotes4.7.txt │ ├── ReleaseNotes4.8.txt │ ├── ReleaseNotes4.9.txt │ ├── ReleaseNotes4.8.1.txt │ ├── ReleaseNotes4.8.2.txt │ ├── ReleaseNotes4.9.1.txt │ ├── markdown.sh │ ├── cookstour │ │ ├── Image1.gif │ │ ├── Image2.gif │ │ ├── Image3.gif │ │ ├── Image4.gif │ │ ├── Image5.gif │ │ ├── Image6.gif │ │ ├── Image7.gif │ │ └── cookstour.htm │ ├── testinfected │ │ ├── logo.gif │ │ ├── testing.htm │ │ ├── IMG00001.GIF │ │ ├── IMG00002.GIF │ │ └── IMG00003.GIF │ ├── ReleaseNotes4.8.1.md │ ├── ReleaseNotes4.13.md │ ├── ReleaseNotes4.8.2.md │ ├── ReleaseNotes4.8.1.html │ ├── ReleaseNotes4.8.2.html │ ├── ReleaseNotes4.9.1.md │ ├── index.htm │ ├── ReleaseNotes4.8.md │ └── ReleaseNotes4.8.html │ ├── src │ ├── test │ │ ├── java │ │ │ ├── junit │ │ │ │ ├── samples │ │ │ │ │ ├── package-info.java │ │ │ │ │ ├── money │ │ │ │ │ │ ├── package-info.java │ │ │ │ │ │ └── IMoney.java │ │ │ │ │ └── AllTests.java │ │ │ │ └── tests │ │ │ │ │ ├── package-info.java │ │ │ │ │ ├── framework │ │ │ │ │ ├── package-info.java │ │ │ │ │ ├── InheritedTestCase.java │ │ │ │ │ ├── NoTestCaseClass.java │ │ │ │ │ ├── OverrideTestCase.java │ │ │ │ │ ├── NoArgTestCaseTest.java │ │ │ │ │ ├── NoTestCases.java │ │ │ │ │ ├── Failure.java │ │ │ │ │ ├── NotPublicTestCase.java │ │ │ │ │ ├── NotVoidTestCase.java │ │ │ │ │ ├── Success.java │ │ │ │ │ ├── OneTestCase.java │ │ │ │ │ ├── ThreeTestCases.java │ │ │ │ │ ├── AssertionFailedErrorTest.java │ │ │ │ │ ├── AllTests.java │ │ │ │ │ ├── ComparisonFailureTest.java │ │ │ │ │ ├── DoublePrecisionAssertTest.java │ │ │ │ │ └── TestImplementorTest.java │ │ │ │ │ ├── runner │ │ │ │ │ ├── package-info.java │ │ │ │ │ ├── AllTests.java │ │ │ │ │ ├── TextRunnerSingleMethodTest.java │ │ │ │ │ └── BaseTestRunnerTest.java │ │ │ │ │ ├── extensions │ │ │ │ │ ├── package-info.java │ │ │ │ │ └── AllTests.java │ │ │ │ │ ├── WasRun.java │ │ │ │ │ └── AllTests.java │ │ │ └── org │ │ │ │ └── junit │ │ │ │ ├── samples │ │ │ │ ├── package-info.java │ │ │ │ ├── money │ │ │ │ │ └── package-info.java │ │ │ │ └── SimpleTest.java │ │ │ │ ├── tests │ │ │ │ ├── validation │ │ │ │ │ ├── anotherpackage │ │ │ │ │ │ ├── Sub.java │ │ │ │ │ │ └── Super.java │ │ │ │ │ ├── FailedConstructionTest.java │ │ │ │ │ └── ValidationTest.java │ │ │ │ ├── package-info.java │ │ │ │ ├── experimental │ │ │ │ │ ├── theories │ │ │ │ │ │ ├── extendingwithstubs │ │ │ │ │ │ │ ├── Correspondent.java │ │ │ │ │ │ │ ├── Stub.java │ │ │ │ │ │ │ ├── ReguessableValue.java │ │ │ │ │ │ │ ├── StubbedTheoriesTest.java │ │ │ │ │ │ │ ├── StringableObject.java │ │ │ │ │ │ │ └── MethodCall.java │ │ │ │ │ │ ├── TestedOnSupplierTest.java │ │ │ │ │ │ ├── TheoryTestUtils.java │ │ │ │ │ │ ├── AssumingInTheoriesTest.java │ │ │ │ │ │ └── runner │ │ │ │ │ │ │ └── TheoriesPerformanceTest.java │ │ │ │ │ ├── results │ │ │ │ │ │ └── ResultMatchersTest.java │ │ │ │ │ ├── rules │ │ │ │ │ │ ├── LoggingTestWatcher.java │ │ │ │ │ │ ├── ExternalResourceRuleTest.java │ │ │ │ │ │ └── NameRulesTest.java │ │ │ │ │ └── max │ │ │ │ │ │ └── JUnit38SortingTest.java │ │ │ │ ├── junit3compatibility │ │ │ │ │ ├── OldTests.java │ │ │ │ │ ├── ClassRequestTest.java │ │ │ │ │ └── OldTestClassAdaptingListenerTest.java │ │ │ │ ├── running │ │ │ │ │ ├── classes │ │ │ │ │ │ ├── IgnoreClassTest.java │ │ │ │ │ │ ├── BlockJUnit4ClassRunnerTest.java │ │ │ │ │ │ ├── UseSuiteAsASuperclassTest.java │ │ │ │ │ │ └── EnclosedTest.java │ │ │ │ │ ├── methods │ │ │ │ │ │ └── InheritedTestTest.java │ │ │ │ │ └── core │ │ │ │ │ │ ├── SystemExitTest.java │ │ │ │ │ │ └── JUnitCoreReturnsCorrectExitCodeTest.java │ │ │ │ ├── TestSystem.java │ │ │ │ ├── description │ │ │ │ │ ├── TestDescriptionTest.java │ │ │ │ │ ├── SuiteDescriptionTest.java │ │ │ │ │ └── TestDescriptionMethodNameTest.java │ │ │ │ ├── listening │ │ │ │ │ ├── UserStopTest.java │ │ │ │ │ └── ListenerTest.java │ │ │ │ ├── internal │ │ │ │ │ └── runners │ │ │ │ │ │ └── ErrorReportingRunnerTest.java │ │ │ │ ├── ObjectContractTest.java │ │ │ │ └── manipulation │ │ │ │ │ └── FilterTest.java │ │ │ │ ├── runners │ │ │ │ ├── model │ │ │ │ │ └── RunnerBuilderStub.java │ │ │ │ └── parameterized │ │ │ │ │ ├── ParameterizedNamesTest.java │ │ │ │ │ └── BlockJUnit4ClassRunnerWithParametersTest.java │ │ │ │ ├── internal │ │ │ │ └── matchers │ │ │ │ │ ├── ThrowableCauseMatcherTest.java │ │ │ │ │ └── StacktracePrintingMatcherTest.java │ │ │ │ ├── runner │ │ │ │ ├── JUnitCoreTest.java │ │ │ │ └── RunnerSpy.java │ │ │ │ └── validator │ │ │ │ └── PublicClassValidatorTest.java │ │ └── resources │ │ │ └── junit │ │ │ └── tests │ │ │ └── runner │ │ │ ├── testRunFailureResultCanBeSerialised │ │ │ └── testRunSuccessResultCanBeSerialised │ ├── main │ │ ├── java │ │ │ ├── junit │ │ │ │ ├── runner │ │ │ │ │ ├── package-info.java │ │ │ │ │ ├── Version.java │ │ │ │ │ ├── Version.java.template │ │ │ │ │ └── TestRunListener.java │ │ │ │ ├── framework │ │ │ │ │ ├── package-info.java │ │ │ │ │ ├── Protectable.java │ │ │ │ │ ├── Test.java │ │ │ │ │ ├── TestListener.java │ │ │ │ │ ├── JUnit4TestCaseFacade.java │ │ │ │ │ ├── AssertionFailedError.java │ │ │ │ │ └── ComparisonFailure.java │ │ │ │ ├── extensions │ │ │ │ │ ├── package-info.java │ │ │ │ │ ├── RepeatedTest.java │ │ │ │ │ ├── TestDecorator.java │ │ │ │ │ └── TestSetup.java │ │ │ │ └── textui │ │ │ │ │ └── package-info.java │ │ │ └── org │ │ │ │ └── junit │ │ │ │ ├── runner │ │ │ │ ├── notification │ │ │ │ │ ├── package-info.java │ │ │ │ │ └── StoppedByUserException.java │ │ │ │ ├── package-info.java │ │ │ │ ├── manipulation │ │ │ │ │ ├── package-info.java │ │ │ │ │ ├── NoTestsRemainException.java │ │ │ │ │ ├── Filterable.java │ │ │ │ │ ├── Sortable.java │ │ │ │ │ └── Sorter.java │ │ │ │ ├── Describable.java │ │ │ │ ├── FilterFactoryParams.java │ │ │ │ ├── FilterFactory.java │ │ │ │ ├── RunWith.java │ │ │ │ ├── Computer.java │ │ │ │ └── Runner.java │ │ │ │ ├── internal │ │ │ │ ├── runners │ │ │ │ │ ├── package-info.java │ │ │ │ │ ├── statements │ │ │ │ │ │ ├── Fail.java │ │ │ │ │ │ ├── InvokeMethod.java │ │ │ │ │ │ ├── RunBefores.java │ │ │ │ │ │ ├── RunAfters.java │ │ │ │ │ │ └── ExpectException.java │ │ │ │ │ ├── model │ │ │ │ │ │ ├── MultipleFailureException.java │ │ │ │ │ │ ├── ReflectiveCallable.java │ │ │ │ │ │ └── EachTestNotifier.java │ │ │ │ │ ├── FailedBefore.java │ │ │ │ │ ├── rules │ │ │ │ │ │ └── ValidationError.java │ │ │ │ │ ├── InitializationError.java │ │ │ │ │ └── SuiteMethod.java │ │ │ │ ├── requests │ │ │ │ │ ├── package-info.java │ │ │ │ │ ├── SortingRequest.java │ │ │ │ │ ├── ClassRequest.java │ │ │ │ │ └── FilterRequest.java │ │ │ │ ├── JUnitSystem.java │ │ │ │ ├── ExactComparisonCriteria.java │ │ │ │ ├── builders │ │ │ │ │ ├── NullBuilder.java │ │ │ │ │ ├── JUnit4Builder.java │ │ │ │ │ ├── IgnoredBuilder.java │ │ │ │ │ ├── JUnit3Builder.java │ │ │ │ │ ├── IgnoredClassRunner.java │ │ │ │ │ ├── SuiteMethodBuilder.java │ │ │ │ │ └── AllDefaultPossibilitiesBuilder.java │ │ │ │ ├── RealSystem.java │ │ │ │ ├── InexactComparisonCriteria.java │ │ │ │ ├── Classes.java │ │ │ │ ├── matchers │ │ │ │ │ └── ThrowableMessageMatcher.java │ │ │ │ └── Throwables.java │ │ │ │ ├── package-info.java │ │ │ │ ├── runners │ │ │ │ ├── package-info.java │ │ │ │ ├── model │ │ │ │ │ ├── Statement.java │ │ │ │ │ ├── Annotatable.java │ │ │ │ │ ├── RunnerScheduler.java │ │ │ │ │ ├── FrameworkMember.java │ │ │ │ │ ├── TestTimedOutException.java │ │ │ │ │ └── InitializationError.java │ │ │ │ ├── parameterized │ │ │ │ │ ├── BlockJUnit4ClassRunnerWithParametersFactory.java │ │ │ │ │ └── ParametersRunnerFactory.java │ │ │ │ ├── AllTests.java │ │ │ │ ├── JUnit4.java │ │ │ │ └── MethodSorters.java │ │ │ │ ├── matchers │ │ │ │ └── package-info.java │ │ │ │ ├── experimental │ │ │ │ ├── max │ │ │ │ │ └── CouldNotReadCoreException.java │ │ │ │ ├── theories │ │ │ │ │ ├── Theory.java │ │ │ │ │ ├── internal │ │ │ │ │ │ ├── BooleanSupplier.java │ │ │ │ │ │ ├── EnumSupplier.java │ │ │ │ │ │ └── ParameterizedAssertionError.java │ │ │ │ │ ├── suppliers │ │ │ │ │ │ ├── TestedOnSupplier.java │ │ │ │ │ │ └── TestedOn.java │ │ │ │ │ └── ParametersSuppliedBy.java │ │ │ │ ├── results │ │ │ │ │ └── FailureList.java │ │ │ │ ├── categories │ │ │ │ │ └── Category.java │ │ │ │ └── runners │ │ │ │ │ └── Enclosed.java │ │ │ │ ├── validator │ │ │ │ ├── TestClassValidator.java │ │ │ │ ├── ValidateWith.java │ │ │ │ ├── PublicClassValidator.java │ │ │ │ └── AnnotationValidatorFactory.java │ │ │ │ ├── rules │ │ │ │ ├── RunRules.java │ │ │ │ ├── TestName.java │ │ │ │ ├── ExpectedExceptionMatcherBuilder.java │ │ │ │ ├── MethodRule.java │ │ │ │ └── Verifier.java │ │ │ │ ├── Before.java │ │ │ │ ├── BeforeClass.java │ │ │ │ ├── After.java │ │ │ │ ├── AfterClass.java │ │ │ │ ├── FixMethodOrder.java │ │ │ │ ├── Ignore.java │ │ │ │ └── AssumptionViolatedException.java │ │ ├── resources │ │ │ └── junit │ │ │ │ └── runner │ │ │ │ ├── logo.gif │ │ │ │ └── smalllogo.gif │ │ └── javadoc │ │ │ └── stylesheet.css │ ├── site │ │ └── resources │ │ │ ├── css │ │ │ └── plain-links.css │ │ │ ├── images │ │ │ └── junit-logo.png │ │ │ └── scripts │ │ │ └── index.js │ └── changes │ │ └── changes.xml │ ├── lib │ ├── hamcrest-core-1.3.jar │ └── hamcrest-core-1.3-sources.jar │ ├── .travis.yml │ ├── .gitignore │ ├── CODING_STYLE.txt │ ├── NOTICE.txt │ ├── .project │ ├── BUILDING │ ├── .classpath │ ├── .settings │ └── org.eclipse.jdt.ui.prefs │ ├── README.md │ ├── to-do.txt │ └── CONTRIBUTING.md ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── src └── main │ ├── resources │ └── ASimpleClass.java │ └── java │ └── me │ └── tomassetti │ ├── support │ └── DirExplorer.java │ └── examples │ ├── StatementsLinesExample.java │ ├── ListClassesExample.java │ └── MethodCallsExample.java └── README.md /settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'analyze-java-code' 2 | 3 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | *.iml 3 | .gradle 4 | *.ipr 5 | *.iws 6 | out 7 | build -------------------------------------------------------------------------------- /source_to_parse/junit-master/doc/ReleaseNotes4.10.txt: -------------------------------------------------------------------------------- 1 | Please see ReleaseNotes4.10.md 2 | -------------------------------------------------------------------------------- /source_to_parse/junit-master/doc/ReleaseNotes4.11.txt: -------------------------------------------------------------------------------- 1 | Please see ReleaseNotes4.11.md 2 | -------------------------------------------------------------------------------- /source_to_parse/junit-master/doc/ReleaseNotes4.4.txt: -------------------------------------------------------------------------------- 1 | Please see ReleaseNotes4.4.md 2 | -------------------------------------------------------------------------------- /source_to_parse/junit-master/doc/ReleaseNotes4.5.txt: -------------------------------------------------------------------------------- 1 | Please see ReleaseNotes4.5.md 2 | -------------------------------------------------------------------------------- /source_to_parse/junit-master/doc/ReleaseNotes4.6.txt: -------------------------------------------------------------------------------- 1 | Please see ReleaseNotes4.6.md 2 | -------------------------------------------------------------------------------- /source_to_parse/junit-master/doc/ReleaseNotes4.7.txt: -------------------------------------------------------------------------------- 1 | Please see ReleaseNotes4.7.md 2 | -------------------------------------------------------------------------------- /source_to_parse/junit-master/doc/ReleaseNotes4.8.txt: -------------------------------------------------------------------------------- 1 | Please see ReleaseNotes4.8.md 2 | -------------------------------------------------------------------------------- /source_to_parse/junit-master/doc/ReleaseNotes4.9.txt: -------------------------------------------------------------------------------- 1 | Please see ReleaseNotes4.9.md 2 | -------------------------------------------------------------------------------- /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.txt: -------------------------------------------------------------------------------- 1 | Please see ReleaseNotes4.8.2.md 2 | -------------------------------------------------------------------------------- /source_to_parse/junit-master/doc/ReleaseNotes4.9.1.txt: -------------------------------------------------------------------------------- 1 | Please see ReleaseNotes4.9.1.md 2 | -------------------------------------------------------------------------------- /source_to_parse/junit-master/doc/markdown.sh: -------------------------------------------------------------------------------- 1 | ~/bin/Markdown.pl ReleaseNotes4.8.txt >ReleaseNotes4.8.html -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ftomassetti/analyze-java-code-examples/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /source_to_parse/junit-master/src/test/java/junit/samples/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * JUnit v3.x examples. 3 | */ 4 | package junit.samples; -------------------------------------------------------------------------------- /source_to_parse/junit-master/src/test/java/junit/tests/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Tests the JUnit v3.x framework. 3 | */ 4 | package junit.tests; -------------------------------------------------------------------------------- /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/framework/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Provides JUnit v3.x core classes. 3 | */ 4 | package junit.framework; -------------------------------------------------------------------------------- /source_to_parse/junit-master/src/site/resources/css/plain-links.css: -------------------------------------------------------------------------------- 1 | a.externalLink { 2 | background: none !important; 3 | padding-right: 0 !important; 4 | } -------------------------------------------------------------------------------- /source_to_parse/junit-master/src/test/java/junit/samples/money/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Example "Money" for JUnit v3.x. 3 | */ 4 | package junit.samples.money; -------------------------------------------------------------------------------- /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/test/java/junit/tests/framework/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Tests the JUnit v3.x core classes. 3 | */ 4 | package junit.tests.framework; -------------------------------------------------------------------------------- /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/test/java/junit/tests/runner/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Tests for the JUnit v3.x runner functionality. 3 | */ 4 | package junit.tests.runner; -------------------------------------------------------------------------------- /source_to_parse/junit-master/doc/cookstour/Image1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ftomassetti/analyze-java-code-examples/HEAD/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/HEAD/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/HEAD/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/HEAD/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/HEAD/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/HEAD/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/HEAD/source_to_parse/junit-master/doc/cookstour/Image7.gif -------------------------------------------------------------------------------- /source_to_parse/junit-master/doc/testinfected/logo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ftomassetti/analyze-java-code-examples/HEAD/source_to_parse/junit-master/doc/testinfected/logo.gif -------------------------------------------------------------------------------- /source_to_parse/junit-master/lib/hamcrest-core-1.3.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ftomassetti/analyze-java-code-examples/HEAD/source_to_parse/junit-master/lib/hamcrest-core-1.3.jar -------------------------------------------------------------------------------- /source_to_parse/junit-master/doc/cookstour/cookstour.htm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ftomassetti/analyze-java-code-examples/HEAD/source_to_parse/junit-master/doc/cookstour/cookstour.htm -------------------------------------------------------------------------------- /source_to_parse/junit-master/doc/testinfected/testing.htm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ftomassetti/analyze-java-code-examples/HEAD/source_to_parse/junit-master/doc/testinfected/testing.htm -------------------------------------------------------------------------------- /source_to_parse/junit-master/src/test/java/junit/tests/extensions/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Tests for the JUnit v3.x extension functionality. 3 | */ 4 | package junit.tests.extensions; -------------------------------------------------------------------------------- /source_to_parse/junit-master/.travis.yml: -------------------------------------------------------------------------------- 1 | language: java 2 | script: mvn verify javadoc:javadoc site:site 3 | jdk: 4 | - oraclejdk7 5 | - oraclejdk8 6 | - openjdk7 7 | - openjdk6 8 | -------------------------------------------------------------------------------- /source_to_parse/junit-master/doc/testinfected/IMG00001.GIF: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ftomassetti/analyze-java-code-examples/HEAD/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/HEAD/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/HEAD/source_to_parse/junit-master/doc/testinfected/IMG00003.GIF -------------------------------------------------------------------------------- /source_to_parse/junit-master/src/test/java/org/junit/samples/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Provides examples on how to use JUnit 4. 3 | * 4 | * @since 4.0 5 | */ 6 | package org.junit.samples; -------------------------------------------------------------------------------- /source_to_parse/junit-master/lib/hamcrest-core-1.3-sources.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ftomassetti/analyze-java-code-examples/HEAD/source_to_parse/junit-master/lib/hamcrest-core-1.3-sources.jar -------------------------------------------------------------------------------- /source_to_parse/junit-master/src/test/java/org/junit/tests/validation/anotherpackage/Sub.java: -------------------------------------------------------------------------------- 1 | package org.junit.tests.validation.anotherpackage; 2 | 3 | public class Sub extends Super { 4 | 5 | } 6 | -------------------------------------------------------------------------------- /source_to_parse/junit-master/.gitignore: -------------------------------------------------------------------------------- 1 | MaxCore.ser 2 | bin 3 | junit4.* 4 | target 5 | MaxCore.max 6 | # IntelliJ 7 | .idea 8 | *.ipr 9 | *.iml 10 | *.iws 11 | out 12 | java.hprof.txt 13 | .gitattributes -------------------------------------------------------------------------------- /source_to_parse/junit-master/src/main/resources/junit/runner/logo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ftomassetti/analyze-java-code-examples/HEAD/source_to_parse/junit-master/src/main/resources/junit/runner/logo.gif -------------------------------------------------------------------------------- /source_to_parse/junit-master/src/site/resources/images/junit-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ftomassetti/analyze-java-code-examples/HEAD/source_to_parse/junit-master/src/site/resources/images/junit-logo.png -------------------------------------------------------------------------------- /source_to_parse/junit-master/src/main/java/org/junit/runner/notification/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Provides information about a test run. 3 | * 4 | * @since 4.0 5 | */ 6 | package org.junit.runner.notification; -------------------------------------------------------------------------------- /source_to_parse/junit-master/src/main/resources/junit/runner/smalllogo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ftomassetti/analyze-java-code-examples/HEAD/source_to_parse/junit-master/src/main/resources/junit/runner/smalllogo.gif -------------------------------------------------------------------------------- /source_to_parse/junit-master/src/main/java/org/junit/runner/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Provides classes used to describe, collect, run and analyze multiple tests. 3 | * 4 | * @since 4.0 5 | */ 6 | package org.junit.runner; -------------------------------------------------------------------------------- /source_to_parse/junit-master/src/main/java/org/junit/internal/runners/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Provides implementations of {@link org.junit.runner.Runner} 3 | * 4 | * @since 4.0 5 | */ 6 | package org.junit.internal.runners; -------------------------------------------------------------------------------- /source_to_parse/junit-master/src/main/java/org/junit/internal/requests/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Provides implementations of {@link org.junit.runner.Request}. 3 | * 4 | * @since 4.0 5 | */ 6 | package org.junit.internal.requests; -------------------------------------------------------------------------------- /source_to_parse/junit-master/src/main/java/org/junit/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Provides JUnit core classes and annotations. 3 | * 4 | * Corresponds to junit.framework in Junit 3.x. 5 | * 6 | * @since 4.0 7 | */ 8 | package org.junit; -------------------------------------------------------------------------------- /source_to_parse/junit-master/src/test/java/org/junit/samples/money/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * JUnit v4.x Test for the Money example. 3 | * 4 | * @since 4.0 5 | * @see junit.samples.money.Money 6 | */ 7 | package org.junit.samples.money; -------------------------------------------------------------------------------- /source_to_parse/junit-master/src/test/java/org/junit/tests/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Tests the JUnit functionality. 3 | * 4 | * Corresponds to {@link junit.tests.AllTests} in Junit 3.x. 5 | * 6 | * @since 4.0 7 | */ 8 | package org.junit.tests; -------------------------------------------------------------------------------- /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/src/test/java/org/junit/tests/validation/anotherpackage/Super.java: -------------------------------------------------------------------------------- 1 | package org.junit.tests.validation.anotherpackage; 2 | 3 | import org.junit.Test; 4 | 5 | class Super { 6 | @Test 7 | public void a() { 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /source_to_parse/junit-master/doc/ReleaseNotes4.13.md: -------------------------------------------------------------------------------- 1 | ## Summary of changes in version 4.13 [unreleased!] 2 | 3 | We collect release notes in the wiki: 4 | https://github.com/junit-team/junit/wiki/4.13-release-notes 5 | 6 | This file will be updated right before release. 7 | -------------------------------------------------------------------------------- /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/src/test/java/junit/tests/framework/InheritedTestCase.java: -------------------------------------------------------------------------------- 1 | package junit.tests.framework; 2 | 3 | /** 4 | * Test class used in SuiteTest 5 | */ 6 | public class InheritedTestCase extends OneTestCase { 7 | public void test2() { 8 | } 9 | } -------------------------------------------------------------------------------- /source_to_parse/junit-master/src/test/java/junit/tests/framework/NoTestCaseClass.java: -------------------------------------------------------------------------------- 1 | package junit.tests.framework; 2 | 3 | /** 4 | * Test class used in SuiteTest 5 | */ 6 | public class NoTestCaseClass extends Object { 7 | public void testSuccess() { 8 | } 9 | } -------------------------------------------------------------------------------- /source_to_parse/junit-master/src/test/resources/junit/tests/runner/testRunFailureResultCanBeSerialised: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ftomassetti/analyze-java-code-examples/HEAD/source_to_parse/junit-master/src/test/resources/junit/tests/runner/testRunFailureResultCanBeSerialised -------------------------------------------------------------------------------- /source_to_parse/junit-master/src/test/resources/junit/tests/runner/testRunSuccessResultCanBeSerialised: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ftomassetti/analyze-java-code-examples/HEAD/source_to_parse/junit-master/src/test/resources/junit/tests/runner/testRunSuccessResultCanBeSerialised -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri May 14 09:26:17 CEST 2021 2 | distributionBase=GRADLE_USER_HOME 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.1-bin.zip 4 | distributionPath=wrapper/dists 5 | zipStorePath=wrapper/dists 6 | zipStoreBase=GRADLE_USER_HOME 7 | -------------------------------------------------------------------------------- /source_to_parse/junit-master/src/test/java/junit/tests/framework/OverrideTestCase.java: -------------------------------------------------------------------------------- 1 | package junit.tests.framework; 2 | 3 | /** 4 | * Test class used in SuiteTest 5 | */ 6 | public class OverrideTestCase extends OneTestCase { 7 | @Override 8 | public void testCase() { 9 | } 10 | } -------------------------------------------------------------------------------- /source_to_parse/junit-master/src/test/java/org/junit/tests/experimental/theories/extendingwithstubs/Correspondent.java: -------------------------------------------------------------------------------- 1 | package org.junit.tests.experimental.theories.extendingwithstubs; 2 | 3 | public interface Correspondent { 4 | 5 | String getAnswer(String question, String... bucket); 6 | 7 | } 8 | -------------------------------------------------------------------------------- /source_to_parse/junit-master/CODING_STYLE.txt: -------------------------------------------------------------------------------- 1 | JUnit project uses the Google Java Style (http://google-styleguide.googlecode.com/svn/trunk/javaguide.html) for all new 2 | code (under org.junit.*). Legacy code (under junit.*) used the legacy guide specified in LEGACY_CODING_STYLE.txt in the 3 | project root. 4 | -------------------------------------------------------------------------------- /source_to_parse/junit-master/doc/ReleaseNotes4.8.1.html: -------------------------------------------------------------------------------- 1 |
This was a quick bugfix release for an important bug
4 | 5 |This was a quick bugfix release
4 | 5 |StoppedByUserException.
6 | *
7 | * @see org.junit.runner.notification.RunNotifier
8 | * @since 4.0
9 | */
10 | public class StoppedByUserException extends RuntimeException {
11 | private static final long serialVersionUID = 1L;
12 | }
13 |
--------------------------------------------------------------------------------
/source_to_parse/junit-master/src/main/java/org/junit/internal/runners/FailedBefore.java:
--------------------------------------------------------------------------------
1 | package org.junit.internal.runners;
2 |
3 | import org.junit.runners.BlockJUnit4ClassRunner;
4 |
5 | /**
6 | * @deprecated Included for backwards compatibility with JUnit 4.4. Will be
7 | * removed in the next major release. Please use
8 | * {@link BlockJUnit4ClassRunner} in place of {@link JUnit4ClassRunner}.
9 | */
10 | @Deprecated
11 | class FailedBefore extends Exception {
12 | private static final long serialVersionUID = 1L;
13 | }
--------------------------------------------------------------------------------
/source_to_parse/junit-master/src/main/java/org/junit/internal/builders/IgnoredBuilder.java:
--------------------------------------------------------------------------------
1 | package org.junit.internal.builders;
2 |
3 | import org.junit.Ignore;
4 | import org.junit.runner.Runner;
5 | import org.junit.runners.model.RunnerBuilder;
6 |
7 | public class IgnoredBuilder extends RunnerBuilder {
8 | @Override
9 | public Runner runnerForClass(Class> testClass) {
10 | if (testClass.getAnnotation(Ignore.class) != null) {
11 | return new IgnoredClassRunner(testClass);
12 | }
13 | return null;
14 | }
15 | }
--------------------------------------------------------------------------------
/source_to_parse/junit-master/src/test/java/org/junit/tests/experimental/theories/extendingwithstubs/ReguessableValue.java:
--------------------------------------------------------------------------------
1 | package org.junit.tests.experimental.theories.extendingwithstubs;
2 |
3 | import java.util.List;
4 |
5 | import org.junit.experimental.theories.PotentialAssignment;
6 | import org.junit.internal.AssumptionViolatedException;
7 |
8 | public abstract class ReguessableValue extends PotentialAssignment {
9 |
10 | public ReguessableValue() {
11 | super();
12 | }
13 |
14 | public abstract Listfilter.
13 | *
14 | * @param filter the {@link Filter} to apply
15 | * @throws NoTestsRemainException if all tests are filtered out
16 | */
17 | void filter(Filter filter) throws NoTestsRemainException;
18 |
19 | }
20 |
--------------------------------------------------------------------------------
/source_to_parse/junit-master/src/main/java/org/junit/validator/ValidateWith.java:
--------------------------------------------------------------------------------
1 | package org.junit.validator;
2 |
3 | import java.lang.annotation.Inherited;
4 | import java.lang.annotation.Retention;
5 | import java.lang.annotation.RetentionPolicy;
6 |
7 | /**
8 | * Allows for an {@link AnnotationValidator} to be attached to an annotation.
9 | *
10 | * When attached to an annotation, the validator will be instantiated and invoked 11 | * by the {@link org.junit.runners.ParentRunner}.
12 | * 13 | * @since 4.12 14 | */ 15 | @Retention(RetentionPolicy.RUNTIME) 16 | @Inherited 17 | public @interface ValidateWith { 18 | Class extends AnnotationValidator> value(); 19 | } 20 | -------------------------------------------------------------------------------- /source_to_parse/junit-master/src/main/java/org/junit/internal/runners/statements/InvokeMethod.java: -------------------------------------------------------------------------------- 1 | package org.junit.internal.runners.statements; 2 | 3 | import org.junit.runners.model.FrameworkMethod; 4 | import org.junit.runners.model.Statement; 5 | 6 | public class InvokeMethod extends Statement { 7 | private final FrameworkMethod testMethod; 8 | private final Object target; 9 | 10 | public InvokeMethod(FrameworkMethod testMethod, Object target) { 11 | this.testMethod = testMethod; 12 | this.target = target; 13 | } 14 | 15 | @Override 16 | public void evaluate() throws Throwable { 17 | testMethod.invokeExplosively(target); 18 | } 19 | } -------------------------------------------------------------------------------- /source_to_parse/junit-master/src/test/java/org/junit/tests/junit3compatibility/ClassRequestTest.java: -------------------------------------------------------------------------------- 1 | package org.junit.tests.junit3compatibility; 2 | 3 | import static org.junit.Assert.assertNull; 4 | 5 | import org.junit.Test; 6 | import org.junit.internal.builders.SuiteMethodBuilder; 7 | 8 | public class ClassRequestTest { 9 | public static class PrivateSuiteMethod { 10 | static junit.framework.Test suite() { 11 | return null; 12 | } 13 | } 14 | 15 | @Test 16 | public void noSuiteMethodIfMethodPrivate() throws Throwable { 17 | assertNull(new SuiteMethodBuilder() 18 | .runnerForClass(PrivateSuiteMethod.class)); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /source_to_parse/junit-master/src/test/java/junit/samples/AllTests.java: -------------------------------------------------------------------------------- 1 | package junit.samples; 2 | 3 | import junit.framework.Test; 4 | import junit.framework.TestSuite; 5 | 6 | /** 7 | * TestSuite that runs all the sample tests 8 | */ 9 | public class AllTests { 10 | 11 | public static void main(String[] args) { 12 | junit.textui.TestRunner.run(suite()); 13 | } 14 | 15 | public static Test suite() { 16 | TestSuite suite = new TestSuite("All JUnit Tests"); 17 | suite.addTest(ListTest.suite()); 18 | suite.addTest(new TestSuite(junit.samples.money.MoneyTest.class)); 19 | suite.addTest(junit.tests.AllTests.suite()); 20 | return suite; 21 | } 22 | } -------------------------------------------------------------------------------- /source_to_parse/junit-master/src/main/java/org/junit/internal/runners/model/ReflectiveCallable.java: -------------------------------------------------------------------------------- 1 | package org.junit.internal.runners.model; 2 | 3 | import java.lang.reflect.InvocationTargetException; 4 | 5 | /** 6 | * When invoked, throws the exception from the reflected method, rather than 7 | * wrapping it in an InvocationTargetException. 8 | */ 9 | public abstract class ReflectiveCallable { 10 | public Object run() throws Throwable { 11 | try { 12 | return runReflectiveCall(); 13 | } catch (InvocationTargetException e) { 14 | throw e.getTargetException(); 15 | } 16 | } 17 | 18 | protected abstract Object runReflectiveCall() throws Throwable; 19 | } -------------------------------------------------------------------------------- /source_to_parse/junit-master/src/test/java/junit/tests/AllTests.java: -------------------------------------------------------------------------------- 1 | package junit.tests; 2 | 3 | import junit.framework.Test; 4 | import junit.framework.TestSuite; 5 | 6 | /** 7 | * TestSuite that runs all the JUnit tests 8 | */ 9 | public class AllTests { 10 | 11 | public static void main(String[] args) { 12 | junit.textui.TestRunner.run(suite()); 13 | } 14 | 15 | public static Test suite() { 16 | TestSuite suite = new TestSuite("Framework Tests"); 17 | suite.addTest(junit.tests.framework.AllTests.suite()); 18 | suite.addTest(junit.tests.runner.AllTests.suite()); 19 | suite.addTest(junit.tests.extensions.AllTests.suite()); 20 | return suite; 21 | } 22 | } -------------------------------------------------------------------------------- /source_to_parse/junit-master/src/main/java/org/junit/internal/builders/JUnit3Builder.java: -------------------------------------------------------------------------------- 1 | package org.junit.internal.builders; 2 | 3 | import org.junit.internal.runners.JUnit38ClassRunner; 4 | import org.junit.runner.Runner; 5 | import org.junit.runners.model.RunnerBuilder; 6 | 7 | public class JUnit3Builder extends RunnerBuilder { 8 | @Override 9 | public Runner runnerForClass(Class> testClass) throws Throwable { 10 | if (isPre4Test(testClass)) { 11 | return new JUnit38ClassRunner(testClass); 12 | } 13 | return null; 14 | } 15 | 16 | boolean isPre4Test(Class> testClass) { 17 | return junit.framework.TestCase.class.isAssignableFrom(testClass); 18 | } 19 | } -------------------------------------------------------------------------------- /source_to_parse/junit-master/src/test/java/org/junit/internal/matchers/ThrowableCauseMatcherTest.java: -------------------------------------------------------------------------------- 1 | package org.junit.internal.matchers; 2 | 3 | import org.junit.Test; 4 | 5 | import static org.hamcrest.CoreMatchers.is; 6 | import static org.junit.Assert.assertThat; 7 | import static org.junit.internal.matchers.ThrowableCauseMatcher.hasCause; 8 | 9 | public class ThrowableCauseMatcherTest { 10 | 11 | @Test 12 | public void shouldAllowCauseOfDifferentClassFromRoot() throws Exception { 13 | NullPointerException expectedCause = new NullPointerException("expected"); 14 | Exception actual = new Exception(expectedCause); 15 | 16 | assertThat(actual, hasCause(is(expectedCause))); 17 | } 18 | } -------------------------------------------------------------------------------- /source_to_parse/junit-master/README.md: -------------------------------------------------------------------------------- 1 | # JUnit 4 2 | JUnit is a simple framework to write repeatable tests. It is an instance of the xUnit architecture for unit testing frameworks. 3 | 4 | For more information, please visit: 5 | * [Wiki](https://github.com/junit-team/junit/wiki) 6 | * [Download and Install guide](https://github.com/junit-team/junit/wiki/Download-and-Install) 7 | * [Getting Started](https://github.com/junit-team/junit/wiki/Getting-started) 8 | 9 | [](https://junit.ci.cloudbees.com/) 10 | 11 | [](http://www.cloudbees.com/foss/foss-dev.cb) 12 | 13 | -------------------------------------------------------------------------------- /source_to_parse/junit-master/src/main/java/org/junit/runners/model/RunnerScheduler.java: -------------------------------------------------------------------------------- 1 | package org.junit.runners.model; 2 | 3 | /** 4 | * Represents a strategy for scheduling when individual test methods 5 | * should be run (in serial or parallel) 6 | * 7 | * WARNING: still experimental, may go away. 8 | * 9 | * @since 4.7 10 | */ 11 | public interface RunnerScheduler { 12 | /** 13 | * Schedule a child statement to run 14 | */ 15 | void schedule(Runnable childStatement); 16 | 17 | /** 18 | * Override to implement any behavior that must occur 19 | * after all children have been scheduled (for example, 20 | * waiting for them all to finish) 21 | */ 22 | void finished(); 23 | } 24 | -------------------------------------------------------------------------------- /source_to_parse/junit-master/src/main/java/org/junit/runners/parameterized/BlockJUnit4ClassRunnerWithParametersFactory.java: -------------------------------------------------------------------------------- 1 | package org.junit.runners.parameterized; 2 | 3 | import org.junit.runner.Runner; 4 | import org.junit.runners.model.InitializationError; 5 | 6 | /** 7 | * A {@link ParametersRunnerFactory} that creates 8 | * {@link BlockJUnit4ClassRunnerWithParameters}. 9 | * 10 | * @since 4.12 11 | */ 12 | public class BlockJUnit4ClassRunnerWithParametersFactory implements 13 | ParametersRunnerFactory { 14 | public Runner createRunnerForTestWithParameters(TestWithParameters test) 15 | throws InitializationError { 16 | return new BlockJUnit4ClassRunnerWithParameters(test); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /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/src/main/java/org/junit/internal/builders/IgnoredClassRunner.java: -------------------------------------------------------------------------------- 1 | package org.junit.internal.builders; 2 | 3 | import org.junit.runner.Description; 4 | import org.junit.runner.Runner; 5 | import org.junit.runner.notification.RunNotifier; 6 | 7 | public class IgnoredClassRunner extends Runner { 8 | private final Class> clazz; 9 | 10 | public IgnoredClassRunner(Class> testClass) { 11 | clazz = testClass; 12 | } 13 | 14 | @Override 15 | public void run(RunNotifier notifier) { 16 | notifier.fireTestIgnored(getDescription()); 17 | } 18 | 19 | @Override 20 | public Description getDescription() { 21 | return Description.createSuiteDescription(clazz); 22 | } 23 | } -------------------------------------------------------------------------------- /source_to_parse/junit-master/src/main/java/org/junit/experimental/theories/internal/BooleanSupplier.java: -------------------------------------------------------------------------------- 1 | package org.junit.experimental.theories.internal; 2 | 3 | import java.util.Arrays; 4 | import java.util.List; 5 | 6 | import org.junit.experimental.theories.ParameterSignature; 7 | import org.junit.experimental.theories.ParameterSupplier; 8 | import org.junit.experimental.theories.PotentialAssignment; 9 | 10 | public class BooleanSupplier extends ParameterSupplier { 11 | 12 | @Override 13 | public Listsuite()
8 | * method). For example:
9 | *
10 | * @RunWith(AllTests.class)
11 | * public class ProductTests {
12 | * public static junit.framework.Test suite() {
13 | * ...
14 | * }
15 | * }
16 | *
17 | *
18 | * @since 4.0
19 | */
20 | public class AllTests extends SuiteMethod {
21 | /**
22 | * Only called reflectively. Do not use programmatically.
23 | */
24 | public AllTests(Class> klass) throws Throwable {
25 | super(klass);
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/source_to_parse/junit-master/src/main/java/org/junit/runner/manipulation/Sortable.java:
--------------------------------------------------------------------------------
1 | package org.junit.runner.manipulation;
2 |
3 | /**
4 | * Interface for runners that allow sorting of tests. By sorting tests based on when they last failed, most recently
5 | * failed first, you can reduce the average time to the first test failing. Test sorting should not be used to
6 | * cope with order dependencies between tests. Tests that are isolated from each other are less
7 | * expensive to maintain and can be run individually.
8 | *
9 | * @since 4.0
10 | */
11 | public interface Sortable {
12 |
13 | /**
14 | * Sorts the tests using sorter
15 | *
16 | * @param sorter the {@link Sorter} to use for sorting the tests
17 | */
18 | void sort(Sorter sorter);
19 |
20 | }
21 |
--------------------------------------------------------------------------------
/source_to_parse/junit-master/src/main/java/org/junit/internal/builders/SuiteMethodBuilder.java:
--------------------------------------------------------------------------------
1 | package org.junit.internal.builders;
2 |
3 | import org.junit.internal.runners.SuiteMethod;
4 | import org.junit.runner.Runner;
5 | import org.junit.runners.model.RunnerBuilder;
6 |
7 | public class SuiteMethodBuilder extends RunnerBuilder {
8 | @Override
9 | public Runner runnerForClass(Class> each) throws Throwable {
10 | if (hasSuiteMethod(each)) {
11 | return new SuiteMethod(each);
12 | }
13 | return null;
14 | }
15 |
16 | public boolean hasSuiteMethod(Class> testClass) {
17 | try {
18 | testClass.getMethod("suite");
19 | } catch (NoSuchMethodException e) {
20 | return false;
21 | }
22 | return true;
23 | }
24 | }
--------------------------------------------------------------------------------
/source_to_parse/junit-master/doc/index.htm:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | 14 | Kent Beck, Erich Gamma, David Saff
15 | 16 |
9 | * public class TestNameTest {
10 | * @Rule
11 | * public TestName name= new TestName();
12 | *
13 | * @Test
14 | * public void testA() {
15 | * assertEquals("testA", name.getMethodName());
16 | * }
17 | *
18 | * @Test
19 | * public void testB() {
20 | * assertEquals("testB", name.getMethodName());
21 | * }
22 | * }
23 | *
24 | *
25 | * @since 4.7
26 | */
27 | public class TestName extends TestWatcher {
28 | private volatile String name;
29 |
30 | @Override
31 | protected void starting(Description d) {
32 | name = d.getMethodName();
33 | }
34 |
35 | /**
36 | * @return the name of the currently-running test method
37 | */
38 | public String getMethodName() {
39 | return name;
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/source_to_parse/junit-master/src/test/java/org/junit/tests/internal/runners/ErrorReportingRunnerTest.java:
--------------------------------------------------------------------------------
1 | package org.junit.tests.internal.runners;
2 |
3 | import org.junit.Test;
4 | import org.junit.internal.runners.ErrorReportingRunner;
5 |
6 | public class ErrorReportingRunnerTest {
7 |
8 | @Test(expected = NullPointerException.class)
9 | public void cannotCreateWithNullClass() {
10 | new ErrorReportingRunner(null, new RuntimeException());
11 | }
12 |
13 | @Test(expected = NullPointerException.class)
14 | public void cannotCreateWithNullClass2() {
15 | new ErrorReportingRunner(new RuntimeException(), (Class>) null);
16 | }
17 |
18 | @Test(expected = NullPointerException.class)
19 | public void cannotCreateWithNullClasses() {
20 | new ErrorReportingRunner(new RuntimeException(), (Class>[]) null);
21 | }
22 |
23 | @Test(expected = NullPointerException.class)
24 | public void cannotCreateWithoutClass() {
25 | new ErrorReportingRunner(new RuntimeException());
26 | }
27 |
28 | }
29 |
--------------------------------------------------------------------------------
/source_to_parse/junit-master/src/main/java/org/junit/experimental/theories/internal/EnumSupplier.java:
--------------------------------------------------------------------------------
1 | package org.junit.experimental.theories.internal;
2 |
3 | import java.util.ArrayList;
4 | import java.util.List;
5 |
6 | import org.junit.experimental.theories.ParameterSignature;
7 | import org.junit.experimental.theories.ParameterSupplier;
8 | import org.junit.experimental.theories.PotentialAssignment;
9 |
10 | public class EnumSupplier extends ParameterSupplier {
11 |
12 | private Class> enumType;
13 |
14 | public EnumSupplier(Class> enumType) {
15 | this.enumType = enumType;
16 | }
17 |
18 | @Override
19 | public List
20 | * @Theory
21 | * public void shouldPassForSomeInts(@TestedOn(ints={1, 2, 3}) int param) {
22 | * ...
23 | * }
24 | *
25 | */
26 | @ParametersSuppliedBy(TestedOnSupplier.class)
27 | @Retention(RetentionPolicy.RUNTIME)
28 | @Target(PARAMETER)
29 | public @interface TestedOn {
30 | int[] ints();
31 | }
32 |
--------------------------------------------------------------------------------
/source_to_parse/junit-master/src/test/java/junit/tests/framework/AllTests.java:
--------------------------------------------------------------------------------
1 | package junit.tests.framework;
2 |
3 | import junit.framework.Test;
4 | import junit.framework.TestSuite;
5 |
6 | /**
7 | * TestSuite that runs all the sample tests
8 | */
9 | public class AllTests {
10 |
11 | public static void main(String[] args) {
12 | junit.textui.TestRunner.run(suite());
13 | }
14 |
15 | public static Test suite() {
16 | TestSuite suite = new TestSuite("Framework Tests");
17 | suite.addTestSuite(TestCaseTest.class);
18 | suite.addTest(SuiteTest.suite()); // Tests suite building, so can't use automatic test extraction
19 | suite.addTestSuite(TestListenerTest.class);
20 | suite.addTestSuite(AssertionFailedErrorTest.class);
21 | suite.addTestSuite(AssertTest.class);
22 | suite.addTestSuite(TestImplementorTest.class);
23 | suite.addTestSuite(NoArgTestCaseTest.class);
24 | suite.addTestSuite(ComparisonCompactorTest.class);
25 | suite.addTestSuite(ComparisonFailureTest.class);
26 | suite.addTestSuite(DoublePrecisionAssertTest.class);
27 | suite.addTestSuite(FloatAssertTest.class);
28 | return suite;
29 | }
30 |
31 | }
--------------------------------------------------------------------------------
/source_to_parse/junit-master/src/test/java/org/junit/tests/junit3compatibility/OldTestClassAdaptingListenerTest.java:
--------------------------------------------------------------------------------
1 | package org.junit.tests.junit3compatibility;
2 |
3 | import static org.junit.Assert.assertEquals;
4 |
5 | import junit.framework.AssertionFailedError;
6 | import junit.framework.TestCase;
7 | import junit.framework.TestListener;
8 | import org.junit.Test;
9 | import org.junit.internal.runners.JUnit38ClassRunner;
10 | import org.junit.runner.Result;
11 | import org.junit.runner.notification.RunListener;
12 | import org.junit.runner.notification.RunNotifier;
13 |
14 | public class OldTestClassAdaptingListenerTest {
15 | @Test
16 | public void addFailureDelegatesToNotifier() {
17 | Result result = new Result();
18 | RunListener listener = result.createListener();
19 | RunNotifier notifier = new RunNotifier();
20 | notifier.addFirstListener(listener);
21 | TestCase testCase = new TestCase() {
22 | };
23 | TestListener adaptingListener = new JUnit38ClassRunner(testCase)
24 | .createAdaptingListener(notifier);
25 | adaptingListener.addFailure(testCase, new AssertionFailedError());
26 | assertEquals(1, result.getFailureCount());
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/source_to_parse/junit-master/src/test/java/org/junit/tests/running/classes/BlockJUnit4ClassRunnerTest.java:
--------------------------------------------------------------------------------
1 | package org.junit.tests.running.classes;
2 |
3 | import static org.junit.Assert.assertEquals;
4 |
5 | import java.util.List;
6 |
7 | import org.junit.Test;
8 | import org.junit.runners.BlockJUnit4ClassRunner;
9 | import org.junit.runners.model.InitializationError;
10 |
11 | public class BlockJUnit4ClassRunnerTest {
12 | public static class OuterClass {
13 | public class Enclosed {
14 | @Test
15 | public void test() {
16 | }
17 | }
18 | }
19 |
20 | @Test
21 | public void detectNonStaticEnclosedClass() throws Exception {
22 | try {
23 | new BlockJUnit4ClassRunner(OuterClass.Enclosed.class);
24 | } catch (InitializationError e) {
25 | List
17 | * public interface FastTests {}
18 | * public interface SlowTests {}
19 | *
20 | * public static 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 static class B {
34 | * @Test
35 | * public void c() {
36 | *
37 | * }
38 | * }
39 | *
40 | *
41 | * For more usage, see code example on {@link Categories}.
42 | */
43 | @Retention(RetentionPolicy.RUNTIME)
44 | @Inherited
45 | @ValidateWith(CategoryValidator.class)
46 | public @interface Category {
47 | Class>[] value();
48 | }
--------------------------------------------------------------------------------
/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 | * 16 | * For example: 17 | *
18 | * public class Example {
19 | * @BeforeClass public static void onlyOnce() {
20 | * ...
21 | * }
22 | * @Test public void one() {
23 | * ...
24 | * }
25 | * @Test public void two() {
26 | * ...
27 | * }
28 | * }
29 | *
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/test/java/org/junit/tests/experimental/theories/TheoryTestUtils.java:
--------------------------------------------------------------------------------
1 | package org.junit.tests.experimental.theories;
2 |
3 | import java.lang.reflect.Method;
4 | import java.util.List;
5 |
6 | import org.junit.experimental.theories.PotentialAssignment;
7 | import org.junit.experimental.theories.Theories;
8 | import org.junit.experimental.theories.internal.Assignments;
9 | import org.junit.runner.JUnitCore;
10 | import org.junit.runner.Request;
11 | import org.junit.runner.Result;
12 | import org.junit.runner.Runner;
13 | import org.junit.runners.model.InitializationError;
14 | import org.junit.runners.model.TestClass;
15 |
16 | public final class TheoryTestUtils {
17 |
18 | private TheoryTestUtils() { }
19 |
20 | public static List
21 | * try {
22 | * doSomething();
23 | * } catch (Throwable e} {
24 | * throw Throwables.rethrowAsException(e);
25 | * }
26 | * doSomethingLater();
27 | *
28 | *
29 | * @param e exception to rethrow
30 | * @return does not return anything
31 | * @since 4.12
32 | */
33 | public static Exception rethrowAsException(Throwable e) throws Exception {
34 | Throwables.@RunWith or extends a class annotated
11 | * with @RunWith, JUnit will invoke the class it references to run the
12 | * tests in that class instead of the runner built into JUnit. We added this feature late
13 | * in development. While it seems powerful we expect the runner API to change as we learn
14 | * how people really use it. Some of the classes that are currently internal will likely
15 | * be refined and become public.
16 | *
17 | * For example, suites in JUnit 4 are built using RunWith, and a custom runner named Suite:
18 | *
19 | *
20 | * @RunWith(Suite.class)
21 | * @SuiteClasses({ATest.class, BTest.class, CTest.class})
22 | * public class ABCSuite {
23 | * }
24 | *
25 | *
26 | * @since 4.0
27 | */
28 | @Retention(RetentionPolicy.RUNTIME)
29 | @Target(ElementType.TYPE)
30 | @Inherited
31 | public @interface RunWith {
32 | /**
33 | * @return a Runner class (must have a constructor that takes a single Class to run)
34 | */
35 | Class extends Runner> value();
36 | }
37 |
--------------------------------------------------------------------------------
/source_to_parse/junit-master/src/main/java/org/junit/rules/ExpectedExceptionMatcherBuilder.java:
--------------------------------------------------------------------------------
1 | package org.junit.rules;
2 |
3 | import static org.hamcrest.CoreMatchers.allOf;
4 | import static org.junit.matchers.JUnitMatchers.isThrowable;
5 |
6 | import java.util.ArrayList;
7 | import java.util.List;
8 |
9 | import org.hamcrest.Matcher;
10 |
11 | /**
12 | * Builds special matcher used by {@link ExpectedException}.
13 | */
14 | class ExpectedExceptionMatcherBuilder {
15 |
16 | private final Listsuite()
12 | * method). For example:
13 | *
14 | * @RunWith(AllTests.class)
15 | * public class ProductTests {
16 | * public static junit.framework.Test suite() {
17 | * ...
18 | * }
19 | * }
20 | *
21 | */
22 | public class SuiteMethod extends JUnit38ClassRunner {
23 | public SuiteMethod(Class> klass) throws Throwable {
24 | super(testFromSuiteMethod(klass));
25 | }
26 |
27 | public static Test testFromSuiteMethod(Class> klass) throws Throwable {
28 | Method suiteMethod = null;
29 | Test suite = null;
30 | try {
31 | suiteMethod = klass.getMethod("suite");
32 | if (!Modifier.isStatic(suiteMethod.getModifiers())) {
33 | throw new Exception(klass.getName() + ".suite() must be static");
34 | }
35 | suite = (Test) suiteMethod.invoke(null); // static method
36 | } catch (InvocationTargetException e) {
37 | throw e.getCause();
38 | }
39 | return suite;
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/source_to_parse/junit-master/src/main/java/org/junit/rules/MethodRule.java:
--------------------------------------------------------------------------------
1 | package org.junit.rules;
2 |
3 | import org.junit.Rule;
4 | import org.junit.runners.model.FrameworkMethod;
5 | import org.junit.runners.model.Statement;
6 |
7 | /**
8 | * A MethodRule is an alteration in how a test method is run and reported.
9 | * Multiple {@link MethodRule}s can be applied to a test method. The
10 | * {@link Statement} that executes the method is passed to each annotated
11 | * {@link Rule} in turn, and each may return a substitute or modified
12 | * {@link Statement}, which is passed to the next {@link Rule}, if any. For
13 | * an example of how this can be useful, see {@link TestWatchman}.
14 | *
15 | * Note that {@link MethodRule} has been replaced by {@link TestRule},
16 | * which has the added benefit of supporting class rules.
17 | *
18 | * @since 4.7
19 | */
20 | public interface MethodRule {
21 | /**
22 | * Modifies the method-running {@link Statement} to implement an additional
23 | * test-running rule.
24 | *
25 | * @param base The {@link Statement} to be modified
26 | * @param method The method to be run
27 | * @param target The object on which the method will be run.
28 | * @return a new statement, which may be the same as {@code base},
29 | * a wrapper around {@code base}, or a completely new Statement.
30 | */
31 | Statement apply(Statement base, FrameworkMethod method, Object target);
32 | }
33 |
--------------------------------------------------------------------------------
/source_to_parse/junit-master/src/main/java/org/junit/runners/model/InitializationError.java:
--------------------------------------------------------------------------------
1 | package org.junit.runners.model;
2 |
3 | import java.util.Arrays;
4 | import java.util.List;
5 |
6 | /**
7 | * Represents one or more problems encountered while initializing a Runner
8 | *
9 | * @since 4.5
10 | */
11 | public class InitializationError extends Exception {
12 | private static final long serialVersionUID = 1L;
13 |
14 | /*
15 | * We have to use the f prefix until the next major release to ensure
16 | * serialization compatibility.
17 | * See https://github.com/junit-team/junit/issues/976
18 | */
19 | private final List
16 | * Here is a simple example:
17 | * 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 | *
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/rules/Verifier.java:
--------------------------------------------------------------------------------
1 | package org.junit.rules;
2 |
3 | import org.junit.runner.Description;
4 | import org.junit.runners.model.Statement;
5 |
6 | /**
7 | * Verifier is a base class for Rules like ErrorCollector, which can turn
8 | * otherwise passing test methods into failing tests if a verification check is
9 | * failed
10 | *
11 | *
12 | * public static class ErrorLogVerifier {
13 | * private ErrorLog errorLog = new ErrorLog();
14 | *
15 | * @Rule
16 | * public Verifier verifier = new Verifier() {
17 | * @Override public void verify() {
18 | * assertTrue(errorLog.isEmpty());
19 | * }
20 | * }
21 | *
22 | * @Test public void testThatMightWriteErrorLog() {
23 | * // ...
24 | * }
25 | * }
26 | *
27 | *
28 | * @since 4.7
29 | */
30 | public abstract class Verifier implements TestRule {
31 | public Statement apply(final Statement base, Description description) {
32 | return new Statement() {
33 | @Override
34 | public void evaluate() throws Throwable {
35 | base.evaluate();
36 | verify();
37 | }
38 | };
39 | }
40 |
41 | /**
42 | * Override this to add verification logic. Overrides should throw an
43 | * exception to indicate that verification failed.
44 | */
45 | protected void verify() throws Throwable {
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/source_to_parse/junit-master/src/main/java/org/junit/runner/Computer.java:
--------------------------------------------------------------------------------
1 | package org.junit.runner;
2 |
3 | import org.junit.runners.Suite;
4 | import org.junit.runners.model.InitializationError;
5 | import org.junit.runners.model.RunnerBuilder;
6 |
7 | /**
8 | * Represents a strategy for computing runners and suites.
9 | * WARNING: this class is very likely to undergo serious changes in version 4.8 and
10 | * beyond.
11 | *
12 | * @since 4.6
13 | */
14 | public class Computer {
15 | /**
16 | * Returns a new default computer, which runs tests in serial order
17 | */
18 | public static Computer serial() {
19 | return new Computer();
20 | }
21 |
22 | /**
23 | * Create a suite for {@code classes}, building Runners with {@code builder}.
24 | * Throws an InitializationError if Runner construction fails
25 | */
26 | public Runner getSuite(final RunnerBuilder builder,
27 | Class>[] classes) throws InitializationError {
28 | return new Suite(new RunnerBuilder() {
29 | @Override
30 | public Runner runnerForClass(Class> testClass) throws Throwable {
31 | return getRunner(builder, testClass);
32 | }
33 | }, classes);
34 | }
35 |
36 | /**
37 | * Create a single-class runner for {@code testClass}, using {@code builder}
38 | */
39 | protected Runner getRunner(RunnerBuilder builder, Class> testClass) throws Throwable {
40 | return builder.runnerForClass(testClass);
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/src/main/java/me/tomassetti/examples/ListClassesExample.java:
--------------------------------------------------------------------------------
1 | package me.tomassetti.examples;
2 |
3 | import com.github.javaparser.StaticJavaParser;
4 | import com.github.javaparser.ast.body.ClassOrInterfaceDeclaration;
5 | import com.github.javaparser.ast.visitor.VoidVisitorAdapter;
6 | import com.google.common.base.Strings;
7 | import me.tomassetti.support.DirExplorer;
8 |
9 | import java.io.File;
10 | import java.io.IOException;
11 |
12 | public class ListClassesExample {
13 |
14 | public static void listClasses(File projectDir) {
15 | new DirExplorer((level, path, file) -> path.endsWith(".java"), (level, path, file) -> {
16 | System.out.println(path);
17 | System.out.println(Strings.repeat("=", path.length()));
18 | try {
19 | new VoidVisitorAdapter