├── org.junit.tools ├── classes │ ├── .gitignore │ └── org │ │ └── junit │ │ └── tools │ │ ├── Activator.class │ │ ├── base │ │ ├── JUTWarning.class │ │ ├── MethodRef.class │ │ ├── JUTException.class │ │ ├── MainController$1.class │ │ ├── MainController$2.class │ │ ├── MainController$3.class │ │ ├── MainController.class │ │ ├── MethodAnalyzer.class │ │ ├── ExtensionPointHandler.class │ │ └── MethodAnalyzer$MethodAnalyzeResult.class │ │ ├── handler │ │ ├── JUTHandler.class │ │ ├── CleanMocksHandler.class │ │ ├── SwitchClassHandler.class │ │ ├── GenerateMockClassHandler.class │ │ ├── GenerateTestClassHandler.class │ │ ├── GenerateTestSuitesHandler.class │ │ └── CreateNecessaryTestsReportHandler.class │ │ ├── messages │ │ ├── Messages.class │ │ └── messages.properties │ │ ├── reports │ │ ├── ReportCreator.class │ │ └── model │ │ │ ├── Report.class │ │ │ ├── RepClass.class │ │ │ ├── RepMethod.class │ │ │ ├── NewMethods.class │ │ │ ├── RepPackage.class │ │ │ ├── RepProject.class │ │ │ ├── Statistics.class │ │ │ ├── package-info.class │ │ │ └── ObjectFactory.class │ │ ├── ui │ │ ├── utils │ │ │ ├── EclipseUIUtils.class │ │ │ ├── EclipseUIUtils$1.class │ │ │ ├── EclipseUIUtils$2.class │ │ │ ├── EclipseUIUtils$3.class │ │ │ └── EclipseUIUtils$4.class │ │ ├── generator │ │ │ ├── wizards │ │ │ │ ├── GeneratorWizard.class │ │ │ │ ├── GeneratorWizardBase.class │ │ │ │ ├── GeneratorWizardMain.class │ │ │ │ ├── MockGeneratorWizard.class │ │ │ │ ├── GeneratorWizardMain$1.class │ │ │ │ ├── GeneratorWizardMain$2.class │ │ │ │ ├── GeneratorWizardMain$3.class │ │ │ │ ├── MockGeneratorWizard$1.class │ │ │ │ ├── pages │ │ │ │ │ ├── GeneratorWizardBasePage.class │ │ │ │ │ ├── GeneratorWizardMainPage.class │ │ │ │ │ └── MockGeneratorWizardPage.class │ │ │ │ └── IMethodeSelectionChangedListener.class │ │ │ └── swt │ │ │ │ ├── view │ │ │ │ ├── GeneratorMainView$1.class │ │ │ │ ├── GeneratorMainView.class │ │ │ │ ├── MockGeneratorView.class │ │ │ │ └── GroupMethodSelectionView.class │ │ │ │ └── control │ │ │ │ ├── GroupMethodSelectionCtrl$1.class │ │ │ │ ├── GroupMethodSelectionCtrl$2.class │ │ │ │ ├── GroupMethodSelectionCtrl$3.class │ │ │ │ ├── GroupMethodSelectionCtrl$4.class │ │ │ │ ├── GroupMethodSelectionCtrl$5.class │ │ │ │ ├── GroupMethodSelectionCtrl$6.class │ │ │ │ ├── GroupMethodSelectionCtrl$7.class │ │ │ │ ├── GroupMethodSelectionCtrl.class │ │ │ │ ├── GroupMethodSelectionCtrl$CheckStateProvider.class │ │ │ │ └── GroupMethodSelectionCtrl$ViewerFilterMethods.class │ │ └── preferences │ │ │ ├── JUTPreferenceMainPage.class │ │ │ ├── JUTPreferenceFilterPage.class │ │ │ ├── JUTPreferenceFilterPage$1.class │ │ │ ├── JUTPreferenceFilterPage$2.class │ │ │ ├── JUTPreferenceFilterPage$3.class │ │ │ └── JUTPreferenceFilterPage$4.class │ │ ├── generator │ │ ├── ITestDataFactory.class │ │ ├── model │ │ │ ├── tml │ │ │ │ ├── Method.class │ │ │ │ ├── Mocks.class │ │ │ │ ├── Param.class │ │ │ │ ├── Result.class │ │ │ │ ├── Test.class │ │ │ │ ├── Settings.class │ │ │ │ ├── TestBase.class │ │ │ │ ├── TestCase.class │ │ │ │ ├── Testprio.class │ │ │ │ ├── Assertion.class │ │ │ │ ├── Constructor.class │ │ │ │ ├── TestBases.class │ │ │ │ ├── AssertionType.class │ │ │ │ ├── ObjectFactory.class │ │ │ │ ├── Precondition.class │ │ │ │ ├── package-info.class │ │ │ │ └── ParamAssignment.class │ │ │ ├── JUTElements.class │ │ │ ├── GeneratorModel.class │ │ │ ├── JUTElements$JUTProjects.class │ │ │ ├── JUTElements$JUTClassesAndPackages.class │ │ │ └── JUTElements$JUTConstructorsAndMethods.class │ │ ├── utils │ │ │ ├── JDTUtils.class │ │ │ └── GeneratorUtils.class │ │ ├── MockClassGenerator.class │ │ ├── TestCasesGenerator.class │ │ ├── TestClassGenerator.class │ │ ├── IGeneratorConstants.class │ │ ├── IMockClassGenerator.class │ │ ├── ITestClassGenerator.class │ │ ├── ITestSuitesGenerator.class │ │ ├── MockClassGenerator$1.class │ │ ├── MockClassGenerator$2.class │ │ ├── TestSuitesGenerator$1.class │ │ ├── TestSuitesGenerator$2.class │ │ ├── TestSuitesGenerator.class │ │ ├── TestCasesGenerator$ExpressionAnalyzer.class │ │ └── TestSuitesGenerator$TestSuiteDeclaration.class │ │ ├── preferences │ │ ├── JUTPreferences.class │ │ ├── JUTPreferences$1.class │ │ ├── IJUTPreferenceConstants.class │ │ └── JUTPreferenceInitializer.class │ │ └── refactoring │ │ ├── MoveTestElements.class │ │ ├── DeleteTestElements.class │ │ ├── MoveTestElements$1.class │ │ ├── RenameTestElements.class │ │ ├── DeleteTestElements$1.class │ │ └── RenameTestElements$1.class ├── .DS_Store ├── res │ ├── icons │ │ └── jut.png │ └── trml.xsd ├── build.properties ├── .classpath ├── src │ └── org │ │ └── junit │ │ └── tools │ │ ├── base │ │ ├── JUTWarning.java │ │ ├── JUTException.java │ │ ├── MethodRef.java │ │ └── MethodAnalyzer.java │ │ ├── ui │ │ └── generator │ │ │ ├── wizards │ │ │ ├── IMethodeSelectionChangedListener.java │ │ │ ├── pages │ │ │ │ ├── MockGeneratorWizardPage.java │ │ │ │ ├── GeneratorWizardBasePage.java │ │ │ │ └── GeneratorWizardMainPage.java │ │ │ ├── GeneratorWizardBase.java │ │ │ └── GeneratorWizard.java │ │ │ └── swt │ │ │ └── view │ │ │ ├── MockGeneratorView.java │ │ │ └── GroupMethodSelectionView.java │ │ ├── reports │ │ └── model │ │ │ ├── package-info.java │ │ │ ├── ObjectFactory.java │ │ │ ├── RepClass.java │ │ │ ├── RepPackage.java │ │ │ ├── NewMethods.java │ │ │ ├── RepMethod.java │ │ │ ├── RepProject.java │ │ │ └── Statistics.java │ │ ├── generator │ │ ├── model │ │ │ ├── tml │ │ │ │ ├── package-info.java │ │ │ │ ├── AssertionType.java │ │ │ │ ├── Testprio.java │ │ │ │ ├── Mocks.java │ │ │ │ ├── TestBases.java │ │ │ │ ├── ParamAssignment.java │ │ │ │ ├── Precondition.java │ │ │ │ ├── Param.java │ │ │ │ ├── Result.java │ │ │ │ ├── Constructor.java │ │ │ │ ├── ObjectFactory.java │ │ │ │ ├── TestBase.java │ │ │ │ ├── Assertion.java │ │ │ │ └── Settings.java │ │ │ └── GeneratorModel.java │ │ ├── ITestDataFactory.java │ │ ├── IMockClassGenerator.java │ │ ├── IGeneratorConstants.java │ │ ├── ITestSuitesGenerator.java │ │ └── ITestClassGenerator.java │ │ ├── configuration │ │ └── base │ │ │ ├── MethodRef.java │ │ │ └── Testprio.java │ │ ├── handler │ │ ├── CreateNecessaryTestsReportHandler.java │ │ ├── GenerateTestSuitesHandler.java │ │ ├── SwitchClassHandler.java │ │ ├── GenerateTestClassHandler.java │ │ ├── CleanMocksHandler.java │ │ ├── GenerateMockClassHandler.java │ │ └── JUTHandler.java │ │ ├── preferences │ │ ├── IJUTPreferenceConstants.java │ │ └── JUTPreferenceInitializer.java │ │ ├── Activator.java │ │ ├── refactoring │ │ ├── MoveTestElements.java │ │ └── DeleteTestElements.java │ │ └── messages │ │ └── messages.properties ├── .settings │ └── org.eclipse.jdt.core.prefs ├── .project ├── META-INF │ └── MANIFEST.MF └── schema │ ├── org.junit.tools.preferences.exsd │ ├── org.junit.tools.generator.factory.testdata.exsd │ └── org.junit.tools.generator.exsd ├── README.md └── CODE_OF_CONDUCT.md /org.junit.tools/classes/.gitignore: -------------------------------------------------------------------------------- 1 | /org/ 2 | -------------------------------------------------------------------------------- /org.junit.tools/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/junit-tools-team/junit-tools/HEAD/org.junit.tools/.DS_Store -------------------------------------------------------------------------------- /org.junit.tools/res/icons/jut.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/junit-tools-team/junit-tools/HEAD/org.junit.tools/res/icons/jut.png -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # JUnit-Tools 2 | Tools around the creation and management of junit-tests. 3 | 4 | For detailed informations look at www.junit-tools.org. 5 | -------------------------------------------------------------------------------- /org.junit.tools/classes/org/junit/tools/Activator.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/junit-tools-team/junit-tools/HEAD/org.junit.tools/classes/org/junit/tools/Activator.class -------------------------------------------------------------------------------- /org.junit.tools/classes/org/junit/tools/base/JUTWarning.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/junit-tools-team/junit-tools/HEAD/org.junit.tools/classes/org/junit/tools/base/JUTWarning.class -------------------------------------------------------------------------------- /org.junit.tools/classes/org/junit/tools/base/MethodRef.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/junit-tools-team/junit-tools/HEAD/org.junit.tools/classes/org/junit/tools/base/MethodRef.class -------------------------------------------------------------------------------- /org.junit.tools/classes/org/junit/tools/base/JUTException.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/junit-tools-team/junit-tools/HEAD/org.junit.tools/classes/org/junit/tools/base/JUTException.class -------------------------------------------------------------------------------- /org.junit.tools/classes/org/junit/tools/handler/JUTHandler.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/junit-tools-team/junit-tools/HEAD/org.junit.tools/classes/org/junit/tools/handler/JUTHandler.class -------------------------------------------------------------------------------- /org.junit.tools/classes/org/junit/tools/messages/Messages.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/junit-tools-team/junit-tools/HEAD/org.junit.tools/classes/org/junit/tools/messages/Messages.class -------------------------------------------------------------------------------- /org.junit.tools/classes/org/junit/tools/base/MainController$1.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/junit-tools-team/junit-tools/HEAD/org.junit.tools/classes/org/junit/tools/base/MainController$1.class -------------------------------------------------------------------------------- /org.junit.tools/classes/org/junit/tools/base/MainController$2.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/junit-tools-team/junit-tools/HEAD/org.junit.tools/classes/org/junit/tools/base/MainController$2.class -------------------------------------------------------------------------------- /org.junit.tools/classes/org/junit/tools/base/MainController$3.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/junit-tools-team/junit-tools/HEAD/org.junit.tools/classes/org/junit/tools/base/MainController$3.class -------------------------------------------------------------------------------- /org.junit.tools/classes/org/junit/tools/base/MainController.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/junit-tools-team/junit-tools/HEAD/org.junit.tools/classes/org/junit/tools/base/MainController.class -------------------------------------------------------------------------------- /org.junit.tools/classes/org/junit/tools/base/MethodAnalyzer.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/junit-tools-team/junit-tools/HEAD/org.junit.tools/classes/org/junit/tools/base/MethodAnalyzer.class -------------------------------------------------------------------------------- /org.junit.tools/classes/org/junit/tools/reports/ReportCreator.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/junit-tools-team/junit-tools/HEAD/org.junit.tools/classes/org/junit/tools/reports/ReportCreator.class -------------------------------------------------------------------------------- /org.junit.tools/classes/org/junit/tools/reports/model/Report.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/junit-tools-team/junit-tools/HEAD/org.junit.tools/classes/org/junit/tools/reports/model/Report.class -------------------------------------------------------------------------------- /org.junit.tools/classes/org/junit/tools/reports/model/RepClass.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/junit-tools-team/junit-tools/HEAD/org.junit.tools/classes/org/junit/tools/reports/model/RepClass.class -------------------------------------------------------------------------------- /org.junit.tools/classes/org/junit/tools/reports/model/RepMethod.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/junit-tools-team/junit-tools/HEAD/org.junit.tools/classes/org/junit/tools/reports/model/RepMethod.class -------------------------------------------------------------------------------- /org.junit.tools/classes/org/junit/tools/ui/utils/EclipseUIUtils.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/junit-tools-team/junit-tools/HEAD/org.junit.tools/classes/org/junit/tools/ui/utils/EclipseUIUtils.class -------------------------------------------------------------------------------- /org.junit.tools/classes/org/junit/tools/base/ExtensionPointHandler.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/junit-tools-team/junit-tools/HEAD/org.junit.tools/classes/org/junit/tools/base/ExtensionPointHandler.class -------------------------------------------------------------------------------- /org.junit.tools/classes/org/junit/tools/generator/ITestDataFactory.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/junit-tools-team/junit-tools/HEAD/org.junit.tools/classes/org/junit/tools/generator/ITestDataFactory.class -------------------------------------------------------------------------------- /org.junit.tools/classes/org/junit/tools/generator/model/tml/Method.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/junit-tools-team/junit-tools/HEAD/org.junit.tools/classes/org/junit/tools/generator/model/tml/Method.class -------------------------------------------------------------------------------- /org.junit.tools/classes/org/junit/tools/generator/model/tml/Mocks.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/junit-tools-team/junit-tools/HEAD/org.junit.tools/classes/org/junit/tools/generator/model/tml/Mocks.class -------------------------------------------------------------------------------- /org.junit.tools/classes/org/junit/tools/generator/model/tml/Param.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/junit-tools-team/junit-tools/HEAD/org.junit.tools/classes/org/junit/tools/generator/model/tml/Param.class -------------------------------------------------------------------------------- /org.junit.tools/classes/org/junit/tools/generator/model/tml/Result.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/junit-tools-team/junit-tools/HEAD/org.junit.tools/classes/org/junit/tools/generator/model/tml/Result.class -------------------------------------------------------------------------------- /org.junit.tools/classes/org/junit/tools/generator/model/tml/Test.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/junit-tools-team/junit-tools/HEAD/org.junit.tools/classes/org/junit/tools/generator/model/tml/Test.class -------------------------------------------------------------------------------- /org.junit.tools/classes/org/junit/tools/generator/utils/JDTUtils.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/junit-tools-team/junit-tools/HEAD/org.junit.tools/classes/org/junit/tools/generator/utils/JDTUtils.class -------------------------------------------------------------------------------- /org.junit.tools/classes/org/junit/tools/handler/CleanMocksHandler.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/junit-tools-team/junit-tools/HEAD/org.junit.tools/classes/org/junit/tools/handler/CleanMocksHandler.class -------------------------------------------------------------------------------- /org.junit.tools/classes/org/junit/tools/handler/SwitchClassHandler.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/junit-tools-team/junit-tools/HEAD/org.junit.tools/classes/org/junit/tools/handler/SwitchClassHandler.class -------------------------------------------------------------------------------- /org.junit.tools/classes/org/junit/tools/preferences/JUTPreferences.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/junit-tools-team/junit-tools/HEAD/org.junit.tools/classes/org/junit/tools/preferences/JUTPreferences.class -------------------------------------------------------------------------------- /org.junit.tools/classes/org/junit/tools/reports/model/NewMethods.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/junit-tools-team/junit-tools/HEAD/org.junit.tools/classes/org/junit/tools/reports/model/NewMethods.class -------------------------------------------------------------------------------- /org.junit.tools/classes/org/junit/tools/reports/model/RepPackage.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/junit-tools-team/junit-tools/HEAD/org.junit.tools/classes/org/junit/tools/reports/model/RepPackage.class -------------------------------------------------------------------------------- /org.junit.tools/classes/org/junit/tools/reports/model/RepProject.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/junit-tools-team/junit-tools/HEAD/org.junit.tools/classes/org/junit/tools/reports/model/RepProject.class -------------------------------------------------------------------------------- /org.junit.tools/classes/org/junit/tools/reports/model/Statistics.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/junit-tools-team/junit-tools/HEAD/org.junit.tools/classes/org/junit/tools/reports/model/Statistics.class -------------------------------------------------------------------------------- /org.junit.tools/classes/org/junit/tools/reports/model/package-info.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/junit-tools-team/junit-tools/HEAD/org.junit.tools/classes/org/junit/tools/reports/model/package-info.class -------------------------------------------------------------------------------- /org.junit.tools/classes/org/junit/tools/ui/utils/EclipseUIUtils$1.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/junit-tools-team/junit-tools/HEAD/org.junit.tools/classes/org/junit/tools/ui/utils/EclipseUIUtils$1.class -------------------------------------------------------------------------------- /org.junit.tools/classes/org/junit/tools/ui/utils/EclipseUIUtils$2.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/junit-tools-team/junit-tools/HEAD/org.junit.tools/classes/org/junit/tools/ui/utils/EclipseUIUtils$2.class -------------------------------------------------------------------------------- /org.junit.tools/classes/org/junit/tools/ui/utils/EclipseUIUtils$3.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/junit-tools-team/junit-tools/HEAD/org.junit.tools/classes/org/junit/tools/ui/utils/EclipseUIUtils$3.class -------------------------------------------------------------------------------- /org.junit.tools/classes/org/junit/tools/ui/utils/EclipseUIUtils$4.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/junit-tools-team/junit-tools/HEAD/org.junit.tools/classes/org/junit/tools/ui/utils/EclipseUIUtils$4.class -------------------------------------------------------------------------------- /org.junit.tools/classes/org/junit/tools/generator/MockClassGenerator.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/junit-tools-team/junit-tools/HEAD/org.junit.tools/classes/org/junit/tools/generator/MockClassGenerator.class -------------------------------------------------------------------------------- /org.junit.tools/classes/org/junit/tools/generator/TestCasesGenerator.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/junit-tools-team/junit-tools/HEAD/org.junit.tools/classes/org/junit/tools/generator/TestCasesGenerator.class -------------------------------------------------------------------------------- /org.junit.tools/classes/org/junit/tools/generator/TestClassGenerator.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/junit-tools-team/junit-tools/HEAD/org.junit.tools/classes/org/junit/tools/generator/TestClassGenerator.class -------------------------------------------------------------------------------- /org.junit.tools/classes/org/junit/tools/generator/model/JUTElements.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/junit-tools-team/junit-tools/HEAD/org.junit.tools/classes/org/junit/tools/generator/model/JUTElements.class -------------------------------------------------------------------------------- /org.junit.tools/classes/org/junit/tools/generator/model/tml/Settings.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/junit-tools-team/junit-tools/HEAD/org.junit.tools/classes/org/junit/tools/generator/model/tml/Settings.class -------------------------------------------------------------------------------- /org.junit.tools/classes/org/junit/tools/generator/model/tml/TestBase.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/junit-tools-team/junit-tools/HEAD/org.junit.tools/classes/org/junit/tools/generator/model/tml/TestBase.class -------------------------------------------------------------------------------- /org.junit.tools/classes/org/junit/tools/generator/model/tml/TestCase.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/junit-tools-team/junit-tools/HEAD/org.junit.tools/classes/org/junit/tools/generator/model/tml/TestCase.class -------------------------------------------------------------------------------- /org.junit.tools/classes/org/junit/tools/generator/model/tml/Testprio.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/junit-tools-team/junit-tools/HEAD/org.junit.tools/classes/org/junit/tools/generator/model/tml/Testprio.class -------------------------------------------------------------------------------- /org.junit.tools/classes/org/junit/tools/preferences/JUTPreferences$1.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/junit-tools-team/junit-tools/HEAD/org.junit.tools/classes/org/junit/tools/preferences/JUTPreferences$1.class -------------------------------------------------------------------------------- /org.junit.tools/classes/org/junit/tools/refactoring/MoveTestElements.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/junit-tools-team/junit-tools/HEAD/org.junit.tools/classes/org/junit/tools/refactoring/MoveTestElements.class -------------------------------------------------------------------------------- /org.junit.tools/classes/org/junit/tools/reports/model/ObjectFactory.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/junit-tools-team/junit-tools/HEAD/org.junit.tools/classes/org/junit/tools/reports/model/ObjectFactory.class -------------------------------------------------------------------------------- /org.junit.tools/classes/org/junit/tools/generator/IGeneratorConstants.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/junit-tools-team/junit-tools/HEAD/org.junit.tools/classes/org/junit/tools/generator/IGeneratorConstants.class -------------------------------------------------------------------------------- /org.junit.tools/classes/org/junit/tools/generator/IMockClassGenerator.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/junit-tools-team/junit-tools/HEAD/org.junit.tools/classes/org/junit/tools/generator/IMockClassGenerator.class -------------------------------------------------------------------------------- /org.junit.tools/classes/org/junit/tools/generator/ITestClassGenerator.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/junit-tools-team/junit-tools/HEAD/org.junit.tools/classes/org/junit/tools/generator/ITestClassGenerator.class -------------------------------------------------------------------------------- /org.junit.tools/classes/org/junit/tools/generator/ITestSuitesGenerator.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/junit-tools-team/junit-tools/HEAD/org.junit.tools/classes/org/junit/tools/generator/ITestSuitesGenerator.class -------------------------------------------------------------------------------- /org.junit.tools/classes/org/junit/tools/generator/MockClassGenerator$1.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/junit-tools-team/junit-tools/HEAD/org.junit.tools/classes/org/junit/tools/generator/MockClassGenerator$1.class -------------------------------------------------------------------------------- /org.junit.tools/classes/org/junit/tools/generator/MockClassGenerator$2.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/junit-tools-team/junit-tools/HEAD/org.junit.tools/classes/org/junit/tools/generator/MockClassGenerator$2.class -------------------------------------------------------------------------------- /org.junit.tools/classes/org/junit/tools/generator/TestSuitesGenerator$1.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/junit-tools-team/junit-tools/HEAD/org.junit.tools/classes/org/junit/tools/generator/TestSuitesGenerator$1.class -------------------------------------------------------------------------------- /org.junit.tools/classes/org/junit/tools/generator/TestSuitesGenerator$2.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/junit-tools-team/junit-tools/HEAD/org.junit.tools/classes/org/junit/tools/generator/TestSuitesGenerator$2.class -------------------------------------------------------------------------------- /org.junit.tools/classes/org/junit/tools/generator/TestSuitesGenerator.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/junit-tools-team/junit-tools/HEAD/org.junit.tools/classes/org/junit/tools/generator/TestSuitesGenerator.class -------------------------------------------------------------------------------- /org.junit.tools/classes/org/junit/tools/generator/model/GeneratorModel.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/junit-tools-team/junit-tools/HEAD/org.junit.tools/classes/org/junit/tools/generator/model/GeneratorModel.class -------------------------------------------------------------------------------- /org.junit.tools/classes/org/junit/tools/generator/model/tml/Assertion.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/junit-tools-team/junit-tools/HEAD/org.junit.tools/classes/org/junit/tools/generator/model/tml/Assertion.class -------------------------------------------------------------------------------- /org.junit.tools/classes/org/junit/tools/generator/model/tml/Constructor.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/junit-tools-team/junit-tools/HEAD/org.junit.tools/classes/org/junit/tools/generator/model/tml/Constructor.class -------------------------------------------------------------------------------- /org.junit.tools/classes/org/junit/tools/generator/model/tml/TestBases.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/junit-tools-team/junit-tools/HEAD/org.junit.tools/classes/org/junit/tools/generator/model/tml/TestBases.class -------------------------------------------------------------------------------- /org.junit.tools/classes/org/junit/tools/generator/utils/GeneratorUtils.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/junit-tools-team/junit-tools/HEAD/org.junit.tools/classes/org/junit/tools/generator/utils/GeneratorUtils.class -------------------------------------------------------------------------------- /org.junit.tools/classes/org/junit/tools/refactoring/DeleteTestElements.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/junit-tools-team/junit-tools/HEAD/org.junit.tools/classes/org/junit/tools/refactoring/DeleteTestElements.class -------------------------------------------------------------------------------- /org.junit.tools/classes/org/junit/tools/refactoring/MoveTestElements$1.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/junit-tools-team/junit-tools/HEAD/org.junit.tools/classes/org/junit/tools/refactoring/MoveTestElements$1.class -------------------------------------------------------------------------------- /org.junit.tools/classes/org/junit/tools/refactoring/RenameTestElements.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/junit-tools-team/junit-tools/HEAD/org.junit.tools/classes/org/junit/tools/refactoring/RenameTestElements.class -------------------------------------------------------------------------------- /org.junit.tools/classes/org/junit/tools/generator/model/tml/AssertionType.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/junit-tools-team/junit-tools/HEAD/org.junit.tools/classes/org/junit/tools/generator/model/tml/AssertionType.class -------------------------------------------------------------------------------- /org.junit.tools/classes/org/junit/tools/generator/model/tml/ObjectFactory.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/junit-tools-team/junit-tools/HEAD/org.junit.tools/classes/org/junit/tools/generator/model/tml/ObjectFactory.class -------------------------------------------------------------------------------- /org.junit.tools/classes/org/junit/tools/generator/model/tml/Precondition.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/junit-tools-team/junit-tools/HEAD/org.junit.tools/classes/org/junit/tools/generator/model/tml/Precondition.class -------------------------------------------------------------------------------- /org.junit.tools/classes/org/junit/tools/generator/model/tml/package-info.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/junit-tools-team/junit-tools/HEAD/org.junit.tools/classes/org/junit/tools/generator/model/tml/package-info.class -------------------------------------------------------------------------------- /org.junit.tools/classes/org/junit/tools/handler/GenerateMockClassHandler.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/junit-tools-team/junit-tools/HEAD/org.junit.tools/classes/org/junit/tools/handler/GenerateMockClassHandler.class -------------------------------------------------------------------------------- /org.junit.tools/classes/org/junit/tools/handler/GenerateTestClassHandler.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/junit-tools-team/junit-tools/HEAD/org.junit.tools/classes/org/junit/tools/handler/GenerateTestClassHandler.class -------------------------------------------------------------------------------- /org.junit.tools/classes/org/junit/tools/handler/GenerateTestSuitesHandler.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/junit-tools-team/junit-tools/HEAD/org.junit.tools/classes/org/junit/tools/handler/GenerateTestSuitesHandler.class -------------------------------------------------------------------------------- /org.junit.tools/classes/org/junit/tools/refactoring/DeleteTestElements$1.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/junit-tools-team/junit-tools/HEAD/org.junit.tools/classes/org/junit/tools/refactoring/DeleteTestElements$1.class -------------------------------------------------------------------------------- /org.junit.tools/classes/org/junit/tools/refactoring/RenameTestElements$1.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/junit-tools-team/junit-tools/HEAD/org.junit.tools/classes/org/junit/tools/refactoring/RenameTestElements$1.class -------------------------------------------------------------------------------- /org.junit.tools/classes/org/junit/tools/generator/model/tml/ParamAssignment.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/junit-tools-team/junit-tools/HEAD/org.junit.tools/classes/org/junit/tools/generator/model/tml/ParamAssignment.class -------------------------------------------------------------------------------- /org.junit.tools/classes/org/junit/tools/preferences/IJUTPreferenceConstants.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/junit-tools-team/junit-tools/HEAD/org.junit.tools/classes/org/junit/tools/preferences/IJUTPreferenceConstants.class -------------------------------------------------------------------------------- /org.junit.tools/classes/org/junit/tools/preferences/JUTPreferenceInitializer.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/junit-tools-team/junit-tools/HEAD/org.junit.tools/classes/org/junit/tools/preferences/JUTPreferenceInitializer.class -------------------------------------------------------------------------------- /org.junit.tools/classes/org/junit/tools/ui/generator/wizards/GeneratorWizard.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/junit-tools-team/junit-tools/HEAD/org.junit.tools/classes/org/junit/tools/ui/generator/wizards/GeneratorWizard.class -------------------------------------------------------------------------------- /org.junit.tools/classes/org/junit/tools/ui/preferences/JUTPreferenceMainPage.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/junit-tools-team/junit-tools/HEAD/org.junit.tools/classes/org/junit/tools/ui/preferences/JUTPreferenceMainPage.class -------------------------------------------------------------------------------- /org.junit.tools/classes/org/junit/tools/ui/preferences/JUTPreferenceFilterPage.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/junit-tools-team/junit-tools/HEAD/org.junit.tools/classes/org/junit/tools/ui/preferences/JUTPreferenceFilterPage.class -------------------------------------------------------------------------------- /org.junit.tools/classes/org/junit/tools/base/MethodAnalyzer$MethodAnalyzeResult.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/junit-tools-team/junit-tools/HEAD/org.junit.tools/classes/org/junit/tools/base/MethodAnalyzer$MethodAnalyzeResult.class -------------------------------------------------------------------------------- /org.junit.tools/classes/org/junit/tools/generator/model/JUTElements$JUTProjects.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/junit-tools-team/junit-tools/HEAD/org.junit.tools/classes/org/junit/tools/generator/model/JUTElements$JUTProjects.class -------------------------------------------------------------------------------- /org.junit.tools/classes/org/junit/tools/handler/CreateNecessaryTestsReportHandler.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/junit-tools-team/junit-tools/HEAD/org.junit.tools/classes/org/junit/tools/handler/CreateNecessaryTestsReportHandler.class -------------------------------------------------------------------------------- /org.junit.tools/classes/org/junit/tools/ui/generator/swt/view/GeneratorMainView$1.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/junit-tools-team/junit-tools/HEAD/org.junit.tools/classes/org/junit/tools/ui/generator/swt/view/GeneratorMainView$1.class -------------------------------------------------------------------------------- /org.junit.tools/classes/org/junit/tools/ui/generator/swt/view/GeneratorMainView.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/junit-tools-team/junit-tools/HEAD/org.junit.tools/classes/org/junit/tools/ui/generator/swt/view/GeneratorMainView.class -------------------------------------------------------------------------------- /org.junit.tools/classes/org/junit/tools/ui/generator/swt/view/MockGeneratorView.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/junit-tools-team/junit-tools/HEAD/org.junit.tools/classes/org/junit/tools/ui/generator/swt/view/MockGeneratorView.class -------------------------------------------------------------------------------- /org.junit.tools/classes/org/junit/tools/ui/generator/wizards/GeneratorWizardBase.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/junit-tools-team/junit-tools/HEAD/org.junit.tools/classes/org/junit/tools/ui/generator/wizards/GeneratorWizardBase.class -------------------------------------------------------------------------------- /org.junit.tools/classes/org/junit/tools/ui/generator/wizards/GeneratorWizardMain.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/junit-tools-team/junit-tools/HEAD/org.junit.tools/classes/org/junit/tools/ui/generator/wizards/GeneratorWizardMain.class -------------------------------------------------------------------------------- /org.junit.tools/classes/org/junit/tools/ui/generator/wizards/MockGeneratorWizard.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/junit-tools-team/junit-tools/HEAD/org.junit.tools/classes/org/junit/tools/ui/generator/wizards/MockGeneratorWizard.class -------------------------------------------------------------------------------- /org.junit.tools/classes/org/junit/tools/ui/preferences/JUTPreferenceFilterPage$1.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/junit-tools-team/junit-tools/HEAD/org.junit.tools/classes/org/junit/tools/ui/preferences/JUTPreferenceFilterPage$1.class -------------------------------------------------------------------------------- /org.junit.tools/classes/org/junit/tools/ui/preferences/JUTPreferenceFilterPage$2.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/junit-tools-team/junit-tools/HEAD/org.junit.tools/classes/org/junit/tools/ui/preferences/JUTPreferenceFilterPage$2.class -------------------------------------------------------------------------------- /org.junit.tools/classes/org/junit/tools/ui/preferences/JUTPreferenceFilterPage$3.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/junit-tools-team/junit-tools/HEAD/org.junit.tools/classes/org/junit/tools/ui/preferences/JUTPreferenceFilterPage$3.class -------------------------------------------------------------------------------- /org.junit.tools/classes/org/junit/tools/ui/preferences/JUTPreferenceFilterPage$4.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/junit-tools-team/junit-tools/HEAD/org.junit.tools/classes/org/junit/tools/ui/preferences/JUTPreferenceFilterPage$4.class -------------------------------------------------------------------------------- /org.junit.tools/classes/org/junit/tools/ui/generator/wizards/GeneratorWizardMain$1.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/junit-tools-team/junit-tools/HEAD/org.junit.tools/classes/org/junit/tools/ui/generator/wizards/GeneratorWizardMain$1.class -------------------------------------------------------------------------------- /org.junit.tools/classes/org/junit/tools/ui/generator/wizards/GeneratorWizardMain$2.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/junit-tools-team/junit-tools/HEAD/org.junit.tools/classes/org/junit/tools/ui/generator/wizards/GeneratorWizardMain$2.class -------------------------------------------------------------------------------- /org.junit.tools/classes/org/junit/tools/ui/generator/wizards/GeneratorWizardMain$3.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/junit-tools-team/junit-tools/HEAD/org.junit.tools/classes/org/junit/tools/ui/generator/wizards/GeneratorWizardMain$3.class -------------------------------------------------------------------------------- /org.junit.tools/classes/org/junit/tools/ui/generator/wizards/MockGeneratorWizard$1.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/junit-tools-team/junit-tools/HEAD/org.junit.tools/classes/org/junit/tools/ui/generator/wizards/MockGeneratorWizard$1.class -------------------------------------------------------------------------------- /org.junit.tools/classes/org/junit/tools/ui/generator/swt/view/GroupMethodSelectionView.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/junit-tools-team/junit-tools/HEAD/org.junit.tools/classes/org/junit/tools/ui/generator/swt/view/GroupMethodSelectionView.class -------------------------------------------------------------------------------- /org.junit.tools/classes/org/junit/tools/generator/TestCasesGenerator$ExpressionAnalyzer.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/junit-tools-team/junit-tools/HEAD/org.junit.tools/classes/org/junit/tools/generator/TestCasesGenerator$ExpressionAnalyzer.class -------------------------------------------------------------------------------- /org.junit.tools/classes/org/junit/tools/generator/TestSuitesGenerator$TestSuiteDeclaration.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/junit-tools-team/junit-tools/HEAD/org.junit.tools/classes/org/junit/tools/generator/TestSuitesGenerator$TestSuiteDeclaration.class -------------------------------------------------------------------------------- /org.junit.tools/classes/org/junit/tools/generator/model/JUTElements$JUTClassesAndPackages.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/junit-tools-team/junit-tools/HEAD/org.junit.tools/classes/org/junit/tools/generator/model/JUTElements$JUTClassesAndPackages.class -------------------------------------------------------------------------------- /org.junit.tools/classes/org/junit/tools/ui/generator/swt/control/GroupMethodSelectionCtrl$1.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/junit-tools-team/junit-tools/HEAD/org.junit.tools/classes/org/junit/tools/ui/generator/swt/control/GroupMethodSelectionCtrl$1.class -------------------------------------------------------------------------------- /org.junit.tools/classes/org/junit/tools/ui/generator/swt/control/GroupMethodSelectionCtrl$2.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/junit-tools-team/junit-tools/HEAD/org.junit.tools/classes/org/junit/tools/ui/generator/swt/control/GroupMethodSelectionCtrl$2.class -------------------------------------------------------------------------------- /org.junit.tools/classes/org/junit/tools/ui/generator/swt/control/GroupMethodSelectionCtrl$3.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/junit-tools-team/junit-tools/HEAD/org.junit.tools/classes/org/junit/tools/ui/generator/swt/control/GroupMethodSelectionCtrl$3.class -------------------------------------------------------------------------------- /org.junit.tools/classes/org/junit/tools/ui/generator/swt/control/GroupMethodSelectionCtrl$4.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/junit-tools-team/junit-tools/HEAD/org.junit.tools/classes/org/junit/tools/ui/generator/swt/control/GroupMethodSelectionCtrl$4.class -------------------------------------------------------------------------------- /org.junit.tools/classes/org/junit/tools/ui/generator/swt/control/GroupMethodSelectionCtrl$5.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/junit-tools-team/junit-tools/HEAD/org.junit.tools/classes/org/junit/tools/ui/generator/swt/control/GroupMethodSelectionCtrl$5.class -------------------------------------------------------------------------------- /org.junit.tools/classes/org/junit/tools/ui/generator/swt/control/GroupMethodSelectionCtrl$6.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/junit-tools-team/junit-tools/HEAD/org.junit.tools/classes/org/junit/tools/ui/generator/swt/control/GroupMethodSelectionCtrl$6.class -------------------------------------------------------------------------------- /org.junit.tools/classes/org/junit/tools/ui/generator/swt/control/GroupMethodSelectionCtrl$7.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/junit-tools-team/junit-tools/HEAD/org.junit.tools/classes/org/junit/tools/ui/generator/swt/control/GroupMethodSelectionCtrl$7.class -------------------------------------------------------------------------------- /org.junit.tools/classes/org/junit/tools/ui/generator/swt/control/GroupMethodSelectionCtrl.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/junit-tools-team/junit-tools/HEAD/org.junit.tools/classes/org/junit/tools/ui/generator/swt/control/GroupMethodSelectionCtrl.class -------------------------------------------------------------------------------- /org.junit.tools/classes/org/junit/tools/ui/generator/wizards/pages/GeneratorWizardBasePage.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/junit-tools-team/junit-tools/HEAD/org.junit.tools/classes/org/junit/tools/ui/generator/wizards/pages/GeneratorWizardBasePage.class -------------------------------------------------------------------------------- /org.junit.tools/classes/org/junit/tools/ui/generator/wizards/pages/GeneratorWizardMainPage.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/junit-tools-team/junit-tools/HEAD/org.junit.tools/classes/org/junit/tools/ui/generator/wizards/pages/GeneratorWizardMainPage.class -------------------------------------------------------------------------------- /org.junit.tools/classes/org/junit/tools/ui/generator/wizards/pages/MockGeneratorWizardPage.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/junit-tools-team/junit-tools/HEAD/org.junit.tools/classes/org/junit/tools/ui/generator/wizards/pages/MockGeneratorWizardPage.class -------------------------------------------------------------------------------- /org.junit.tools/classes/org/junit/tools/generator/model/JUTElements$JUTConstructorsAndMethods.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/junit-tools-team/junit-tools/HEAD/org.junit.tools/classes/org/junit/tools/generator/model/JUTElements$JUTConstructorsAndMethods.class -------------------------------------------------------------------------------- /org.junit.tools/classes/org/junit/tools/ui/generator/wizards/IMethodeSelectionChangedListener.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/junit-tools-team/junit-tools/HEAD/org.junit.tools/classes/org/junit/tools/ui/generator/wizards/IMethodeSelectionChangedListener.class -------------------------------------------------------------------------------- /org.junit.tools/classes/org/junit/tools/ui/generator/swt/control/GroupMethodSelectionCtrl$CheckStateProvider.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/junit-tools-team/junit-tools/HEAD/org.junit.tools/classes/org/junit/tools/ui/generator/swt/control/GroupMethodSelectionCtrl$CheckStateProvider.class -------------------------------------------------------------------------------- /org.junit.tools/classes/org/junit/tools/ui/generator/swt/control/GroupMethodSelectionCtrl$ViewerFilterMethods.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/junit-tools-team/junit-tools/HEAD/org.junit.tools/classes/org/junit/tools/ui/generator/swt/control/GroupMethodSelectionCtrl$ViewerFilterMethods.class -------------------------------------------------------------------------------- /org.junit.tools/build.properties: -------------------------------------------------------------------------------- 1 | output.. = classes/ 2 | bin.includes = plugin.xml,\ 3 | META-INF/,\ 4 | .,\ 5 | res/,\ 6 | schema/ 7 | src.includes = schema/,\ 8 | res/,\ 9 | plugin.xml 10 | source.. = src/ 11 | -------------------------------------------------------------------------------- /org.junit.tools/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /org.junit.tools/src/org/junit/tools/base/JUTWarning.java: -------------------------------------------------------------------------------- 1 | package org.junit.tools.base; 2 | 3 | /** 4 | * Exception-class for warnings. 5 | * 6 | * @author JUnit-Tools-Team 7 | */ 8 | public class JUTWarning extends Exception { 9 | 10 | private static final long serialVersionUID = -1584284318773929357L; 11 | 12 | public JUTWarning(String message) { 13 | super(message); 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /org.junit.tools/src/org/junit/tools/ui/generator/wizards/IMethodeSelectionChangedListener.java: -------------------------------------------------------------------------------- 1 | package org.junit.tools.ui.generator.wizards; 2 | 3 | import java.util.Vector; 4 | 5 | import org.eclipse.jdt.core.IMethod; 6 | 7 | public interface IMethodeSelectionChangedListener { 8 | 9 | public void methodSelectionChanged(Vector checkedMethods); 10 | 11 | public void selectedMethodChecked(IMethod selectedMethod); 12 | } 13 | -------------------------------------------------------------------------------- /org.junit.tools/src/org/junit/tools/reports/model/package-info.java: -------------------------------------------------------------------------------- 1 | // 2 | // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 3 | // See http://java.sun.com/xml/jaxb 4 | // Any modifications to this file will be lost upon recompilation of the source schema. 5 | // Generated on: 2015.11.23 at 09:36:22 AM CET 6 | // 7 | 8 | @javax.xml.bind.annotation.XmlSchema(namespace = "http://www.junit-tools.org/ntrml/ntrml.xsd") 9 | package org.junit.tools.reports.model; 10 | -------------------------------------------------------------------------------- /org.junit.tools/src/org/junit/tools/generator/model/tml/package-info.java: -------------------------------------------------------------------------------- 1 | // 2 | // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 3 | // See http://java.sun.com/xml/jaxb 4 | // Any modifications to this file will be lost upon recompilation of the source schema. 5 | // Generated on: 2015.11.22 at 02:08:56 AM CET 6 | // 7 | 8 | @javax.xml.bind.annotation.XmlSchema(namespace = "http://www.junit-tools.org/tml/tml.xsd") 9 | package org.junit.tools.generator.model.tml; 10 | -------------------------------------------------------------------------------- /org.junit.tools/src/org/junit/tools/base/JUTException.java: -------------------------------------------------------------------------------- 1 | package org.junit.tools.base; 2 | 3 | import org.apache.commons.lang.exception.ExceptionUtils; 4 | 5 | /** 6 | * Exception-class for errors. 7 | * 8 | * @author JUnit-Tools-Team 9 | */ 10 | public class JUTException extends Exception { 11 | 12 | private static final long serialVersionUID = -7377779767226130892L; 13 | 14 | public JUTException(String message) { 15 | super(message); 16 | } 17 | 18 | public JUTException(Throwable exception) { 19 | super(ExceptionUtils.getFullStackTrace(exception)); 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /org.junit.tools/src/org/junit/tools/configuration/base/MethodRef.java: -------------------------------------------------------------------------------- 1 | package org.junit.tools.configuration.base; 2 | 3 | import java.lang.annotation.Documented; 4 | import java.lang.annotation.ElementType; 5 | import java.lang.annotation.Retention; 6 | import java.lang.annotation.RetentionPolicy; 7 | import java.lang.annotation.Target; 8 | 9 | /** 10 | * Annotation to define a reference to a method and its signature. 11 | * 12 | * @author Robert Streng 13 | */ 14 | @Retention(RetentionPolicy.SOURCE) 15 | @Target(ElementType.METHOD) 16 | @Documented 17 | public @interface MethodRef { 18 | 19 | String name(); 20 | 21 | String signature(); 22 | } 23 | -------------------------------------------------------------------------------- /org.junit.tools/.settings/org.eclipse.jdt.core.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled 3 | org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 4 | org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve 5 | org.eclipse.jdt.core.compiler.compliance=1.6 6 | org.eclipse.jdt.core.compiler.debug.lineNumber=generate 7 | org.eclipse.jdt.core.compiler.debug.localVariable=generate 8 | org.eclipse.jdt.core.compiler.debug.sourceFile=generate 9 | org.eclipse.jdt.core.compiler.problem.assertIdentifier=error 10 | org.eclipse.jdt.core.compiler.problem.enumIdentifier=error 11 | org.eclipse.jdt.core.compiler.source=1.6 12 | -------------------------------------------------------------------------------- /org.junit.tools/src/org/junit/tools/generator/ITestDataFactory.java: -------------------------------------------------------------------------------- 1 | package org.junit.tools.generator; 2 | 3 | import org.eclipse.jdt.core.IType; 4 | 5 | /** 6 | * Interface for a test-data-factory. With a test-data-factory a special 7 | * creation-code can be added for special types. 8 | * 9 | * @author JUnit-Tools-Team 10 | * 11 | */ 12 | public interface ITestDataFactory { 13 | 14 | /** 15 | * Creates the creation for the given param-type. 16 | * 17 | * @param paramType 18 | * @param classCreationChain 19 | * @return true if the creation was done 20 | */ 21 | boolean createTypeCreation(IType paramType, StringBuilder classCreationChain); 22 | 23 | } 24 | -------------------------------------------------------------------------------- /org.junit.tools/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | org.junit.tools 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | org.eclipse.pde.ManifestBuilder 15 | 16 | 17 | 18 | 19 | org.eclipse.pde.SchemaBuilder 20 | 21 | 22 | 23 | 24 | 25 | org.eclipse.pde.PluginNature 26 | org.eclipse.jdt.core.javanature 27 | 28 | 29 | -------------------------------------------------------------------------------- /org.junit.tools/src/org/junit/tools/ui/generator/wizards/pages/MockGeneratorWizardPage.java: -------------------------------------------------------------------------------- 1 | package org.junit.tools.ui.generator.wizards.pages; 2 | 3 | import org.eclipse.jface.wizard.WizardPage; 4 | import org.eclipse.swt.SWT; 5 | import org.eclipse.swt.widgets.Composite; 6 | import org.junit.tools.ui.generator.swt.view.MockGeneratorView; 7 | 8 | public class MockGeneratorWizardPage extends WizardPage { 9 | 10 | private MockGeneratorView view; 11 | 12 | public MockGeneratorWizardPage(String pageName) { 13 | super(pageName); 14 | } 15 | 16 | @Override 17 | public void createControl(Composite parent) { 18 | view = new MockGeneratorView(parent, SWT.NONE); 19 | setControl(parent); 20 | } 21 | 22 | public MockGeneratorView getView() { 23 | return view; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /org.junit.tools/src/org/junit/tools/generator/IMockClassGenerator.java: -------------------------------------------------------------------------------- 1 | package org.junit.tools.generator; 2 | 3 | import org.eclipse.core.runtime.CoreException; 4 | import org.eclipse.jdt.core.ICompilationUnit; 5 | import org.eclipse.jface.viewers.IStructuredSelection; 6 | import org.eclipse.ui.IFileEditorInput; 7 | import org.eclipse.ui.IWorkbenchWindow; 8 | import org.junit.tools.base.JUTException; 9 | import org.junit.tools.base.JUTWarning; 10 | 11 | /** 12 | * Interface for the mock-class-generators. 13 | * 14 | * @author JUnit-Tools-Team 15 | * 16 | */ 17 | public interface IMockClassGenerator { 18 | public ICompilationUnit generate(IWorkbenchWindow activeWorkbenchWindow, 19 | IFileEditorInput fileEditorInput) throws JUTWarning, CoreException, JUTException; 20 | 21 | public ICompilationUnit generate(IWorkbenchWindow activeWorkbenchWindow, 22 | IStructuredSelection selection) throws JUTWarning, CoreException, JUTException; 23 | 24 | public void cleanMock(ICompilationUnit cu) throws CoreException, JUTException, JUTWarning; 25 | } 26 | -------------------------------------------------------------------------------- /org.junit.tools/src/org/junit/tools/configuration/base/Testprio.java: -------------------------------------------------------------------------------- 1 | package org.junit.tools.configuration.base; 2 | 3 | import static java.lang.annotation.ElementType.TYPE; 4 | import static java.lang.annotation.RetentionPolicy.SOURCE; 5 | 6 | import java.lang.annotation.Documented; 7 | import java.lang.annotation.Retention; 8 | import java.lang.annotation.Target; 9 | 10 | import javax.xml.bind.annotation.XmlEnumValue; 11 | 12 | /** 13 | * The test-priority. Default is Testprio.DEFAULT. For example this annotation 14 | * can be used for different test-suites and test-executions. 15 | * 16 | * @author Robert Streng 17 | */ 18 | @Documented 19 | @Retention(SOURCE) 20 | @Target({ TYPE }) 21 | public @interface Testprio { 22 | 23 | TestprioValue prio() default TestprioValue.DEFAULT; 24 | 25 | public enum TestprioValue { 26 | 27 | @XmlEnumValue("high") 28 | HIGH("high"), @XmlEnumValue("default") 29 | DEFAULT("default"), @XmlEnumValue("low") 30 | LOW("low"); 31 | 32 | private final String value; 33 | 34 | TestprioValue(String v) { 35 | value = v; 36 | } 37 | 38 | public String value() { 39 | return value; 40 | } 41 | 42 | public static TestprioValue fromValue(String v) { 43 | for (TestprioValue c : TestprioValue.values()) { 44 | if (c.value.equals(v)) { 45 | return c; 46 | } 47 | } 48 | throw new IllegalArgumentException(v); 49 | } 50 | 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /org.junit.tools/src/org/junit/tools/handler/CreateNecessaryTestsReportHandler.java: -------------------------------------------------------------------------------- 1 | package org.junit.tools.handler; 2 | 3 | import org.eclipse.core.commands.ExecutionEvent; 4 | import org.eclipse.core.commands.ExecutionException; 5 | import org.eclipse.jface.dialogs.MessageDialog; 6 | import org.eclipse.jface.viewers.ISelection; 7 | import org.eclipse.ui.IWorkbenchWindow; 8 | import org.junit.tools.base.JUTWarning; 9 | import org.junit.tools.base.MainController; 10 | import org.junit.tools.messages.Messages; 11 | import org.junit.tools.ui.utils.EclipseUIUtils; 12 | 13 | /** 14 | * Create necessary tests report handler 15 | * 16 | * @author JUnit-Tools-Team 17 | * 18 | */ 19 | public class CreateNecessaryTestsReportHandler extends JUTHandler { 20 | 21 | @Override 22 | public Object execute(ExecutionEvent event) throws ExecutionException { 23 | try { 24 | IWorkbenchWindow activeWorkbenchWindow = EclipseUIUtils 25 | .getActiveWorkbenchWindow(); 26 | ISelection selection = activeWorkbenchWindow.getSelectionService() 27 | .getSelection(); 28 | 29 | MainController mc = new MainController(); 30 | mc.createReport(activeWorkbenchWindow, selection); 31 | MessageDialog.openInformation(EclipseUIUtils.getShell(), 32 | information, Messages.General_info_process_successful); 33 | } catch (JUTWarning e) { 34 | handleWarning(e); 35 | } catch (Exception e) { 36 | handleError(e); 37 | } 38 | 39 | return null; 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /org.junit.tools/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Bundle-ManifestVersion: 2 3 | Bundle-Name: org.junit.tools 4 | Bundle-SymbolicName: org.junit.tools;singleton:=true 5 | Bundle-Version: 1.1.0.qualifier 6 | Bundle-Activator: org.junit.tools.Activator 7 | Require-Bundle: org.eclipse.ui;visibility:=reexport, 8 | org.eclipse.core.runtime;visibility:=reexport, 9 | org.eclipse.jdt.core;visibility:=reexport, 10 | org.eclipse.core.resources;visibility:=reexport, 11 | org.eclipse.ui.ide;visibility:=reexport, 12 | org.eclipse.jdt.ui;visibility:=reexport, 13 | org.eclipse.jface.text;visibility:=reexport, 14 | org.apache.commons.lang;visibility:=reexport, 15 | org.eclipse.ltk.core.refactoring;visibility:=reexport, 16 | org.eclipse.ui.editors;visibility:=reexport 17 | Bundle-ActivationPolicy: lazy 18 | Bundle-RequiredExecutionEnvironment: JavaSE-1.6 19 | Export-Package: org.junit.tools, 20 | org.junit.tools.base, 21 | org.junit.tools.configuration.base, 22 | org.junit.tools.generator, 23 | org.junit.tools.generator.model, 24 | org.junit.tools.generator.model.tml, 25 | org.junit.tools.generator.utils, 26 | org.junit.tools.handler, 27 | org.junit.tools.messages, 28 | org.junit.tools.preferences, 29 | org.junit.tools.refactoring, 30 | org.junit.tools.reports, 31 | org.junit.tools.reports.model, 32 | org.junit.tools.ui.generator.swt.control, 33 | org.junit.tools.ui.generator.swt.view, 34 | org.junit.tools.ui.generator.wizards, 35 | org.junit.tools.ui.generator.wizards.pages, 36 | org.junit.tools.ui.preferences, 37 | org.junit.tools.ui.utils 38 | Bundle-ClassPath: . 39 | -------------------------------------------------------------------------------- /org.junit.tools/src/org/junit/tools/ui/generator/swt/view/MockGeneratorView.java: -------------------------------------------------------------------------------- 1 | package org.junit.tools.ui.generator.swt.view; 2 | 3 | import org.eclipse.swt.SWT; 4 | import org.eclipse.swt.layout.GridData; 5 | import org.eclipse.swt.layout.GridLayout; 6 | import org.eclipse.swt.widgets.Button; 7 | import org.eclipse.swt.widgets.Composite; 8 | import org.eclipse.swt.widgets.Text; 9 | 10 | public class MockGeneratorView extends Composite { 11 | 12 | private final GroupMethodSelectionView methodSelectionGroup; 13 | private final Button btnSelectProject; 14 | private final Text txtProject; 15 | 16 | public MockGeneratorView(Composite parent, int style) { 17 | super(parent, style); 18 | setLayout(new GridLayout(1, false)); 19 | 20 | methodSelectionGroup = new GroupMethodSelectionView(this, SWT.NONE); 21 | methodSelectionGroup.setLayoutData(new GridData(SWT.FILL, SWT.FILL, 22 | true, true, 1, 1)); 23 | 24 | Composite projectContainer = new Composite(this, SWT.NONE); 25 | projectContainer.setLayout(new GridLayout(2, false)); 26 | 27 | txtProject = new Text(projectContainer, SWT.NONE); 28 | GridData gd_txtProject = new GridData(SWT.LEFT, SWT.CENTER, true, 29 | false, 1, 1); 30 | gd_txtProject.widthHint = 200; 31 | txtProject.setLayoutData(gd_txtProject); 32 | txtProject.setEditable(false); 33 | 34 | btnSelectProject = new Button(projectContainer, SWT.NONE); 35 | btnSelectProject.setText("Select project"); 36 | } 37 | 38 | public GroupMethodSelectionView getMethodSelectionGroup() { 39 | return methodSelectionGroup; 40 | } 41 | 42 | public Button getBtnSelectProject() { 43 | return btnSelectProject; 44 | } 45 | 46 | public Text getTxtProject() { 47 | return txtProject; 48 | } 49 | 50 | } 51 | -------------------------------------------------------------------------------- /org.junit.tools/src/org/junit/tools/generator/IGeneratorConstants.java: -------------------------------------------------------------------------------- 1 | package org.junit.tools.generator; 2 | 3 | /** 4 | * General constants for the generators. 5 | * 6 | * @author JUnit-Tools-Team 7 | */ 8 | public interface IGeneratorConstants { 9 | 10 | public static final String TML_VERSION_ACTUAL = "1.0.0"; 11 | 12 | public static final String MOD_PUBLIC = "public"; 13 | public static final String MOD_PROTECTED = "protected"; 14 | public static final String MOD_PRIVATE = "private"; 15 | public static final String MOD_PACKAGE = ""; 16 | public static final String MOD_STATIC_WITH_BLANK = " static"; 17 | 18 | public static final String TYPE_VOID = "void"; 19 | public static final String TYPE_STRING = "String"; 20 | public static final String TYPE_CHAR = "char"; 21 | public static final String TYPE_BYTE = "byte"; 22 | public static final String TYPE_DOUBLE = "double"; 23 | public static final String TYPE_INT = "int"; 24 | public static final String TYPE_INTEGER = "Integer"; 25 | public static final String TYPE_BOOLEAN = "boolean"; 26 | public static final String TYPE_FLOAT = "float"; 27 | 28 | public static final String TYPE_ARRAY = "[]"; 29 | 30 | public static final String RETURN = "\n"; 31 | 32 | public final static String QUOTES = "\""; 33 | 34 | public static final String VERSION = "org.junit-tools-1.1.0"; 35 | 36 | public static final String ANNO_GENERATED_NAME = "Generated"; 37 | public static final String ANNO_GENERATED = "@" + ANNO_GENERATED_NAME; 38 | 39 | public static final String ANNO_METHOD_REF_NAME = "MethodRef"; 40 | public static final String ANNO_METHOD_REF = "@"; 41 | 42 | public static final String INCREMENT_SEPERATOR = "_"; 43 | } 44 | -------------------------------------------------------------------------------- /org.junit.tools/src/org/junit/tools/generator/model/tml/AssertionType.java: -------------------------------------------------------------------------------- 1 | // 2 | // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 3 | // See http://java.sun.com/xml/jaxb 4 | // Any modifications to this file will be lost upon recompilation of the source schema. 5 | // Generated on: 2015.11.22 at 02:08:56 AM CET 6 | // 7 | 8 | 9 | package org.junit.tools.generator.model.tml; 10 | 11 | import javax.xml.bind.annotation.XmlEnum; 12 | import javax.xml.bind.annotation.XmlType; 13 | 14 | 15 | /** 16 | *

Java class for AssertionType. 17 | * 18 | *

The following schema fragment specifies the expected content contained within this class. 19 | *

20 | *

21 |  * <simpleType name="AssertionType">
22 |  *   <restriction base="{http://www.w3.org/2001/XMLSchema}string">
23 |  *     <enumeration value="IS_NULL"/>
24 |  *     <enumeration value="NOT_NULL"/>
25 |  *     <enumeration value="EQUALS"/>
26 |  *     <enumeration value="NOT_EQUALS"/>
27 |  *     <enumeration value="IS_TRUE"/>
28 |  *     <enumeration value="IS_FALSE"/>
29 |  *     <enumeration value="CREATER_THAN"/>
30 |  *     <enumeration value="LOWER_THAN"/>
31 |  *   </restriction>
32 |  * </simpleType>
33 |  * 
34 | * 35 | */ 36 | @XmlType(name = "AssertionType") 37 | @XmlEnum 38 | public enum AssertionType { 39 | 40 | IS_NULL, 41 | NOT_NULL, 42 | EQUALS, 43 | NOT_EQUALS, 44 | IS_TRUE, 45 | IS_FALSE, 46 | CREATER_THAN, 47 | LOWER_THAN; 48 | 49 | public String value() { 50 | return name(); 51 | } 52 | 53 | public static AssertionType fromValue(String v) { 54 | return valueOf(v); 55 | } 56 | 57 | } 58 | -------------------------------------------------------------------------------- /org.junit.tools/src/org/junit/tools/preferences/IJUTPreferenceConstants.java: -------------------------------------------------------------------------------- 1 | package org.junit.tools.preferences; 2 | 3 | /** 4 | * Constants for the JUnit-Tools-preferences. 5 | * 6 | * @author Robert Streng 7 | * 8 | */ 9 | public interface IJUTPreferenceConstants { 10 | 11 | public static final String TEST_PROJECT_POSTFIX = "TEST_PROJECT_POSTFIX"; 12 | public static final String TEST_SOURCE_FOLDER_NAME = "TEST_SOURCE_FOLDER_NAME"; 13 | public static final String TEST_PACKAGE_POSTFIX = "TEST_PACKAGE_POSTFIX"; 14 | public static final String TEST_CLASS_PREFIX = "TEST_CLASS_PREFIX"; 15 | public static final String TEST_CLASS_POSTFIX = "TEST_CLASS_POSTFIX"; 16 | public static final String TEST_METHOD_PREFIX = "TEST_METHOD_PREFIX"; 17 | public static final String TEST_METHOD_POSTFIX = "TEST_METHOD_POSTFIX"; 18 | public static final String WRITE_TML = "WRITE_TML"; 19 | public static final String TML_CONTAINER = "TML_CONTAINER"; 20 | public static final String TEST_METHOD_FILTER_NAME = "TEST_METHOD_FILTER_NAME"; 21 | public static final String TEST_METHOD_FILTER_MODIFIER = "TEST_METHOD_FILTER_MODIFIER"; 22 | public static final String TEST_CLASS_SUPER_TYPE = "TEST_CLASS_SUPER_TYPE"; 23 | public static final String MOCK_PROJECT = "MOCK_PROJECT"; 24 | public static final String MOCK_SAVE_IN_TESTPROJECT = "MOCK_SAVE_IN_TESTPROJECT"; 25 | public static final String MOCK_FRAMEWORK = "MOCK_FRAMEWORK"; 26 | public static final String TEST_CLASS_ANNOTATIONS = "TEST_CLASS_ANNOTATIONS"; 27 | public static final String MOCK_CLASS_ANNOTATIONS = "MOCK_CLASS_ANNOTATIONS"; 28 | public static final String STATIC_BINDINGS = "STATIC_BINDINGS"; 29 | public static final String LIST_DELIMITER = ";"; 30 | public static final String LIST_ENTRY_SEPERATOR= " <> "; 31 | } 32 | -------------------------------------------------------------------------------- /org.junit.tools/src/org/junit/tools/ui/generator/wizards/pages/GeneratorWizardBasePage.java: -------------------------------------------------------------------------------- 1 | package org.junit.tools.ui.generator.wizards.pages; 2 | 3 | import org.eclipse.jface.wizard.WizardPage; 4 | import org.junit.tools.generator.model.GeneratorModel; 5 | import org.junit.tools.ui.generator.wizards.GeneratorWizardBase; 6 | 7 | /** 8 | * Base class for the wizard pages. 9 | * 10 | * @author JUnit-Tools-Team 11 | * 12 | */ 13 | public abstract class GeneratorWizardBasePage extends WizardPage { 14 | 15 | protected GeneratorWizardBase controller; 16 | 17 | public void init() { 18 | getController().initPage(); 19 | } 20 | 21 | /** 22 | * Updates the UTM-Model. 23 | */ 24 | public void update() { 25 | getController().updateModel(); 26 | } 27 | 28 | /** 29 | * Constructor 30 | * 31 | * @param title 32 | * @param description 33 | * @param pageName 34 | * @param model 35 | */ 36 | public GeneratorWizardBasePage(String title, String description, 37 | String pageName, GeneratorModel model) { 38 | super(pageName); 39 | setTitle(title); 40 | setDescription(description); 41 | createController(model); 42 | } 43 | 44 | /** 45 | * @return the wizard-controller 46 | */ 47 | protected GeneratorWizardBase getController() { 48 | return controller; 49 | } 50 | 51 | /** 52 | * Creates the wizard-controller. 53 | * 54 | * @param model 55 | */ 56 | protected abstract void createController(GeneratorModel model); 57 | 58 | /** 59 | * Updates the page status. 60 | * 61 | * @param message 62 | */ 63 | public void updateStatus(String message) { 64 | setErrorMessage(message); 65 | setPageComplete(message == null); 66 | } 67 | 68 | } 69 | -------------------------------------------------------------------------------- /org.junit.tools/src/org/junit/tools/handler/GenerateTestSuitesHandler.java: -------------------------------------------------------------------------------- 1 | package org.junit.tools.handler; 2 | 3 | import org.eclipse.core.commands.ExecutionEvent; 4 | import org.eclipse.core.commands.ExecutionException; 5 | import org.eclipse.jdt.core.IJavaProject; 6 | import org.eclipse.jface.dialogs.MessageDialog; 7 | import org.eclipse.jface.viewers.ISelection; 8 | import org.eclipse.ui.IWorkbenchWindow; 9 | import org.eclipse.ui.PlatformUI; 10 | import org.junit.tools.base.JUTWarning; 11 | import org.junit.tools.base.MainController; 12 | import org.junit.tools.generator.utils.JDTUtils; 13 | import org.junit.tools.messages.Messages; 14 | import org.junit.tools.ui.utils.EclipseUIUtils; 15 | 16 | /** 17 | * Generate test suites handler 18 | * 19 | * @author JUnit-Tools-Team 20 | * 21 | */ 22 | public class GenerateTestSuitesHandler extends JUTHandler { 23 | 24 | @Override 25 | public Object execute(ExecutionEvent event) throws ExecutionException { 26 | try { 27 | 28 | IWorkbenchWindow activeWorkbenchWindow; 29 | activeWorkbenchWindow = PlatformUI.getWorkbench() 30 | .getActiveWorkbenchWindow(); 31 | 32 | ISelection selection = activeWorkbenchWindow.getSelectionService() 33 | .getSelection(); 34 | 35 | IJavaProject testProject = JDTUtils.getProject(selection); 36 | 37 | MainController mc = new MainController(); 38 | boolean result = mc.generateTestSuites(activeWorkbenchWindow, 39 | testProject); 40 | 41 | if (result) { 42 | MessageDialog.openInformation(EclipseUIUtils.getShell(), 43 | Messages.General_information, 44 | Messages.General_info_generation_successful); 45 | } 46 | } catch (JUTWarning warning) { 47 | handleWarning(warning); 48 | } catch (Exception e) { 49 | handleError(e); 50 | } 51 | 52 | return null; 53 | } 54 | 55 | } 56 | -------------------------------------------------------------------------------- /org.junit.tools/src/org/junit/tools/generator/model/tml/Testprio.java: -------------------------------------------------------------------------------- 1 | // 2 | // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 3 | // See http://java.sun.com/xml/jaxb 4 | // Any modifications to this file will be lost upon recompilation of the source schema. 5 | // Generated on: 2015.11.22 at 02:08:56 AM CET 6 | // 7 | 8 | 9 | package org.junit.tools.generator.model.tml; 10 | 11 | import javax.xml.bind.annotation.XmlEnum; 12 | import javax.xml.bind.annotation.XmlEnumValue; 13 | import javax.xml.bind.annotation.XmlType; 14 | 15 | 16 | /** 17 | *

Java class for Testprio. 18 | * 19 | *

The following schema fragment specifies the expected content contained within this class. 20 | *

21 | *

22 |  * <simpleType name="Testprio">
23 |  *   <restriction base="{http://www.w3.org/2001/XMLSchema}string">
24 |  *     <enumeration value="high"/>
25 |  *     <enumeration value="default"/>
26 |  *     <enumeration value="low"/>
27 |  *   </restriction>
28 |  * </simpleType>
29 |  * 
30 | * 31 | */ 32 | @XmlType(name = "Testprio") 33 | @XmlEnum 34 | public enum Testprio { 35 | 36 | @XmlEnumValue("high") 37 | HIGH("high"), 38 | @XmlEnumValue("default") 39 | DEFAULT("default"), 40 | @XmlEnumValue("low") 41 | LOW("low"); 42 | private final String value; 43 | 44 | Testprio(String v) { 45 | value = v; 46 | } 47 | 48 | public String value() { 49 | return value; 50 | } 51 | 52 | public static Testprio fromValue(String v) { 53 | for (Testprio c: Testprio.values()) { 54 | if (c.value.equals(v)) { 55 | return c; 56 | } 57 | } 58 | throw new IllegalArgumentException(v); 59 | } 60 | 61 | } 62 | -------------------------------------------------------------------------------- /org.junit.tools/src/org/junit/tools/generator/ITestSuitesGenerator.java: -------------------------------------------------------------------------------- 1 | package org.junit.tools.generator; 2 | 3 | import java.util.ArrayList; 4 | 5 | import org.eclipse.core.runtime.CoreException; 6 | import org.eclipse.jdt.core.ICompilationUnit; 7 | import org.eclipse.jdt.core.IJavaProject; 8 | import org.eclipse.jdt.core.IPackageFragment; 9 | import org.junit.tools.base.JUTWarning; 10 | import org.junit.tools.generator.model.JUTElements; 11 | 12 | /** 13 | * Interface for the test-suites-generators. 14 | * 15 | * @author JUnit-Tools-Team 16 | */ 17 | public interface ITestSuitesGenerator { 18 | 19 | /** 20 | * Generates the tests suites depend on the utm-elements. 21 | * 22 | * @param utmElements 23 | * @return true if the creations were successful 24 | * @throws CoreException 25 | * @throws JUTWarning 26 | */ 27 | boolean generateTestSuites(JUTElements utmElements) throws CoreException, JUTWarning; 28 | 29 | /** 30 | * Generates the test-suites for a hole test-project. 31 | * 32 | * @param testProject 33 | * @return true if the creations were successful 34 | * @throws CoreException 35 | */ 36 | boolean generateTestSuites(IJavaProject testProject) throws CoreException; 37 | 38 | /** 39 | * Deletes the deleted test-suite-element in the corresponding test-suite. 40 | * If the test-suite has no elements, then the corresponding test-suite will 41 | * also be deleted. In this case the connected child-test-suites will be 42 | * connected with the next available parent-test-suite. 43 | * 44 | * @param packageOfDeletedClass 45 | * 46 | * @param deletedClass 47 | * @return true if processing was successfull 48 | * @throws CoreException 49 | */ 50 | boolean deleteTestSuiteElement(IPackageFragment packageOfDeletedClass, 51 | ICompilationUnit deletedClass) throws CoreException; 52 | 53 | ArrayList getGeneratedTestSuites(); 54 | } 55 | -------------------------------------------------------------------------------- /org.junit.tools/src/org/junit/tools/Activator.java: -------------------------------------------------------------------------------- 1 | package org.junit.tools; 2 | 3 | import org.eclipse.core.runtime.ILog; 4 | import org.eclipse.ui.plugin.AbstractUIPlugin; 5 | import org.junit.tools.base.ExtensionPointHandler; 6 | import org.osgi.framework.BundleContext; 7 | 8 | /** 9 | * The activator for the junit-tools-plug-in 10 | */ 11 | public class Activator extends AbstractUIPlugin { 12 | 13 | // The plug-in ID 14 | public static final String PLUGIN_ID = "org.junit.tools"; //$NON-NLS-1$ 15 | 16 | // The shared instance 17 | private static Activator plugin; 18 | 19 | private ExtensionPointHandler extensionHandler = null; 20 | 21 | /** 22 | * The constructor 23 | */ 24 | public Activator() { 25 | } 26 | 27 | /* 28 | * (non-Javadoc) 29 | * 30 | * @see 31 | * org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext 32 | * ) 33 | */ 34 | public void start(BundleContext context) throws Exception { 35 | super.start(context); 36 | plugin = this; 37 | 38 | initExtensionHandler(); 39 | } 40 | 41 | private void initExtensionHandler() { 42 | this.extensionHandler = new ExtensionPointHandler(); 43 | } 44 | 45 | /* 46 | * (non-Javadoc) 47 | * 48 | * @see 49 | * org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext 50 | * ) 51 | */ 52 | public void stop(BundleContext context) throws Exception { 53 | plugin = null; 54 | super.stop(context); 55 | } 56 | 57 | /** 58 | * Returns the shared instance 59 | * 60 | * @return the shared instance 61 | */ 62 | public static Activator getDefault() { 63 | return plugin; 64 | } 65 | 66 | public static ILog getLogger() { 67 | return plugin.getLog(); 68 | } 69 | 70 | public ExtensionPointHandler getExtensionHandler() { 71 | return this.extensionHandler; 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /org.junit.tools/src/org/junit/tools/ui/generator/wizards/GeneratorWizardBase.java: -------------------------------------------------------------------------------- 1 | package org.junit.tools.ui.generator.wizards; 2 | 3 | import org.junit.tools.generator.model.GeneratorModel; 4 | import org.junit.tools.generator.model.tml.ObjectFactory; 5 | import org.junit.tools.ui.generator.wizards.pages.GeneratorWizardBasePage; 6 | 7 | /** 8 | * The controller for the base page. 9 | * 10 | * @author JUnit-Tools-Team 11 | * 12 | */ 13 | public abstract class GeneratorWizardBase { 14 | 15 | private final GeneratorWizardBasePage generatorWizardPage; 16 | private final GeneratorModel model; 17 | private ObjectFactory of = new ObjectFactory(); 18 | 19 | /** 20 | * @param model 21 | * @param generatorWizardPageBase 22 | */ 23 | public GeneratorWizardBase(GeneratorModel model, 24 | GeneratorWizardBasePage generatorWizardPageBase) { 25 | this.model = model; 26 | this.generatorWizardPage = generatorWizardPageBase; 27 | } 28 | 29 | /** 30 | * Returns the Page. 31 | * 32 | * @return the page 33 | */ 34 | protected GeneratorWizardBasePage getPage() { 35 | return generatorWizardPage; 36 | } 37 | 38 | /** 39 | * Returns the junit-tools-model with all test data. 40 | * 41 | * @return the UTM-model 42 | */ 43 | protected GeneratorModel getModel() { 44 | return model; 45 | } 46 | 47 | /** 48 | * Returns the object factory for the TML-elements. 49 | * 50 | * @return the object factory 51 | */ 52 | public ObjectFactory getObjectFactory() { 53 | return of; 54 | } 55 | 56 | /** 57 | * Sets the object factory. 58 | * 59 | * @param of 60 | */ 61 | public void setObjectFactory(ObjectFactory of) { 62 | this.of = of; 63 | } 64 | 65 | /** 66 | * Initializes the page 67 | */ 68 | public abstract void initPage(); 69 | 70 | /** 71 | * Updates the UTM-model. 72 | */ 73 | public abstract void updateModel(); 74 | 75 | } 76 | -------------------------------------------------------------------------------- /org.junit.tools/src/org/junit/tools/handler/SwitchClassHandler.java: -------------------------------------------------------------------------------- 1 | package org.junit.tools.handler; 2 | 3 | import java.lang.annotation.Inherited; 4 | 5 | import org.eclipse.core.commands.ExecutionEvent; 6 | import org.eclipse.core.commands.ExecutionException; 7 | import org.eclipse.jface.viewers.ISelection; 8 | import org.eclipse.jface.viewers.IStructuredSelection; 9 | import org.eclipse.ui.IEditorInput; 10 | import org.eclipse.ui.IFileEditorInput; 11 | import org.eclipse.ui.IWorkbenchWindow; 12 | import org.eclipse.ui.PlatformUI; 13 | import org.junit.tools.base.JUTWarning; 14 | import org.junit.tools.base.MainController; 15 | import org.junit.tools.ui.utils.EclipseUIUtils; 16 | 17 | /** 18 | * Command for the switch-function between test-class and test-subject. The 19 | * standard shortcut is ctrl-shift-<. 20 | * 21 | * @author JUnit-Tools-Team 22 | * 23 | */ 24 | public class SwitchClassHandler extends JUTHandler { 25 | 26 | /** 27 | * {@link Inherited} 28 | */ 29 | @Override 30 | public Object execute(ExecutionEvent event) throws ExecutionException { 31 | 32 | MainController ctrl = new MainController(); 33 | IWorkbenchWindow activeWorkbenchWindow; 34 | activeWorkbenchWindow = PlatformUI.getWorkbench() 35 | .getActiveWorkbenchWindow(); 36 | 37 | ISelection selection = activeWorkbenchWindow.getSelectionService() 38 | .getSelection(); 39 | 40 | try { 41 | 42 | if (selection instanceof IStructuredSelection) { 43 | ctrl.switchClass(activeWorkbenchWindow, 44 | (IStructuredSelection) selection); 45 | 46 | } else { 47 | IEditorInput editorInput = EclipseUIUtils.getEditorInput(); 48 | 49 | if (editorInput instanceof IFileEditorInput) { 50 | ctrl.switchClass(activeWorkbenchWindow, 51 | (IFileEditorInput) editorInput); 52 | } 53 | } 54 | } catch (JUTWarning e) { 55 | handleWarning(e); 56 | } catch (Exception e) { 57 | handleError(e); 58 | } 59 | 60 | return null; 61 | } 62 | 63 | } 64 | -------------------------------------------------------------------------------- /org.junit.tools/src/org/junit/tools/generator/ITestClassGenerator.java: -------------------------------------------------------------------------------- 1 | package org.junit.tools.generator; 2 | 3 | import java.util.List; 4 | 5 | import org.eclipse.core.runtime.IProgressMonitor; 6 | import org.eclipse.jdt.core.ICompilationUnit; 7 | import org.junit.tools.generator.model.GeneratorModel; 8 | 9 | /** 10 | * Interface for the test-class-generators. 11 | * 12 | * @author JUnit-Tools-Team 13 | */ 14 | public interface ITestClassGenerator { 15 | /** 16 | * Generates a test class with the model. The base is a class, general 17 | * options and the tml-model. 18 | * 19 | * @param model 20 | * @param testDataFactories 21 | * @param monitor 22 | * @return the generate test class as saved file 23 | * @throws Exception 24 | */ 25 | public ICompilationUnit generate(GeneratorModel model, 26 | List testDataFactories, IProgressMonitor monitor) 27 | throws Exception; 28 | 29 | public static final String ANNO_TESTPRIO_NAME = "Testprio"; 30 | 31 | public static final String ANNO_TESTPRIO = "@" + ANNO_TESTPRIO_NAME; 32 | 33 | public static final String ANNO_JUNIT_TEST = "@Test"; 34 | 35 | public static final String ANNO_JUNIT_BEFORE = "@Before"; 36 | 37 | public static final String ANNO_JUNIT_BEFORE_CLASS = "@BeforeClass"; 38 | 39 | public static final String ANNO_JUNIT_AFTER = "@After"; 40 | 41 | public static final String ANNO_JUNIT_AFTER_CLASS = "@AfterClass"; 42 | 43 | public final static String FAIL_ASSERTION = "Assert.fail();"; 44 | 45 | public final static String TESTSUBJECT_METHOD_PREFIX = "createTestSubject"; 46 | 47 | public final static String STANDARD_METHOD_BEFORE = "setUp"; 48 | 49 | public final static String STANDARD_METHOD_BEFORE_ClASS = "setUpBeforeClass"; 50 | 51 | public final static String STANDARD_METHOD_AFTER = "tearDown"; 52 | 53 | public final static String STANDARD_METHOD_AFTER_CLASS = "tearDownAfterClass"; 54 | 55 | public final static String EXCEPTION = "Exception"; 56 | 57 | } 58 | -------------------------------------------------------------------------------- /org.junit.tools/src/org/junit/tools/ui/generator/wizards/pages/GeneratorWizardMainPage.java: -------------------------------------------------------------------------------- 1 | package org.junit.tools.ui.generator.wizards.pages; 2 | 3 | import java.util.Vector; 4 | 5 | import org.eclipse.jdt.core.ICompilationUnit; 6 | import org.eclipse.jdt.core.IMethod; 7 | import org.eclipse.swt.SWT; 8 | import org.eclipse.swt.widgets.Composite; 9 | import org.junit.tools.generator.model.GeneratorModel; 10 | import org.junit.tools.generator.model.tml.Testprio; 11 | import org.junit.tools.ui.generator.swt.view.GeneratorMainView; 12 | import org.junit.tools.ui.generator.wizards.GeneratorWizardMain; 13 | 14 | /** 15 | * The page for the method-selection and the main settings. 16 | * 17 | * @author JUnit-Tools-Team 18 | * 19 | */ 20 | public class GeneratorWizardMainPage extends GeneratorWizardBasePage { 21 | 22 | private final GeneratorModel model; 23 | 24 | public GeneratorWizardMainPage(String title, String description, 25 | String pageName, GeneratorModel model) { 26 | super(title, description, pageName, model); 27 | this.model = model; 28 | } 29 | 30 | private Vector methods; 31 | 32 | private final Testprio selectedTestprio = Testprio.DEFAULT; 33 | 34 | private GeneratorMainView mainView = null; 35 | 36 | @Override 37 | public void createControl(Composite parent) { 38 | boolean withSuperclass = false; 39 | 40 | ICompilationUnit testClass = model.getJUTElements() 41 | .getClassesAndPackages().getTestClass(); 42 | if (testClass == null || !testClass.exists()) { 43 | withSuperclass = true; 44 | } 45 | 46 | mainView = new GeneratorMainView(parent, SWT.NONE, withSuperclass); 47 | setControl(mainView); 48 | } 49 | 50 | @Override 51 | protected void createController(GeneratorModel model) { 52 | this.controller = new GeneratorWizardMain(model, this); 53 | } 54 | 55 | @Override 56 | public GeneratorWizardMain getController() { 57 | return (GeneratorWizardMain) controller; 58 | } 59 | 60 | public Vector getMethods() { 61 | return methods; 62 | } 63 | 64 | public Testprio getSelectedTestprio() { 65 | return selectedTestprio; 66 | } 67 | 68 | public GeneratorMainView getView() { 69 | return mainView; 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /org.junit.tools/src/org/junit/tools/handler/GenerateTestClassHandler.java: -------------------------------------------------------------------------------- 1 | package org.junit.tools.handler; 2 | 3 | import java.lang.annotation.Inherited; 4 | 5 | import org.eclipse.core.commands.ExecutionEvent; 6 | import org.eclipse.core.commands.ExecutionException; 7 | import org.eclipse.jface.dialogs.MessageDialog; 8 | import org.eclipse.jface.viewers.ISelection; 9 | import org.eclipse.jface.viewers.IStructuredSelection; 10 | import org.eclipse.ui.IEditorInput; 11 | import org.eclipse.ui.IFileEditorInput; 12 | import org.eclipse.ui.IWorkbenchWindow; 13 | import org.eclipse.ui.PlatformUI; 14 | import org.junit.tools.base.JUTWarning; 15 | import org.junit.tools.base.MainController; 16 | import org.junit.tools.messages.Messages; 17 | import org.junit.tools.ui.utils.EclipseUIUtils; 18 | 19 | /** 20 | * Command for the generation of a test-class. The standard shortcut is 21 | * ctrl-shift-<. 22 | * 23 | * @author JUnit-Tools-Team 24 | * 25 | */ 26 | public class GenerateTestClassHandler extends JUTHandler { 27 | 28 | /** 29 | * {@link Inherited} 30 | */ 31 | @Override 32 | public Object execute(ExecutionEvent event) throws ExecutionException { 33 | 34 | MainController ctrl = new MainController(); 35 | IWorkbenchWindow activeWorkbenchWindow; 36 | activeWorkbenchWindow = PlatformUI.getWorkbench().getActiveWorkbenchWindow(); 37 | 38 | ISelection selection = activeWorkbenchWindow.getSelectionService().getSelection(); 39 | boolean result = false; 40 | 41 | try { 42 | if (selection instanceof IStructuredSelection) { 43 | result = ctrl.generateTestclass(activeWorkbenchWindow, (IStructuredSelection) selection); 44 | 45 | } else { 46 | IEditorInput editorInput = EclipseUIUtils.getEditorInput(); 47 | 48 | if (editorInput instanceof IFileEditorInput) { 49 | result = ctrl.generateTestclass(activeWorkbenchWindow, ((IFileEditorInput) editorInput)); 50 | } 51 | } 52 | } catch (JUTWarning e) { 53 | handleWarning(e); 54 | } catch (Exception e) { 55 | handleError(e); 56 | } 57 | 58 | if (result) { 59 | String information = Messages.General_information; 60 | MessageDialog.openInformation(activeWorkbenchWindow.getShell(), information, 61 | Messages.General_info_generation_successful); 62 | } 63 | 64 | return null; 65 | } 66 | 67 | } 68 | -------------------------------------------------------------------------------- /org.junit.tools/src/org/junit/tools/handler/CleanMocksHandler.java: -------------------------------------------------------------------------------- 1 | package org.junit.tools.handler; 2 | 3 | import java.util.Vector; 4 | 5 | import org.eclipse.core.commands.ExecutionEvent; 6 | import org.eclipse.core.commands.ExecutionException; 7 | import org.eclipse.core.runtime.CoreException; 8 | import org.eclipse.jdt.core.ICompilationUnit; 9 | import org.eclipse.jdt.core.IJavaElement; 10 | import org.eclipse.jface.dialogs.MessageDialog; 11 | import org.eclipse.jface.viewers.ISelection; 12 | import org.eclipse.ui.IWorkbenchWindow; 13 | import org.junit.tools.Activator; 14 | import org.junit.tools.base.JUTException; 15 | import org.junit.tools.base.JUTWarning; 16 | import org.junit.tools.generator.IMockClassGenerator; 17 | import org.junit.tools.generator.utils.JDTUtils; 18 | import org.junit.tools.messages.Messages; 19 | import org.junit.tools.ui.utils.EclipseUIUtils; 20 | 21 | /** 22 | * Clean mocks handler 23 | * 24 | * @author JUnit-Tools-Team 25 | * 26 | */ 27 | public class CleanMocksHandler extends JUTHandler { 28 | 29 | @Override 30 | public Object execute(ExecutionEvent event) throws ExecutionException { 31 | try { 32 | cleanMocks(); 33 | 34 | MessageDialog.openInformation(EclipseUIUtils.getShell(), 35 | information, Messages.General_info_generation_successful); 36 | } catch (JUTWarning e) { 37 | handleWarning(e); 38 | } catch (Exception e) { 39 | handleError(e); 40 | } 41 | 42 | return null; 43 | } 44 | 45 | private void cleanMocks() throws JUTWarning, CoreException, JUTException { 46 | 47 | IWorkbenchWindow activeWorkbenchWindow = EclipseUIUtils 48 | .getActiveWorkbenchWindow(); 49 | 50 | ISelection selection = activeWorkbenchWindow.getSelectionService() 51 | .getSelection(); 52 | 53 | IMockClassGenerator mockClassGenerator = Activator.getDefault() 54 | .getExtensionHandler().getMockClassGenerator(); 55 | 56 | Vector elements = JDTUtils.getCompilationUnits(selection); 57 | 58 | for (IJavaElement element : elements) { 59 | if (element instanceof ICompilationUnit) { 60 | if (element.getElementName().indexOf("TestSuite") == -1 61 | && element.getElementName().endsWith("Mock.java") 62 | && JDTUtils.getPackage(element).getElementName().endsWith(".mock")) 63 | mockClassGenerator.cleanMock((ICompilationUnit) element); 64 | } 65 | } 66 | 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /org.junit.tools/src/org/junit/tools/base/MethodRef.java: -------------------------------------------------------------------------------- 1 | package org.junit.tools.base; 2 | 3 | import org.eclipse.jdt.core.IMethod; 4 | import org.eclipse.jdt.core.JavaModelException; 5 | 6 | /** 7 | * Class implementation for the method-reference annotation. 8 | * 9 | * @author JUnit-Tools-Team 10 | * 11 | */ 12 | public class MethodRef { 13 | 14 | private String name; 15 | 16 | private String signature; 17 | 18 | private boolean signatureChanged = false; 19 | 20 | private String signatureNew; 21 | 22 | private boolean unresolvedConflict = false; 23 | 24 | public MethodRef(String name, String signature) { 25 | this.name = name; 26 | this.signature = signature; 27 | } 28 | 29 | public String getName() { 30 | return name; 31 | } 32 | 33 | public String getSignature() { 34 | return signature; 35 | } 36 | 37 | @Override 38 | public String toString() { 39 | return name + signature; 40 | } 41 | 42 | public boolean isSignatureChanged() { 43 | return signatureChanged; 44 | } 45 | 46 | public void setSignatureChanged(boolean signatureChanged) { 47 | this.signatureChanged = signatureChanged; 48 | } 49 | 50 | public void setSignatureNew(String signatureNew) { 51 | setSignatureChanged(true); 52 | this.signatureNew = signatureNew; 53 | } 54 | 55 | public String getSignatureNew() { 56 | return signatureNew; 57 | } 58 | 59 | public void setUnresolvedConflict(boolean unresolvedConflict) { 60 | this.unresolvedConflict = unresolvedConflict; 61 | } 62 | 63 | public boolean isUnresolvedConflict() { 64 | return unresolvedConflict; 65 | } 66 | 67 | public String getSignatureToCompare() { 68 | if (isSignatureChanged()) { 69 | return getSignatureNew(); 70 | } 71 | return getSignature(); 72 | } 73 | 74 | public boolean isEquals(MethodRef mrToCompare) { 75 | if (mrToCompare.getName().equals(getName()) 76 | && mrToCompare.getSignatureToCompare().equals( 77 | getSignatureToCompare())) { 78 | return true; 79 | } 80 | 81 | return false; 82 | } 83 | 84 | public boolean isEquals(IMethod methodToCompare) { 85 | try { 86 | return isEquals(new MethodRef(methodToCompare.getElementName(), 87 | methodToCompare.getSignature())); 88 | } catch (JavaModelException e) { 89 | return false; 90 | } 91 | } 92 | 93 | } 94 | -------------------------------------------------------------------------------- /org.junit.tools/src/org/junit/tools/preferences/JUTPreferenceInitializer.java: -------------------------------------------------------------------------------- 1 | package org.junit.tools.preferences; 2 | 3 | import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer; 4 | import org.eclipse.jface.preference.IPreferenceStore; 5 | import org.junit.tools.Activator; 6 | import org.junit.tools.base.ExtensionPointHandler; 7 | 8 | /** 9 | * Initializer for the junit-tools-preference-values. 10 | * 11 | * @author Robert Streng 12 | */ 13 | public class JUTPreferenceInitializer extends AbstractPreferenceInitializer 14 | implements IJUTPreferenceConstants { 15 | 16 | public static final String DEFAULT_METHOD_FILTER_NAME = "get*;set*;"; 17 | public static final String DEFAULT_METHOD_FILTER_MODIFIER = "private;protected;package;"; 18 | 19 | @Override 20 | public void initializeDefaultPreferences() { 21 | IPreferenceStore store = Activator.getDefault().getPreferenceStore(); 22 | 23 | store.setDefault(WRITE_TML, false); 24 | 25 | store.setDefault(TML_CONTAINER, "test_files"); 26 | 27 | store.setDefault(TEST_PROJECT_POSTFIX, ".test"); 28 | 29 | store.setDefault(TEST_SOURCE_FOLDER_NAME, "src"); 30 | 31 | store.setDefault(TEST_CLASS_SUPER_TYPE, ""); 32 | 33 | store.setDefault(TEST_CLASS_PREFIX, ""); 34 | 35 | store.setDefault(TEST_CLASS_POSTFIX, "Test"); 36 | 37 | store.setDefault(TEST_PACKAGE_POSTFIX, ""); 38 | 39 | store.setDefault(TEST_METHOD_PREFIX, "test"); 40 | store.setDefault(TEST_METHOD_POSTFIX, ""); 41 | 42 | store.setDefault(TEST_METHOD_FILTER_NAME, DEFAULT_METHOD_FILTER_NAME); 43 | store.setDefault(TEST_METHOD_FILTER_MODIFIER, 44 | DEFAULT_METHOD_FILTER_MODIFIER); 45 | 46 | store.setDefault(MOCK_PROJECT, "org.junit.tools.mock"); 47 | 48 | store.setDefault(MOCK_SAVE_IN_TESTPROJECT, true); 49 | 50 | store.setDefault(MOCK_SAVE_IN_TESTPROJECT, "powermock"); 51 | 52 | store.setDefault(TEST_CLASS_ANNOTATIONS, ""); 53 | 54 | store.setDefault(MOCK_CLASS_ANNOTATIONS, ""); 55 | 56 | store.setDefault(STATIC_BINDINGS, ""); 57 | 58 | // initialize JUT-preferences 59 | JUTPreferences.initialize(); 60 | 61 | // set custom preferences 62 | ExtensionPointHandler extensionHandler = Activator.getDefault() 63 | .getExtensionHandler(); 64 | for (AbstractPreferenceInitializer initializer : extensionHandler 65 | .getPreferenceInitializer()) { 66 | initializer.initializeDefaultPreferences(); 67 | } 68 | 69 | } 70 | 71 | } 72 | -------------------------------------------------------------------------------- /org.junit.tools/src/org/junit/tools/generator/model/tml/Mocks.java: -------------------------------------------------------------------------------- 1 | // 2 | // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 3 | // See http://java.sun.com/xml/jaxb 4 | // Any modifications to this file will be lost upon recompilation of the source schema. 5 | // Generated on: 2015.11.22 at 02:08:56 AM CET 6 | // 7 | 8 | 9 | package org.junit.tools.generator.model.tml; 10 | 11 | import java.util.ArrayList; 12 | import java.util.List; 13 | 14 | import javax.xml.bind.annotation.XmlAccessType; 15 | import javax.xml.bind.annotation.XmlAccessorType; 16 | import javax.xml.bind.annotation.XmlType; 17 | 18 | 19 | /** 20 | *

Java class for Mocks complex type. 21 | * 22 | *

The following schema fragment specifies the expected content contained within this class. 23 | * 24 | *

25 |  * <complexType name="Mocks">
26 |  *   <complexContent>
27 |  *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
28 |  *       <sequence>
29 |  *         <element name="method" type="{http://www.junit-tools.org/tml/tml.xsd}Method" maxOccurs="unbounded" minOccurs="0"/>
30 |  *       </sequence>
31 |  *     </restriction>
32 |  *   </complexContent>
33 |  * </complexType>
34 |  * 
35 | * 36 | * 37 | */ 38 | @XmlAccessorType(XmlAccessType.FIELD) 39 | @XmlType(name = "Mocks", propOrder = { 40 | "method" 41 | }) 42 | public class Mocks { 43 | 44 | protected List method; 45 | 46 | /** 47 | * Gets the value of the method property. 48 | * 49 | *

50 | * This accessor method returns a reference to the live list, 51 | * not a snapshot. Therefore any modification you make to the 52 | * returned list will be present inside the JAXB object. 53 | * This is why there is not a set method for the method property. 54 | * 55 | *

56 | * For example, to add a new item, do as follows: 57 | *

58 |      *    getMethod().add(newItem);
59 |      * 
60 | * 61 | * 62 | *

63 | * Objects of the following type(s) are allowed in the list 64 | * {@link Method } 65 | * 66 | * 67 | */ 68 | public List getMethod() { 69 | if (method == null) { 70 | method = new ArrayList(); 71 | } 72 | return this.method; 73 | } 74 | 75 | } 76 | -------------------------------------------------------------------------------- /org.junit.tools/src/org/junit/tools/generator/model/tml/TestBases.java: -------------------------------------------------------------------------------- 1 | // 2 | // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 3 | // See http://java.sun.com/xml/jaxb 4 | // Any modifications to this file will be lost upon recompilation of the source schema. 5 | // Generated on: 2015.11.22 at 02:08:56 AM CET 6 | // 7 | 8 | 9 | package org.junit.tools.generator.model.tml; 10 | 11 | import java.util.ArrayList; 12 | import java.util.List; 13 | 14 | import javax.xml.bind.annotation.XmlAccessType; 15 | import javax.xml.bind.annotation.XmlAccessorType; 16 | import javax.xml.bind.annotation.XmlType; 17 | 18 | 19 | /** 20 | *

Java class for TestBases complex type. 21 | * 22 | *

The following schema fragment specifies the expected content contained within this class. 23 | * 24 | *

25 |  * <complexType name="TestBases">
26 |  *   <complexContent>
27 |  *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
28 |  *       <sequence maxOccurs="unbounded" minOccurs="0">
29 |  *         <element name="constructor" type="{http://www.junit-tools.org/tml/tml.xsd}Constructor" maxOccurs="unbounded" minOccurs="0"/>
30 |  *       </sequence>
31 |  *     </restriction>
32 |  *   </complexContent>
33 |  * </complexType>
34 |  * 
35 | * 36 | * 37 | */ 38 | @XmlAccessorType(XmlAccessType.FIELD) 39 | @XmlType(name = "TestBases", propOrder = { 40 | "constructor" 41 | }) 42 | public class TestBases { 43 | 44 | protected List constructor; 45 | 46 | /** 47 | * Gets the value of the constructor property. 48 | * 49 | *

50 | * This accessor method returns a reference to the live list, 51 | * not a snapshot. Therefore any modification you make to the 52 | * returned list will be present inside the JAXB object. 53 | * This is why there is not a set method for the constructor property. 54 | * 55 | *

56 | * For example, to add a new item, do as follows: 57 | *

58 |      *    getConstructor().add(newItem);
59 |      * 
60 | * 61 | * 62 | *

63 | * Objects of the following type(s) are allowed in the list 64 | * {@link Constructor } 65 | * 66 | * 67 | */ 68 | public List getConstructor() { 69 | if (constructor == null) { 70 | constructor = new ArrayList(); 71 | } 72 | return this.constructor; 73 | } 74 | 75 | } 76 | -------------------------------------------------------------------------------- /org.junit.tools/src/org/junit/tools/generator/model/GeneratorModel.java: -------------------------------------------------------------------------------- 1 | package org.junit.tools.generator.model; 2 | 3 | import java.util.HashMap; 4 | import java.util.List; 5 | 6 | import org.eclipse.jdt.core.IMethod; 7 | import org.junit.tools.base.MethodRef; 8 | import org.junit.tools.generator.model.tml.Method; 9 | import org.junit.tools.generator.model.tml.Test; 10 | 11 | /** 12 | * Generator-model with the JUnit-Tools-Elements and the TML-file. 13 | * 14 | * @author Robert Streng 15 | * 16 | */ 17 | public class GeneratorModel { 18 | 19 | private JUTElements jutElements; 20 | private Test tmlTest; 21 | 22 | private HashMap methodMap = new HashMap(); 23 | private List methodsToCreate; 24 | private List methodsToDelete; 25 | private HashMap existingMethods; 26 | 27 | /** 28 | * @param jutElements 29 | * @param tmlTest 30 | */ 31 | public GeneratorModel(JUTElements jutElements, Test tmlTest) { 32 | this.jutElements = jutElements; 33 | this.tmlTest = tmlTest; 34 | } 35 | 36 | /** 37 | * @return JUT-elements 38 | */ 39 | public JUTElements getJUTElements() { 40 | return jutElements; 41 | } 42 | 43 | /** 44 | * @param jutElements 45 | */ 46 | public void setJUTElements(JUTElements jutElements) { 47 | this.jutElements = jutElements; 48 | } 49 | 50 | /** 51 | * @return TML-Test 52 | */ 53 | public Test getTmlTest() { 54 | return tmlTest; 55 | } 56 | 57 | /** 58 | * @param tmlTest 59 | */ 60 | public void setTmlTest(Test tmlTest) { 61 | this.tmlTest = tmlTest; 62 | } 63 | 64 | /** 65 | * @return the method map 66 | */ 67 | public HashMap getMethodMap() { 68 | return methodMap; 69 | } 70 | 71 | /** 72 | * @param methodMap 73 | */ 74 | public void setMethodMap(HashMap methodMap) { 75 | this.methodMap = methodMap; 76 | } 77 | 78 | public void setMethodsToCreate(List methodsToCreate) { 79 | this.methodsToCreate = methodsToCreate; 80 | } 81 | 82 | public void setMethodsToDelete(List methodsToDelete) { 83 | this.methodsToDelete = methodsToDelete; 84 | } 85 | 86 | public List getMethodsToCreate() { 87 | return methodsToCreate; 88 | } 89 | 90 | public List getMethodsToDelete() { 91 | return methodsToDelete; 92 | } 93 | 94 | public void setExistingMethods(HashMap existingMethods) { 95 | this.existingMethods = existingMethods; 96 | } 97 | 98 | public HashMap getExistingMethods() { 99 | return existingMethods; 100 | } 101 | } 102 | -------------------------------------------------------------------------------- /org.junit.tools/src/org/junit/tools/handler/GenerateMockClassHandler.java: -------------------------------------------------------------------------------- 1 | package org.junit.tools.handler; 2 | 3 | import java.lang.annotation.Inherited; 4 | 5 | import org.eclipse.core.commands.ExecutionEvent; 6 | import org.eclipse.core.commands.ExecutionException; 7 | import org.eclipse.jdt.core.ICompilationUnit; 8 | import org.eclipse.jface.dialogs.MessageDialog; 9 | import org.eclipse.jface.viewers.ISelection; 10 | import org.eclipse.jface.viewers.IStructuredSelection; 11 | import org.eclipse.ui.IEditorInput; 12 | import org.eclipse.ui.IFileEditorInput; 13 | import org.eclipse.ui.IWorkbenchPartSite; 14 | import org.eclipse.ui.IWorkbenchWindow; 15 | import org.junit.tools.Activator; 16 | import org.junit.tools.base.JUTWarning; 17 | import org.junit.tools.generator.IMockClassGenerator; 18 | import org.junit.tools.messages.Messages; 19 | import org.junit.tools.ui.utils.EclipseUIUtils; 20 | 21 | /** 22 | * Command implementation for the mock-class-generator 23 | * 24 | * @author JUnit-Tools-Team 25 | * 26 | */ 27 | public class GenerateMockClassHandler extends JUTHandler { 28 | 29 | /** 30 | * {@link Inherited} 31 | */ 32 | @Override 33 | public Object execute(ExecutionEvent event) throws ExecutionException { 34 | IWorkbenchWindow activeWorkbenchWindow; 35 | activeWorkbenchWindow = EclipseUIUtils.getActiveWorkbenchWindow(); 36 | 37 | try { 38 | 39 | ISelection selection = activeWorkbenchWindow.getSelectionService() 40 | .getSelection(); 41 | 42 | ICompilationUnit result = null; 43 | IMockClassGenerator mockClassGenerator = Activator.getDefault() 44 | .getExtensionHandler().getMockClassGenerator(); 45 | 46 | if (selection instanceof IStructuredSelection) { 47 | result = mockClassGenerator.generate(activeWorkbenchWindow, 48 | (IStructuredSelection) selection); 49 | } else { 50 | IEditorInput editorInput = EclipseUIUtils.getEditorInput(); 51 | 52 | if (editorInput instanceof IFileEditorInput) { 53 | result = mockClassGenerator.generate(activeWorkbenchWindow, 54 | (IFileEditorInput) editorInput); 55 | } 56 | } 57 | 58 | if (result != null) { 59 | // make source beautiful 60 | IWorkbenchPartSite site = activeWorkbenchWindow.getActivePage() 61 | .getActivePart().getSite(); 62 | EclipseUIUtils.organizeImports(site, result); 63 | EclipseUIUtils.format(site, result); 64 | 65 | String information = Messages.General_information; 66 | MessageDialog.openInformation(activeWorkbenchWindow.getShell(), 67 | information, 68 | Messages.General_info_generation_successful); 69 | } 70 | } catch (JUTWarning e) { 71 | handleWarning(e); 72 | } catch (Exception e) { 73 | handleError(e); 74 | return null; 75 | } 76 | 77 | return null; 78 | } 79 | 80 | } 81 | -------------------------------------------------------------------------------- /org.junit.tools/src/org/junit/tools/reports/model/ObjectFactory.java: -------------------------------------------------------------------------------- 1 | // 2 | // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 3 | // See http://java.sun.com/xml/jaxb 4 | // Any modifications to this file will be lost upon recompilation of the source schema. 5 | // Generated on: 2015.11.23 at 09:36:22 AM CET 6 | // 7 | 8 | 9 | package org.junit.tools.reports.model; 10 | 11 | import javax.xml.bind.annotation.XmlRegistry; 12 | 13 | 14 | /** 15 | * This object contains factory methods for each 16 | * Java content interface and Java element interface 17 | * generated in the org.junit.tools.reports.model package. 18 | *

An ObjectFactory allows you to programatically 19 | * construct new instances of the Java representation 20 | * for XML content. The Java representation of XML 21 | * content can consist of schema derived interfaces 22 | * and classes representing the binding of schema 23 | * type definitions, element declarations and model 24 | * groups. Factory methods for each of these are 25 | * provided in this class. 26 | * 27 | */ 28 | @XmlRegistry 29 | public class ObjectFactory { 30 | 31 | 32 | /** 33 | * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: org.junit.tools.reports.model 34 | * 35 | */ 36 | public ObjectFactory() { 37 | } 38 | 39 | /** 40 | * Create an instance of {@link RepProject } 41 | * 42 | */ 43 | public RepProject createRepProject() { 44 | return new RepProject(); 45 | } 46 | 47 | /** 48 | * Create an instance of {@link Statistics } 49 | * 50 | */ 51 | public Statistics createStatistics() { 52 | return new Statistics(); 53 | } 54 | 55 | /** 56 | * Create an instance of {@link NewMethods } 57 | * 58 | */ 59 | public NewMethods createNewMethods() { 60 | return new NewMethods(); 61 | } 62 | 63 | /** 64 | * Create an instance of {@link RepPackage } 65 | * 66 | */ 67 | public RepPackage createRepPackage() { 68 | return new RepPackage(); 69 | } 70 | 71 | /** 72 | * Create an instance of {@link RepMethod } 73 | * 74 | */ 75 | public RepMethod createRepMethod() { 76 | return new RepMethod(); 77 | } 78 | 79 | /** 80 | * Create an instance of {@link RepClass } 81 | * 82 | */ 83 | public RepClass createRepClass() { 84 | return new RepClass(); 85 | } 86 | 87 | /** 88 | * Create an instance of {@link Report } 89 | * 90 | */ 91 | public Report createReport() { 92 | return new Report(); 93 | } 94 | 95 | } 96 | -------------------------------------------------------------------------------- /org.junit.tools/src/org/junit/tools/generator/model/tml/ParamAssignment.java: -------------------------------------------------------------------------------- 1 | // 2 | // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 3 | // See http://java.sun.com/xml/jaxb 4 | // Any modifications to this file will be lost upon recompilation of the source schema. 5 | // Generated on: 2015.11.22 at 02:08:56 AM CET 6 | // 7 | 8 | 9 | package org.junit.tools.generator.model.tml; 10 | 11 | import javax.xml.bind.annotation.XmlAccessType; 12 | import javax.xml.bind.annotation.XmlAccessorType; 13 | import javax.xml.bind.annotation.XmlAttribute; 14 | import javax.xml.bind.annotation.XmlType; 15 | 16 | 17 | /** 18 | *

Java class for ParamAssignment complex type. 19 | * 20 | *

The following schema fragment specifies the expected content contained within this class. 21 | * 22 | *

23 |  * <complexType name="ParamAssignment">
24 |  *   <complexContent>
25 |  *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
26 |  *       <attribute name="paramName" type="{http://www.w3.org/2001/XMLSchema}string" />
27 |  *       <attribute name="assignment" type="{http://www.w3.org/2001/XMLSchema}string" />
28 |  *     </restriction>
29 |  *   </complexContent>
30 |  * </complexType>
31 |  * 
32 | * 33 | * 34 | */ 35 | @XmlAccessorType(XmlAccessType.FIELD) 36 | @XmlType(name = "ParamAssignment") 37 | public class ParamAssignment { 38 | 39 | @XmlAttribute(name = "paramName") 40 | protected String paramName; 41 | @XmlAttribute(name = "assignment") 42 | protected String assignment; 43 | 44 | /** 45 | * Gets the value of the paramName property. 46 | * 47 | * @return 48 | * possible object is 49 | * {@link String } 50 | * 51 | */ 52 | public String getParamName() { 53 | return paramName; 54 | } 55 | 56 | /** 57 | * Sets the value of the paramName property. 58 | * 59 | * @param value 60 | * allowed object is 61 | * {@link String } 62 | * 63 | */ 64 | public void setParamName(String value) { 65 | this.paramName = value; 66 | } 67 | 68 | /** 69 | * Gets the value of the assignment property. 70 | * 71 | * @return 72 | * possible object is 73 | * {@link String } 74 | * 75 | */ 76 | public String getAssignment() { 77 | return assignment; 78 | } 79 | 80 | /** 81 | * Sets the value of the assignment property. 82 | * 83 | * @param value 84 | * allowed object is 85 | * {@link String } 86 | * 87 | */ 88 | public void setAssignment(String value) { 89 | this.assignment = value; 90 | } 91 | 92 | } 93 | -------------------------------------------------------------------------------- /org.junit.tools/res/trml.xsd: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 10 | 11 | 12 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | -------------------------------------------------------------------------------- /org.junit.tools/src/org/junit/tools/ui/generator/wizards/GeneratorWizard.java: -------------------------------------------------------------------------------- 1 | package org.junit.tools.ui.generator.wizards; 2 | 3 | import org.eclipse.jface.viewers.IStructuredSelection; 4 | import org.eclipse.jface.wizard.Wizard; 5 | import org.eclipse.swt.widgets.Composite; 6 | import org.eclipse.ui.INewWizard; 7 | import org.eclipse.ui.IWorkbench; 8 | import org.junit.tools.generator.model.GeneratorModel; 9 | import org.junit.tools.messages.Messages; 10 | import org.junit.tools.ui.generator.wizards.pages.GeneratorWizardMainPage; 11 | 12 | /** 13 | * Main-class for the generator wizard. 14 | * 15 | * @author JUnit-Tools-Team 16 | * 17 | */ 18 | public class GeneratorWizard extends Wizard implements INewWizard { 19 | 20 | private GeneratorWizardMainPage mainPage; 21 | 22 | private boolean finished = false; 23 | 24 | private final GeneratorModel utmModel; 25 | 26 | private boolean initialized = false; 27 | 28 | public GeneratorWizard(GeneratorModel model) { 29 | this.utmModel = model; 30 | } 31 | 32 | /** 33 | * Adding the page to the wizard. 34 | */ 35 | 36 | @Override 37 | public void addPages() { 38 | String title = Messages.GeneratorWizard_Unit_test_class_generator; 39 | 40 | mainPage = createMainPage(title); 41 | addPage(mainPage); 42 | } 43 | 44 | @Override 45 | public void createPageControls(Composite pageContainer) { 46 | super.createPageControls(pageContainer); 47 | } 48 | 49 | /** 50 | * Initializes the pages. 51 | */ 52 | public void initPages() { 53 | 54 | if (initialized) { 55 | return; 56 | } else { 57 | initialized = true; 58 | } 59 | 60 | getMainPage().init(); 61 | } 62 | 63 | /** 64 | * Creates the main page. 65 | * 66 | * @param title 67 | * @return the main page 68 | */ 69 | private GeneratorWizardMainPage createMainPage(String title) { 70 | String description = Messages.GeneratorWizard_description_main; 71 | GeneratorWizardMainPage page = new GeneratorWizardMainPage(title, 72 | description, Messages.GeneratorWizard_mainPage, utmModel); 73 | 74 | return page; 75 | } 76 | 77 | /** 78 | * Returns if the pages are initialized. 79 | * 80 | * @return true if pages are initialized 81 | */ 82 | protected boolean isPagesInitialized() { 83 | return this.initialized; 84 | } 85 | 86 | /** 87 | * This method is called when 'Finish' button is pressed in the wizard. 88 | */ 89 | @Override 90 | public boolean performFinish() { 91 | getMainPage().update(); 92 | 93 | finished = true; 94 | return true; 95 | } 96 | 97 | /** 98 | * Returns if the processing is finished. 99 | * 100 | * @return true if the processing is finished. 101 | */ 102 | public boolean isFinished() { 103 | return finished; 104 | } 105 | 106 | @Override 107 | public void init(IWorkbench workbench, IStructuredSelection selection) { 108 | // nothing 109 | } 110 | 111 | /** 112 | * @return main page 113 | */ 114 | private GeneratorWizardMainPage getMainPage() { 115 | return mainPage; 116 | } 117 | 118 | @Override 119 | public boolean needsProgressMonitor() { 120 | return true; 121 | } 122 | 123 | } -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Contributor Covenant Code of Conduct 2 | 3 | ## Our Pledge 4 | 5 | In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation. 6 | 7 | ## Our Standards 8 | 9 | Examples of behavior that contributes to creating a positive environment include: 10 | 11 | * Using welcoming and inclusive language 12 | * Being respectful of differing viewpoints and experiences 13 | * Gracefully accepting constructive criticism 14 | * Focusing on what is best for the community 15 | * Showing empathy towards other community members 16 | 17 | Examples of unacceptable behavior by participants include: 18 | 19 | * The use of sexualized language or imagery and unwelcome sexual attention or advances 20 | * Trolling, insulting/derogatory comments, and personal or political attacks 21 | * Public or private harassment 22 | * Publishing others' private information, such as a physical or electronic address, without explicit permission 23 | * Other conduct which could reasonably be considered inappropriate in a professional setting 24 | 25 | ## Our Responsibilities 26 | 27 | Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior. 28 | 29 | Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful. 30 | 31 | ## Scope 32 | 33 | This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers. 34 | 35 | ## Enforcement 36 | 37 | Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at info@junit-tools.org. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately. 38 | 39 | Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership. 40 | 41 | ## Attribution 42 | 43 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version] 44 | 45 | [homepage]: http://contributor-covenant.org 46 | [version]: http://contributor-covenant.org/version/1/4/ 47 | -------------------------------------------------------------------------------- /org.junit.tools/src/org/junit/tools/reports/model/RepClass.java: -------------------------------------------------------------------------------- 1 | // 2 | // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 3 | // See http://java.sun.com/xml/jaxb 4 | // Any modifications to this file will be lost upon recompilation of the source schema. 5 | // Generated on: 2015.11.23 at 09:36:22 AM CET 6 | // 7 | 8 | 9 | package org.junit.tools.reports.model; 10 | 11 | import java.util.ArrayList; 12 | import java.util.List; 13 | 14 | import javax.xml.bind.annotation.XmlAccessType; 15 | import javax.xml.bind.annotation.XmlAccessorType; 16 | import javax.xml.bind.annotation.XmlAttribute; 17 | import javax.xml.bind.annotation.XmlElement; 18 | import javax.xml.bind.annotation.XmlType; 19 | 20 | 21 | /** 22 | *

Java class for RepClass complex type. 23 | * 24 | *

The following schema fragment specifies the expected content contained within this class. 25 | * 26 | *

 27 |  * <complexType name="RepClass">
 28 |  *   <complexContent>
 29 |  *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
 30 |  *       <sequence>
 31 |  *         <element name="methods" type="{http://www.junit-tools.org/ntrml/ntrml.xsd}RepMethod" maxOccurs="unbounded"/>
 32 |  *       </sequence>
 33 |  *       <attribute name="id" type="{http://www.w3.org/2001/XMLSchema}string" />
 34 |  *     </restriction>
 35 |  *   </complexContent>
 36 |  * </complexType>
 37 |  * 
38 | * 39 | * 40 | */ 41 | @XmlAccessorType(XmlAccessType.FIELD) 42 | @XmlType(name = "RepClass", propOrder = { 43 | "methods" 44 | }) 45 | public class RepClass { 46 | 47 | @XmlElement(required = true) 48 | protected List methods; 49 | @XmlAttribute(name = "id") 50 | protected String id; 51 | 52 | /** 53 | * Gets the value of the methods property. 54 | * 55 | *

56 | * This accessor method returns a reference to the live list, 57 | * not a snapshot. Therefore any modification you make to the 58 | * returned list will be present inside the JAXB object. 59 | * This is why there is not a set method for the methods property. 60 | * 61 | *

62 | * For example, to add a new item, do as follows: 63 | *

 64 |      *    getMethods().add(newItem);
 65 |      * 
66 | * 67 | * 68 | *

69 | * Objects of the following type(s) are allowed in the list 70 | * {@link RepMethod } 71 | * 72 | * 73 | */ 74 | public List getMethods() { 75 | if (methods == null) { 76 | methods = new ArrayList(); 77 | } 78 | return this.methods; 79 | } 80 | 81 | /** 82 | * Gets the value of the id property. 83 | * 84 | * @return 85 | * possible object is 86 | * {@link String } 87 | * 88 | */ 89 | public String getId() { 90 | return id; 91 | } 92 | 93 | /** 94 | * Sets the value of the id property. 95 | * 96 | * @param value 97 | * allowed object is 98 | * {@link String } 99 | * 100 | */ 101 | public void setId(String value) { 102 | this.id = value; 103 | } 104 | 105 | } 106 | -------------------------------------------------------------------------------- /org.junit.tools/src/org/junit/tools/reports/model/RepPackage.java: -------------------------------------------------------------------------------- 1 | // 2 | // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 3 | // See http://java.sun.com/xml/jaxb 4 | // Any modifications to this file will be lost upon recompilation of the source schema. 5 | // Generated on: 2015.11.23 at 09:36:22 AM CET 6 | // 7 | 8 | 9 | package org.junit.tools.reports.model; 10 | 11 | import java.util.ArrayList; 12 | import java.util.List; 13 | 14 | import javax.xml.bind.annotation.XmlAccessType; 15 | import javax.xml.bind.annotation.XmlAccessorType; 16 | import javax.xml.bind.annotation.XmlAttribute; 17 | import javax.xml.bind.annotation.XmlElement; 18 | import javax.xml.bind.annotation.XmlType; 19 | 20 | 21 | /** 22 | *

Java class for RepPackage complex type. 23 | * 24 | *

The following schema fragment specifies the expected content contained within this class. 25 | * 26 | *

 27 |  * <complexType name="RepPackage">
 28 |  *   <complexContent>
 29 |  *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
 30 |  *       <sequence>
 31 |  *         <element name="classes" type="{http://www.junit-tools.org/ntrml/ntrml.xsd}RepClass" maxOccurs="unbounded"/>
 32 |  *       </sequence>
 33 |  *       <attribute name="id" type="{http://www.w3.org/2001/XMLSchema}string" />
 34 |  *     </restriction>
 35 |  *   </complexContent>
 36 |  * </complexType>
 37 |  * 
38 | * 39 | * 40 | */ 41 | @XmlAccessorType(XmlAccessType.FIELD) 42 | @XmlType(name = "RepPackage", propOrder = { 43 | "classes" 44 | }) 45 | public class RepPackage { 46 | 47 | @XmlElement(required = true) 48 | protected List classes; 49 | @XmlAttribute(name = "id") 50 | protected String id; 51 | 52 | /** 53 | * Gets the value of the classes property. 54 | * 55 | *

56 | * This accessor method returns a reference to the live list, 57 | * not a snapshot. Therefore any modification you make to the 58 | * returned list will be present inside the JAXB object. 59 | * This is why there is not a set method for the classes property. 60 | * 61 | *

62 | * For example, to add a new item, do as follows: 63 | *

 64 |      *    getClasses().add(newItem);
 65 |      * 
66 | * 67 | * 68 | *

69 | * Objects of the following type(s) are allowed in the list 70 | * {@link RepClass } 71 | * 72 | * 73 | */ 74 | public List getClasses() { 75 | if (classes == null) { 76 | classes = new ArrayList(); 77 | } 78 | return this.classes; 79 | } 80 | 81 | /** 82 | * Gets the value of the id property. 83 | * 84 | * @return 85 | * possible object is 86 | * {@link String } 87 | * 88 | */ 89 | public String getId() { 90 | return id; 91 | } 92 | 93 | /** 94 | * Sets the value of the id property. 95 | * 96 | * @param value 97 | * allowed object is 98 | * {@link String } 99 | * 100 | */ 101 | public void setId(String value) { 102 | this.id = value; 103 | } 104 | 105 | } 106 | -------------------------------------------------------------------------------- /org.junit.tools/schema/org.junit.tools.preferences.exsd: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | With this extension-point you can define customized default preferences. 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | [Enter the first release in which this extension point appears.] 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | [Enter extension point usage example here.] 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | [Enter API information here.] 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | [Enter information about supplied implementation of this extension point.] 98 | 99 | 100 | 101 | 102 | 103 | -------------------------------------------------------------------------------- /org.junit.tools/src/org/junit/tools/reports/model/NewMethods.java: -------------------------------------------------------------------------------- 1 | // 2 | // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 3 | // See http://java.sun.com/xml/jaxb 4 | // Any modifications to this file will be lost upon recompilation of the source schema. 5 | // Generated on: 2015.11.23 at 09:36:22 AM CET 6 | // 7 | 8 | 9 | package org.junit.tools.reports.model; 10 | 11 | import java.util.ArrayList; 12 | import java.util.List; 13 | 14 | import javax.xml.bind.annotation.XmlAccessType; 15 | import javax.xml.bind.annotation.XmlAccessorType; 16 | import javax.xml.bind.annotation.XmlAttribute; 17 | import javax.xml.bind.annotation.XmlType; 18 | 19 | 20 | /** 21 | *

Java class for NewMethods complex type. 22 | * 23 | *

The following schema fragment specifies the expected content contained within this class. 24 | * 25 | *

 26 |  * <complexType name="NewMethods">
 27 |  *   <complexContent>
 28 |  *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
 29 |  *       <sequence>
 30 |  *         <element name="fullQualifiedName" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded" minOccurs="0"/>
 31 |  *       </sequence>
 32 |  *       <attribute name="testprio" type="{http://www.w3.org/2001/XMLSchema}string" />
 33 |  *     </restriction>
 34 |  *   </complexContent>
 35 |  * </complexType>
 36 |  * 
37 | * 38 | * 39 | */ 40 | @XmlAccessorType(XmlAccessType.FIELD) 41 | @XmlType(name = "NewMethods", propOrder = { 42 | "fullQualifiedName" 43 | }) 44 | public class NewMethods { 45 | 46 | protected List fullQualifiedName; 47 | @XmlAttribute(name = "testprio") 48 | protected String testprio; 49 | 50 | /** 51 | * Gets the value of the fullQualifiedName property. 52 | * 53 | *

54 | * This accessor method returns a reference to the live list, 55 | * not a snapshot. Therefore any modification you make to the 56 | * returned list will be present inside the JAXB object. 57 | * This is why there is not a set method for the fullQualifiedName property. 58 | * 59 | *

60 | * For example, to add a new item, do as follows: 61 | *

 62 |      *    getFullQualifiedName().add(newItem);
 63 |      * 
64 | * 65 | * 66 | *

67 | * Objects of the following type(s) are allowed in the list 68 | * {@link String } 69 | * 70 | * 71 | */ 72 | public List getFullQualifiedName() { 73 | if (fullQualifiedName == null) { 74 | fullQualifiedName = new ArrayList(); 75 | } 76 | return this.fullQualifiedName; 77 | } 78 | 79 | /** 80 | * Gets the value of the testprio property. 81 | * 82 | * @return 83 | * possible object is 84 | * {@link String } 85 | * 86 | */ 87 | public String getTestprio() { 88 | return testprio; 89 | } 90 | 91 | /** 92 | * Sets the value of the testprio property. 93 | * 94 | * @param value 95 | * allowed object is 96 | * {@link String } 97 | * 98 | */ 99 | public void setTestprio(String value) { 100 | this.testprio = value; 101 | } 102 | 103 | } 104 | -------------------------------------------------------------------------------- /org.junit.tools/src/org/junit/tools/generator/model/tml/Precondition.java: -------------------------------------------------------------------------------- 1 | // 2 | // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 3 | // See http://java.sun.com/xml/jaxb 4 | // Any modifications to this file will be lost upon recompilation of the source schema. 5 | // Generated on: 2015.11.22 at 02:08:56 AM CET 6 | // 7 | 8 | 9 | package org.junit.tools.generator.model.tml; 10 | 11 | import java.util.ArrayList; 12 | import java.util.List; 13 | 14 | import javax.xml.bind.annotation.XmlAccessType; 15 | import javax.xml.bind.annotation.XmlAccessorType; 16 | import javax.xml.bind.annotation.XmlAttribute; 17 | import javax.xml.bind.annotation.XmlElement; 18 | import javax.xml.bind.annotation.XmlType; 19 | 20 | 21 | /** 22 | *

Java class for Precondition complex type. 23 | * 24 | *

The following schema fragment specifies the expected content contained within this class. 25 | * 26 | *

 27 |  * <complexType name="Precondition">
 28 |  *   <complexContent>
 29 |  *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
 30 |  *       <sequence>
 31 |  *         <element name="condition" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded"/>
 32 |  *       </sequence>
 33 |  *       <attribute name="comment" type="{http://www.w3.org/2001/XMLSchema}string" />
 34 |  *     </restriction>
 35 |  *   </complexContent>
 36 |  * </complexType>
 37 |  * 
38 | * 39 | * 40 | */ 41 | @XmlAccessorType(XmlAccessType.FIELD) 42 | @XmlType(name = "Precondition", propOrder = { 43 | "condition" 44 | }) 45 | public class Precondition { 46 | 47 | @XmlElement(required = true) 48 | protected List condition; 49 | @XmlAttribute(name = "comment") 50 | protected String comment; 51 | 52 | /** 53 | * Gets the value of the condition property. 54 | * 55 | *

56 | * This accessor method returns a reference to the live list, 57 | * not a snapshot. Therefore any modification you make to the 58 | * returned list will be present inside the JAXB object. 59 | * This is why there is not a set method for the condition property. 60 | * 61 | *

62 | * For example, to add a new item, do as follows: 63 | *

 64 |      *    getCondition().add(newItem);
 65 |      * 
66 | * 67 | * 68 | *

69 | * Objects of the following type(s) are allowed in the list 70 | * {@link String } 71 | * 72 | * 73 | */ 74 | public List getCondition() { 75 | if (condition == null) { 76 | condition = new ArrayList(); 77 | } 78 | return this.condition; 79 | } 80 | 81 | /** 82 | * Gets the value of the comment property. 83 | * 84 | * @return 85 | * possible object is 86 | * {@link String } 87 | * 88 | */ 89 | public String getComment() { 90 | return comment; 91 | } 92 | 93 | /** 94 | * Sets the value of the comment property. 95 | * 96 | * @param value 97 | * allowed object is 98 | * {@link String } 99 | * 100 | */ 101 | public void setComment(String value) { 102 | this.comment = value; 103 | } 104 | 105 | } 106 | -------------------------------------------------------------------------------- /org.junit.tools/src/org/junit/tools/generator/model/tml/Param.java: -------------------------------------------------------------------------------- 1 | // 2 | // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 3 | // See http://java.sun.com/xml/jaxb 4 | // Any modifications to this file will be lost upon recompilation of the source schema. 5 | // Generated on: 2015.11.22 at 02:08:56 AM CET 6 | // 7 | 8 | 9 | package org.junit.tools.generator.model.tml; 10 | 11 | import javax.xml.bind.annotation.XmlAccessType; 12 | import javax.xml.bind.annotation.XmlAccessorType; 13 | import javax.xml.bind.annotation.XmlAttribute; 14 | import javax.xml.bind.annotation.XmlType; 15 | 16 | 17 | /** 18 | *

Java class for Param complex type. 19 | * 20 | *

The following schema fragment specifies the expected content contained within this class. 21 | * 22 | *

 23 |  * <complexType name="Param">
 24 |  *   <complexContent>
 25 |  *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
 26 |  *       <attribute name="name" type="{http://www.w3.org/2001/XMLSchema}string" />
 27 |  *       <attribute name="type" type="{http://www.w3.org/2001/XMLSchema}string" />
 28 |  *       <attribute name="primitive" type="{http://www.w3.org/2001/XMLSchema}boolean" />
 29 |  *     </restriction>
 30 |  *   </complexContent>
 31 |  * </complexType>
 32 |  * 
33 | * 34 | * 35 | */ 36 | @XmlAccessorType(XmlAccessType.FIELD) 37 | @XmlType(name = "Param") 38 | public class Param { 39 | 40 | @XmlAttribute(name = "name") 41 | protected String name; 42 | @XmlAttribute(name = "type") 43 | protected String type; 44 | @XmlAttribute(name = "primitive") 45 | protected Boolean primitive; 46 | 47 | /** 48 | * Gets the value of the name property. 49 | * 50 | * @return 51 | * possible object is 52 | * {@link String } 53 | * 54 | */ 55 | public String getName() { 56 | return name; 57 | } 58 | 59 | /** 60 | * Sets the value of the name property. 61 | * 62 | * @param value 63 | * allowed object is 64 | * {@link String } 65 | * 66 | */ 67 | public void setName(String value) { 68 | this.name = value; 69 | } 70 | 71 | /** 72 | * Gets the value of the type property. 73 | * 74 | * @return 75 | * possible object is 76 | * {@link String } 77 | * 78 | */ 79 | public String getType() { 80 | return type; 81 | } 82 | 83 | /** 84 | * Sets the value of the type property. 85 | * 86 | * @param value 87 | * allowed object is 88 | * {@link String } 89 | * 90 | */ 91 | public void setType(String value) { 92 | this.type = value; 93 | } 94 | 95 | /** 96 | * Gets the value of the primitive property. 97 | * 98 | * @return 99 | * possible object is 100 | * {@link Boolean } 101 | * 102 | */ 103 | public Boolean isPrimitive() { 104 | return primitive; 105 | } 106 | 107 | /** 108 | * Sets the value of the primitive property. 109 | * 110 | * @param value 111 | * allowed object is 112 | * {@link Boolean } 113 | * 114 | */ 115 | public void setPrimitive(Boolean value) { 116 | this.primitive = value; 117 | } 118 | 119 | } 120 | -------------------------------------------------------------------------------- /org.junit.tools/src/org/junit/tools/refactoring/MoveTestElements.java: -------------------------------------------------------------------------------- 1 | package org.junit.tools.refactoring; 2 | 3 | import org.eclipse.core.runtime.CoreException; 4 | import org.eclipse.core.runtime.IProgressMonitor; 5 | import org.eclipse.core.runtime.OperationCanceledException; 6 | import org.eclipse.jdt.core.ICompilationUnit; 7 | import org.eclipse.jdt.core.IJavaProject; 8 | import org.eclipse.jdt.core.IPackageFragment; 9 | import org.eclipse.ltk.core.refactoring.Change; 10 | import org.eclipse.ltk.core.refactoring.RefactoringStatus; 11 | import org.eclipse.ltk.core.refactoring.participants.CheckConditionsContext; 12 | import org.eclipse.ltk.core.refactoring.participants.MoveParticipant; 13 | import org.junit.tools.generator.model.JUTElements; 14 | import org.junit.tools.generator.model.JUTElements.JUTClassesAndPackages; 15 | import org.junit.tools.generator.utils.JDTUtils; 16 | import org.junit.tools.preferences.JUTPreferences; 17 | 18 | public class MoveTestElements extends MoveParticipant { 19 | 20 | private ICompilationUnit movedCu; 21 | 22 | @Override 23 | protected boolean initialize(Object element) { 24 | if (element instanceof ICompilationUnit) { 25 | movedCu = (ICompilationUnit) element; 26 | } 27 | 28 | return true; 29 | } 30 | 31 | @Override 32 | public String getName() { 33 | return "move test-elements"; 34 | } 35 | 36 | @Override 37 | public RefactoringStatus checkConditions(IProgressMonitor pm, 38 | CheckConditionsContext context) throws OperationCanceledException { 39 | return new RefactoringStatus(); 40 | } 41 | 42 | @Override 43 | public Change createChange(IProgressMonitor pm) throws CoreException, 44 | OperationCanceledException { 45 | return new Change() { 46 | 47 | @Override 48 | public Change perform(IProgressMonitor pm2) throws CoreException { 49 | 50 | try { 51 | if (movedCu == null) { 52 | return null; 53 | } 54 | 55 | JUTElements utmElements = JUTElements.initJUTElements( 56 | movedCu.getJavaProject(), movedCu); 57 | 58 | IPackageFragment newPackage = (IPackageFragment) getArguments() 59 | .getDestination(); 60 | 61 | JUTClassesAndPackages classesAndPackages = utmElements 62 | .getClassesAndPackages(); 63 | 64 | ICompilationUnit testCu = classesAndPackages.getTestClass(); 65 | 66 | if (testCu.exists()) { 67 | IJavaProject testProject = utmElements.getProjects() 68 | .getTestProject(); 69 | 70 | IPackageFragment newTestPackage = JDTUtils.getPackage( 71 | testProject, 72 | classesAndPackages.getTestFolder(), 73 | newPackage.getElementName(), true); 74 | 75 | testCu.move(newTestPackage, null, null, true, pm2); 76 | 77 | // TODO organize imports, test-suites actualize, 78 | // probably delete package 79 | } 80 | 81 | } catch (Exception e) { 82 | // TODO error-handling 83 | } 84 | 85 | return null; 86 | } 87 | 88 | @Override 89 | public RefactoringStatus isValid(IProgressMonitor pm2) 90 | throws CoreException, OperationCanceledException { 91 | return new RefactoringStatus(); 92 | } 93 | 94 | @Override 95 | public void initializeValidationData(IProgressMonitor pm2) { 96 | // nothing 97 | } 98 | 99 | @Override 100 | public String getName() { 101 | return "move test-elements change"; 102 | } 103 | 104 | @Override 105 | public Object getModifiedElement() { 106 | return null; 107 | } 108 | }; 109 | } 110 | 111 | } 112 | -------------------------------------------------------------------------------- /org.junit.tools/src/org/junit/tools/generator/model/tml/Result.java: -------------------------------------------------------------------------------- 1 | // 2 | // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 3 | // See http://java.sun.com/xml/jaxb 4 | // Any modifications to this file will be lost upon recompilation of the source schema. 5 | // Generated on: 2015.11.22 at 02:08:56 AM CET 6 | // 7 | 8 | 9 | package org.junit.tools.generator.model.tml; 10 | 11 | import javax.xml.bind.annotation.XmlAccessType; 12 | import javax.xml.bind.annotation.XmlAccessorType; 13 | import javax.xml.bind.annotation.XmlAttribute; 14 | import javax.xml.bind.annotation.XmlElement; 15 | import javax.xml.bind.annotation.XmlType; 16 | 17 | 18 | /** 19 | *

Java class for Result complex type. 20 | * 21 | *

The following schema fragment specifies the expected content contained within this class. 22 | * 23 | *

 24 |  * <complexType name="Result">
 25 |  *   <complexContent>
 26 |  *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
 27 |  *       <sequence>
 28 |  *         <element name="value" type="{http://www.w3.org/2001/XMLSchema}string"/>
 29 |  *       </sequence>
 30 |  *       <attribute name="name" type="{http://www.w3.org/2001/XMLSchema}string" />
 31 |  *       <attribute name="type" type="{http://www.w3.org/2001/XMLSchema}string" />
 32 |  *     </restriction>
 33 |  *   </complexContent>
 34 |  * </complexType>
 35 |  * 
36 | * 37 | * 38 | */ 39 | @XmlAccessorType(XmlAccessType.FIELD) 40 | @XmlType(name = "Result", propOrder = { 41 | "value" 42 | }) 43 | public class Result { 44 | 45 | @XmlElement(required = true) 46 | protected String value; 47 | @XmlAttribute(name = "name") 48 | protected String name; 49 | @XmlAttribute(name = "type") 50 | protected String type; 51 | 52 | /** 53 | * Gets the value of the value property. 54 | * 55 | * @return 56 | * possible object is 57 | * {@link String } 58 | * 59 | */ 60 | public String getValue() { 61 | return value; 62 | } 63 | 64 | /** 65 | * Sets the value of the value property. 66 | * 67 | * @param value 68 | * allowed object is 69 | * {@link String } 70 | * 71 | */ 72 | public void setValue(String value) { 73 | this.value = value; 74 | } 75 | 76 | /** 77 | * Gets the value of the name property. 78 | * 79 | * @return 80 | * possible object is 81 | * {@link String } 82 | * 83 | */ 84 | public String getName() { 85 | return name; 86 | } 87 | 88 | /** 89 | * Sets the value of the name property. 90 | * 91 | * @param value 92 | * allowed object is 93 | * {@link String } 94 | * 95 | */ 96 | public void setName(String value) { 97 | this.name = value; 98 | } 99 | 100 | /** 101 | * Gets the value of the type property. 102 | * 103 | * @return 104 | * possible object is 105 | * {@link String } 106 | * 107 | */ 108 | public String getType() { 109 | return type; 110 | } 111 | 112 | /** 113 | * Sets the value of the type property. 114 | * 115 | * @param value 116 | * allowed object is 117 | * {@link String } 118 | * 119 | */ 120 | public void setType(String value) { 121 | this.type = value; 122 | } 123 | 124 | } 125 | -------------------------------------------------------------------------------- /org.junit.tools/src/org/junit/tools/handler/JUTHandler.java: -------------------------------------------------------------------------------- 1 | package org.junit.tools.handler; 2 | 3 | import java.io.PrintWriter; 4 | import java.io.StringWriter; 5 | import java.lang.annotation.Inherited; 6 | import java.util.ArrayList; 7 | import java.util.List; 8 | 9 | import org.eclipse.core.commands.IHandler; 10 | import org.eclipse.core.commands.IHandlerListener; 11 | import org.eclipse.core.runtime.ILog; 12 | import org.eclipse.core.runtime.IStatus; 13 | import org.eclipse.core.runtime.MultiStatus; 14 | import org.eclipse.core.runtime.Status; 15 | import org.eclipse.jface.dialogs.ErrorDialog; 16 | import org.eclipse.jface.dialogs.MessageDialog; 17 | import org.eclipse.swt.widgets.Shell; 18 | import org.junit.tools.Activator; 19 | import org.junit.tools.base.JUTWarning; 20 | import org.junit.tools.messages.Messages; 21 | import org.junit.tools.ui.utils.EclipseUIUtils; 22 | 23 | /** 24 | * General JUT handler 25 | * 26 | * @author JUnit-Tools-Team 27 | * 28 | */ 29 | public abstract class JUTHandler implements IHandler { 30 | 31 | protected static ILog log = Activator.getLogger(); 32 | 33 | protected static String pluginId = Activator.PLUGIN_ID; 34 | 35 | protected String information = Messages.General_information; 36 | protected String warning = Messages.General_warning; 37 | protected String error = Messages.General_error; 38 | protected String errorMsg = Messages.General_error_processing; 39 | 40 | /** 41 | * {@link Inherited} 42 | */ 43 | @Override 44 | public void addHandlerListener(IHandlerListener handlerListener) { 45 | // nothing 46 | } 47 | 48 | /** 49 | * {@link Inherited} 50 | */ 51 | @Override 52 | public void dispose() { 53 | // nothing 54 | } 55 | 56 | /** 57 | * {@link Inherited} 58 | */ 59 | @Override 60 | public boolean isEnabled() { 61 | return true; 62 | } 63 | 64 | /** 65 | * {@link Inherited} 66 | */ 67 | @Override 68 | public boolean isHandled() { 69 | return true; 70 | } 71 | 72 | /** 73 | * {@link Inherited} 74 | */ 75 | @Override 76 | public void removeHandlerListener(IHandlerListener handlerListener) { 77 | // nothing 78 | } 79 | 80 | protected void handleError(Exception e) { 81 | Shell shell = EclipseUIUtils.getShell(); 82 | 83 | // log to error log 84 | Status status = new Status(Status.ERROR, pluginId, e.getMessage(), e); 85 | log.log(status); 86 | 87 | // open error dialog 88 | try { 89 | StringWriter sw = new StringWriter(); 90 | PrintWriter pw = new PrintWriter(sw); 91 | e.printStackTrace(pw); 92 | 93 | // convert stack trace lines to status objects 94 | final String trace = sw.toString(); 95 | List stackStatus = new ArrayList(); 96 | for (String line : trace.split(System.getProperty("line.separator"))) { 97 | stackStatus.add(new Status(IStatus.ERROR, Activator.PLUGIN_ID, line)); 98 | } 99 | 100 | MultiStatus ms = new MultiStatus(Activator.PLUGIN_ID, IStatus.ERROR, stackStatus.toArray(new Status[] {}), 101 | e.getLocalizedMessage(), e); 102 | 103 | // open error dialog 104 | ErrorDialog.openError(shell, error, errorMsg, ms); 105 | } catch (Exception ex2) { 106 | ErrorDialog.openError(shell, error, errorMsg, status); 107 | } 108 | 109 | } 110 | 111 | protected void handleWarning(JUTWarning e) { 112 | Shell shell = EclipseUIUtils.getShell(); 113 | 114 | String warningMsg = e.getMessage(); 115 | 116 | // open error dialog 117 | MessageDialog.openWarning(shell, warning, warningMsg); 118 | } 119 | 120 | } 121 | -------------------------------------------------------------------------------- /org.junit.tools/schema/org.junit.tools.generator.factory.testdata.exsd: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | With a test-data-factory a special creation-code can be added for special types. 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | Element for the test-data-factories 54 | 55 | 56 | 57 | 58 | 59 | 60 | the class which implements a test-data-factory 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | [Enter the first release in which this extension point appears.] 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | [Enter extension point usage example here.] 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | [Enter API information here.] 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | [Enter information about supplied implementation of this extension point.] 103 | 104 | 105 | 106 | 107 | 108 | -------------------------------------------------------------------------------- /org.junit.tools/src/org/junit/tools/generator/model/tml/Constructor.java: -------------------------------------------------------------------------------- 1 | // 2 | // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 3 | // See http://java.sun.com/xml/jaxb 4 | // Any modifications to this file will be lost upon recompilation of the source schema. 5 | // Generated on: 2015.11.22 at 02:08:56 AM CET 6 | // 7 | 8 | 9 | package org.junit.tools.generator.model.tml; 10 | 11 | import java.util.ArrayList; 12 | import java.util.List; 13 | 14 | import javax.xml.bind.annotation.XmlAccessType; 15 | import javax.xml.bind.annotation.XmlAccessorType; 16 | import javax.xml.bind.annotation.XmlElement; 17 | import javax.xml.bind.annotation.XmlType; 18 | 19 | 20 | /** 21 | *

Java class for Constructor complex type. 22 | * 23 | *

The following schema fragment specifies the expected content contained within this class. 24 | * 25 | *

 26 |  * <complexType name="Constructor">
 27 |  *   <complexContent>
 28 |  *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
 29 |  *       <sequence>
 30 |  *         <element name="param" type="{http://www.junit-tools.org/tml/tml.xsd}Param" maxOccurs="unbounded" minOccurs="0"/>
 31 |  *         <element name="testBase" type="{http://www.junit-tools.org/tml/tml.xsd}TestBase" maxOccurs="unbounded"/>
 32 |  *       </sequence>
 33 |  *     </restriction>
 34 |  *   </complexContent>
 35 |  * </complexType>
 36 |  * 
37 | * 38 | * 39 | */ 40 | @XmlAccessorType(XmlAccessType.FIELD) 41 | @XmlType(name = "Constructor", propOrder = { 42 | "param", 43 | "testBase" 44 | }) 45 | public class Constructor { 46 | 47 | protected List param; 48 | @XmlElement(required = true) 49 | protected List testBase; 50 | 51 | /** 52 | * Gets the value of the param property. 53 | * 54 | *

55 | * This accessor method returns a reference to the live list, 56 | * not a snapshot. Therefore any modification you make to the 57 | * returned list will be present inside the JAXB object. 58 | * This is why there is not a set method for the param property. 59 | * 60 | *

61 | * For example, to add a new item, do as follows: 62 | *

 63 |      *    getParam().add(newItem);
 64 |      * 
65 | * 66 | * 67 | *

68 | * Objects of the following type(s) are allowed in the list 69 | * {@link Param } 70 | * 71 | * 72 | */ 73 | public List getParam() { 74 | if (param == null) { 75 | param = new ArrayList(); 76 | } 77 | return this.param; 78 | } 79 | 80 | /** 81 | * Gets the value of the testBase property. 82 | * 83 | *

84 | * This accessor method returns a reference to the live list, 85 | * not a snapshot. Therefore any modification you make to the 86 | * returned list will be present inside the JAXB object. 87 | * This is why there is not a set method for the testBase property. 88 | * 89 | *

90 | * For example, to add a new item, do as follows: 91 | *

 92 |      *    getTestBase().add(newItem);
 93 |      * 
94 | * 95 | * 96 | *

97 | * Objects of the following type(s) are allowed in the list 98 | * {@link TestBase } 99 | * 100 | * 101 | */ 102 | public List getTestBase() { 103 | if (testBase == null) { 104 | testBase = new ArrayList(); 105 | } 106 | return this.testBase; 107 | } 108 | 109 | } 110 | -------------------------------------------------------------------------------- /org.junit.tools/src/org/junit/tools/generator/model/tml/ObjectFactory.java: -------------------------------------------------------------------------------- 1 | // 2 | // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 3 | // See http://java.sun.com/xml/jaxb 4 | // Any modifications to this file will be lost upon recompilation of the source schema. 5 | // Generated on: 2015.11.22 at 02:08:56 AM CET 6 | // 7 | 8 | 9 | package org.junit.tools.generator.model.tml; 10 | 11 | import javax.xml.bind.annotation.XmlRegistry; 12 | 13 | 14 | /** 15 | * This object contains factory methods for each 16 | * Java content interface and Java element interface 17 | * generated in the org.junit.tools.generator.model.tml package. 18 | *

An ObjectFactory allows you to programatically 19 | * construct new instances of the Java representation 20 | * for XML content. The Java representation of XML 21 | * content can consist of schema derived interfaces 22 | * and classes representing the binding of schema 23 | * type definitions, element declarations and model 24 | * groups. Factory methods for each of these are 25 | * provided in this class. 26 | * 27 | */ 28 | @XmlRegistry 29 | public class ObjectFactory { 30 | 31 | 32 | /** 33 | * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: org.junit.tools.generator.model.tml 34 | * 35 | */ 36 | public ObjectFactory() { 37 | } 38 | 39 | /** 40 | * Create an instance of {@link Test } 41 | * 42 | */ 43 | public Test createTest() { 44 | return new Test(); 45 | } 46 | 47 | /** 48 | * Create an instance of {@link Settings } 49 | * 50 | */ 51 | public Settings createSettings() { 52 | return new Settings(); 53 | } 54 | 55 | /** 56 | * Create an instance of {@link TestBases } 57 | * 58 | */ 59 | public TestBases createTestBases() { 60 | return new TestBases(); 61 | } 62 | 63 | /** 64 | * Create an instance of {@link Method } 65 | * 66 | */ 67 | public Method createMethod() { 68 | return new Method(); 69 | } 70 | 71 | /** 72 | * Create an instance of {@link Assertion } 73 | * 74 | */ 75 | public Assertion createAssertion() { 76 | return new Assertion(); 77 | } 78 | 79 | /** 80 | * Create an instance of {@link Result } 81 | * 82 | */ 83 | public Result createResult() { 84 | return new Result(); 85 | } 86 | 87 | /** 88 | * Create an instance of {@link TestBase } 89 | * 90 | */ 91 | public TestBase createTestBase() { 92 | return new TestBase(); 93 | } 94 | 95 | /** 96 | * Create an instance of {@link Param } 97 | * 98 | */ 99 | public Param createParam() { 100 | return new Param(); 101 | } 102 | 103 | /** 104 | * Create an instance of {@link Mocks } 105 | * 106 | */ 107 | public Mocks createMocks() { 108 | return new Mocks(); 109 | } 110 | 111 | /** 112 | * Create an instance of {@link TestCase } 113 | * 114 | */ 115 | public TestCase createTestCase() { 116 | return new TestCase(); 117 | } 118 | 119 | /** 120 | * Create an instance of {@link Precondition } 121 | * 122 | */ 123 | public Precondition createPrecondition() { 124 | return new Precondition(); 125 | } 126 | 127 | /** 128 | * Create an instance of {@link Constructor } 129 | * 130 | */ 131 | public Constructor createConstructor() { 132 | return new Constructor(); 133 | } 134 | 135 | /** 136 | * Create an instance of {@link ParamAssignment } 137 | * 138 | */ 139 | public ParamAssignment createParamAssignment() { 140 | return new ParamAssignment(); 141 | } 142 | 143 | } 144 | -------------------------------------------------------------------------------- /org.junit.tools/src/org/junit/tools/generator/model/tml/TestBase.java: -------------------------------------------------------------------------------- 1 | // 2 | // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 3 | // See http://java.sun.com/xml/jaxb 4 | // Any modifications to this file will be lost upon recompilation of the source schema. 5 | // Generated on: 2015.11.22 at 02:08:56 AM CET 6 | // 7 | 8 | 9 | package org.junit.tools.generator.model.tml; 10 | 11 | import java.util.ArrayList; 12 | import java.util.List; 13 | 14 | import javax.xml.bind.annotation.XmlAccessType; 15 | import javax.xml.bind.annotation.XmlAccessorType; 16 | import javax.xml.bind.annotation.XmlAttribute; 17 | import javax.xml.bind.annotation.XmlType; 18 | 19 | 20 | /** 21 | *

Java class for TestBase complex type. 22 | * 23 | *

The following schema fragment specifies the expected content contained within this class. 24 | * 25 | *

 26 |  * <complexType name="TestBase">
 27 |  *   <complexContent>
 28 |  *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
 29 |  *       <sequence>
 30 |  *         <element name="paramValue" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded" minOccurs="0"/>
 31 |  *         <element name="mocks" type="{http://www.junit-tools.org/tml/tml.xsd}Mocks" minOccurs="0"/>
 32 |  *       </sequence>
 33 |  *       <attribute name="name" type="{http://www.w3.org/2001/XMLSchema}string" />
 34 |  *     </restriction>
 35 |  *   </complexContent>
 36 |  * </complexType>
 37 |  * 
38 | * 39 | * 40 | */ 41 | @XmlAccessorType(XmlAccessType.FIELD) 42 | @XmlType(name = "TestBase", propOrder = { 43 | "paramValue", 44 | "mocks" 45 | }) 46 | public class TestBase { 47 | 48 | protected List paramValue; 49 | protected Mocks mocks; 50 | @XmlAttribute(name = "name") 51 | protected String name; 52 | 53 | /** 54 | * Gets the value of the paramValue property. 55 | * 56 | *

57 | * This accessor method returns a reference to the live list, 58 | * not a snapshot. Therefore any modification you make to the 59 | * returned list will be present inside the JAXB object. 60 | * This is why there is not a set method for the paramValue property. 61 | * 62 | *

63 | * For example, to add a new item, do as follows: 64 | *

 65 |      *    getParamValue().add(newItem);
 66 |      * 
67 | * 68 | * 69 | *

70 | * Objects of the following type(s) are allowed in the list 71 | * {@link String } 72 | * 73 | * 74 | */ 75 | public List getParamValue() { 76 | if (paramValue == null) { 77 | paramValue = new ArrayList(); 78 | } 79 | return this.paramValue; 80 | } 81 | 82 | /** 83 | * Gets the value of the mocks property. 84 | * 85 | * @return 86 | * possible object is 87 | * {@link Mocks } 88 | * 89 | */ 90 | public Mocks getMocks() { 91 | return mocks; 92 | } 93 | 94 | /** 95 | * Sets the value of the mocks property. 96 | * 97 | * @param value 98 | * allowed object is 99 | * {@link Mocks } 100 | * 101 | */ 102 | public void setMocks(Mocks value) { 103 | this.mocks = value; 104 | } 105 | 106 | /** 107 | * Gets the value of the name property. 108 | * 109 | * @return 110 | * possible object is 111 | * {@link String } 112 | * 113 | */ 114 | public String getName() { 115 | return name; 116 | } 117 | 118 | /** 119 | * Sets the value of the name property. 120 | * 121 | * @param value 122 | * allowed object is 123 | * {@link String } 124 | * 125 | */ 126 | public void setName(String value) { 127 | this.name = value; 128 | } 129 | 130 | } 131 | -------------------------------------------------------------------------------- /org.junit.tools/src/org/junit/tools/reports/model/RepMethod.java: -------------------------------------------------------------------------------- 1 | // 2 | // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 3 | // See http://java.sun.com/xml/jaxb 4 | // Any modifications to this file will be lost upon recompilation of the source schema. 5 | // Generated on: 2015.11.23 at 09:36:22 AM CET 6 | // 7 | 8 | 9 | package org.junit.tools.reports.model; 10 | 11 | import javax.xml.bind.annotation.XmlAccessType; 12 | import javax.xml.bind.annotation.XmlAccessorType; 13 | import javax.xml.bind.annotation.XmlAttribute; 14 | import javax.xml.bind.annotation.XmlElement; 15 | import javax.xml.bind.annotation.XmlType; 16 | 17 | 18 | /** 19 | *

Java class for RepMethod complex type. 20 | * 21 | *

The following schema fragment specifies the expected content contained within this class. 22 | * 23 | *

 24 |  * <complexType name="RepMethod">
 25 |  *   <complexContent>
 26 |  *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
 27 |  *       <sequence>
 28 |  *         <element name="report" type="{http://www.junit-tools.org/ntrml/ntrml.xsd}Report"/>
 29 |  *       </sequence>
 30 |  *       <attribute name="id" type="{http://www.w3.org/2001/XMLSchema}string" />
 31 |  *       <attribute name="signature" type="{http://www.w3.org/2001/XMLSchema}string" />
 32 |  *       <attribute name="subtype" type="{http://www.w3.org/2001/XMLSchema}string" />
 33 |  *     </restriction>
 34 |  *   </complexContent>
 35 |  * </complexType>
 36 |  * 
37 | * 38 | * 39 | */ 40 | @XmlAccessorType(XmlAccessType.FIELD) 41 | @XmlType(name = "RepMethod", propOrder = { 42 | "report" 43 | }) 44 | public class RepMethod { 45 | 46 | @XmlElement(required = true) 47 | protected Report report; 48 | @XmlAttribute(name = "id") 49 | protected String id; 50 | @XmlAttribute(name = "signature") 51 | protected String signature; 52 | @XmlAttribute(name = "subtype") 53 | protected String subtype; 54 | 55 | /** 56 | * Gets the value of the report property. 57 | * 58 | * @return 59 | * possible object is 60 | * {@link Report } 61 | * 62 | */ 63 | public Report getReport() { 64 | return report; 65 | } 66 | 67 | /** 68 | * Sets the value of the report property. 69 | * 70 | * @param value 71 | * allowed object is 72 | * {@link Report } 73 | * 74 | */ 75 | public void setReport(Report value) { 76 | this.report = value; 77 | } 78 | 79 | /** 80 | * Gets the value of the id property. 81 | * 82 | * @return 83 | * possible object is 84 | * {@link String } 85 | * 86 | */ 87 | public String getId() { 88 | return id; 89 | } 90 | 91 | /** 92 | * Sets the value of the id property. 93 | * 94 | * @param value 95 | * allowed object is 96 | * {@link String } 97 | * 98 | */ 99 | public void setId(String value) { 100 | this.id = value; 101 | } 102 | 103 | /** 104 | * Gets the value of the signature property. 105 | * 106 | * @return 107 | * possible object is 108 | * {@link String } 109 | * 110 | */ 111 | public String getSignature() { 112 | return signature; 113 | } 114 | 115 | /** 116 | * Sets the value of the signature property. 117 | * 118 | * @param value 119 | * allowed object is 120 | * {@link String } 121 | * 122 | */ 123 | public void setSignature(String value) { 124 | this.signature = value; 125 | } 126 | 127 | /** 128 | * Gets the value of the subtype property. 129 | * 130 | * @return 131 | * possible object is 132 | * {@link String } 133 | * 134 | */ 135 | public String getSubtype() { 136 | return subtype; 137 | } 138 | 139 | /** 140 | * Sets the value of the subtype property. 141 | * 142 | * @param value 143 | * allowed object is 144 | * {@link String } 145 | * 146 | */ 147 | public void setSubtype(String value) { 148 | this.subtype = value; 149 | } 150 | 151 | } 152 | -------------------------------------------------------------------------------- /org.junit.tools/schema/org.junit.tools.generator.exsd: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | Extension-point for customized generator-implementations 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | This class implements a TestClassGenerator. 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | This class implements a TestSuites-Generator. 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | This class implements a Mockclass-Generator. 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 1.0.0 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | [Enter extension point usage example here.] 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | [Enter API information here.] 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | [Enter information about supplied implementation of this extension point.] 130 | 131 | 132 | 133 | 134 | 135 | -------------------------------------------------------------------------------- /org.junit.tools/src/org/junit/tools/ui/generator/swt/view/GroupMethodSelectionView.java: -------------------------------------------------------------------------------- 1 | package org.junit.tools.ui.generator.swt.view; 2 | 3 | import org.eclipse.jdt.ui.JavaElementLabelProvider; 4 | import org.eclipse.jdt.ui.StandardJavaElementContentProvider; 5 | import org.eclipse.jface.viewers.CheckboxTreeViewer; 6 | import org.eclipse.jface.viewers.ILabelProvider; 7 | import org.eclipse.jface.viewers.ITreeContentProvider; 8 | import org.eclipse.swt.SWT; 9 | import org.eclipse.swt.custom.SashForm; 10 | import org.eclipse.swt.custom.ScrolledComposite; 11 | import org.eclipse.swt.layout.GridData; 12 | import org.eclipse.swt.layout.GridLayout; 13 | import org.eclipse.swt.widgets.Button; 14 | import org.eclipse.swt.widgets.Composite; 15 | import org.eclipse.swt.widgets.Group; 16 | import org.eclipse.swt.widgets.Label; 17 | import org.eclipse.swt.widgets.Tree; 18 | import org.eclipse.ui.dialogs.ContainerCheckedTreeViewer; 19 | import org.junit.tools.messages.Messages; 20 | 21 | public class GroupMethodSelectionView extends Composite { 22 | 23 | private CheckboxTreeViewer checkboxTreeViewer; 24 | 25 | private Button btnNamefilter; 26 | 27 | private Button btnModifierfilter; 28 | 29 | private Button btnSelectAll; 30 | 31 | private Button btnDeselectAll; 32 | 33 | private Button btnExistingMethodsFilter; 34 | 35 | public GroupMethodSelectionView(Composite parent, int style) { 36 | super(parent, style); 37 | setLayout(new GridLayout(1, false)); 38 | 39 | Group group = new Group(this, SWT.NONE); 40 | 41 | group.setText(Messages.GeneratorWizardMainPage_methods); 42 | 43 | group.setLayout(new GridLayout()); 44 | group.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); 45 | 46 | SashForm sashForm = new SashForm(group, SWT.NONE); 47 | sashForm.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); 48 | Composite composite = new Composite(sashForm, SWT.FILL); 49 | composite.setLayout(new GridLayout(1, false)); 50 | 51 | ScrolledComposite scrolledComposite = new ScrolledComposite(composite, 52 | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER); 53 | scrolledComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, 54 | true)); 55 | scrolledComposite.setExpandVertical(true); 56 | scrolledComposite.setExpandHorizontal(true); 57 | 58 | // tree-viewer 59 | createTreeViewer(scrolledComposite); 60 | Tree tree = checkboxTreeViewer.getTree(); 61 | scrolledComposite.setContent(tree); 62 | scrolledComposite 63 | .setMinSize(tree.computeSize(SWT.DEFAULT, SWT.DEFAULT)); 64 | 65 | // tree-config 66 | Composite composite_3 = new Composite(sashForm, SWT.NONE); 67 | composite_3.setLayout(new GridLayout(1, false)); 68 | 69 | btnSelectAll = new Button(composite_3, SWT.ALL); 70 | btnSelectAll.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, 71 | false)); 72 | btnSelectAll.setText(Messages.GeneratorWizardMainPage_Select_all); 73 | 74 | btnDeselectAll = new Button(composite_3, SWT.NONE); 75 | btnDeselectAll.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, 76 | false)); 77 | btnDeselectAll.setText(Messages.GeneratorWizardMainPage_Deselect_all); 78 | 79 | Label lblFilter = new Label(composite_3, SWT.NONE); 80 | lblFilter.setText(Messages.GeneratorWizardMainPage_Filter); 81 | 82 | btnNamefilter = new Button(composite_3, SWT.CHECK); 83 | btnNamefilter.setSelection(true); 84 | btnNamefilter.setText(Messages.GeneratorWizardMainPage_name); 85 | 86 | btnModifierfilter = new Button(composite_3, SWT.CHECK); 87 | btnModifierfilter.setText(Messages.GeneratorWizardMainPage_modifier); 88 | btnModifierfilter.setSelection(true); 89 | 90 | btnExistingMethodsFilter = new Button(composite_3, SWT.CHECK); 91 | btnExistingMethodsFilter 92 | .setText(Messages.GeneratorWizardMainPage_existing_methods); 93 | btnExistingMethodsFilter.setSelection(true); 94 | 95 | sashForm.setWeights(new int[] { 10, 3 }); 96 | 97 | } 98 | 99 | private CheckboxTreeViewer createTreeViewer(Composite parent) { 100 | checkboxTreeViewer = new ContainerCheckedTreeViewer(parent, SWT.CHECK); 101 | 102 | ITreeContentProvider contentProvider = new StandardJavaElementContentProvider( 103 | true); 104 | checkboxTreeViewer.setContentProvider(contentProvider); 105 | 106 | // label provider 107 | ILabelProvider labelProvider = new JavaElementLabelProvider( 108 | JavaElementLabelProvider.SHOW_DEFAULT 109 | | JavaElementLabelProvider.SHOW_RETURN_TYPE); 110 | checkboxTreeViewer.setLabelProvider(labelProvider); 111 | 112 | return checkboxTreeViewer; 113 | } 114 | 115 | public CheckboxTreeViewer getCheckboxTreeViewer() { 116 | return checkboxTreeViewer; 117 | } 118 | 119 | public Button getBtnNamefilter() { 120 | return btnNamefilter; 121 | } 122 | 123 | public Button getBtnModifierfilter() { 124 | return btnModifierfilter; 125 | } 126 | 127 | public Button getBtnSelectAll() { 128 | return btnSelectAll; 129 | } 130 | 131 | public Button getBtnDeselectAll() { 132 | return btnDeselectAll; 133 | } 134 | 135 | public Button getBtnExistingMethodsFilter() { 136 | return btnExistingMethodsFilter; 137 | } 138 | 139 | } 140 | -------------------------------------------------------------------------------- /org.junit.tools/src/org/junit/tools/generator/model/tml/Assertion.java: -------------------------------------------------------------------------------- 1 | // 2 | // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 3 | // See http://java.sun.com/xml/jaxb 4 | // Any modifications to this file will be lost upon recompilation of the source schema. 5 | // Generated on: 2015.11.22 at 02:08:56 AM CET 6 | // 7 | 8 | 9 | package org.junit.tools.generator.model.tml; 10 | 11 | import javax.xml.bind.annotation.XmlAccessType; 12 | import javax.xml.bind.annotation.XmlAccessorType; 13 | import javax.xml.bind.annotation.XmlAttribute; 14 | import javax.xml.bind.annotation.XmlElement; 15 | import javax.xml.bind.annotation.XmlType; 16 | 17 | 18 | /** 19 | *

Java class for Assertion complex type. 20 | * 21 | *

The following schema fragment specifies the expected content contained within this class. 22 | * 23 | *

 24 |  * <complexType name="Assertion">
 25 |  *   <complexContent>
 26 |  *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
 27 |  *       <sequence>
 28 |  *         <element name="value" type="{http://www.w3.org/2001/XMLSchema}string"/>
 29 |  *         <element name="message" type="{http://www.w3.org/2001/XMLSchema}string"/>
 30 |  *       </sequence>
 31 |  *       <attribute name="base" type="{http://www.w3.org/2001/XMLSchema}string" />
 32 |  *       <attribute name="baseType" type="{http://www.w3.org/2001/XMLSchema}string" />
 33 |  *       <attribute name="type" type="{http://www.junit-tools.org/tml/tml.xsd}AssertionType" />
 34 |  *     </restriction>
 35 |  *   </complexContent>
 36 |  * </complexType>
 37 |  * 
38 | * 39 | * 40 | */ 41 | @XmlAccessorType(XmlAccessType.FIELD) 42 | @XmlType(name = "Assertion", propOrder = { 43 | "value", 44 | "message" 45 | }) 46 | public class Assertion { 47 | 48 | @XmlElement(required = true) 49 | protected String value; 50 | @XmlElement(required = true) 51 | protected String message; 52 | @XmlAttribute(name = "base") 53 | protected String base; 54 | @XmlAttribute(name = "baseType") 55 | protected String baseType; 56 | @XmlAttribute(name = "type") 57 | protected AssertionType type; 58 | 59 | /** 60 | * Gets the value of the value property. 61 | * 62 | * @return 63 | * possible object is 64 | * {@link String } 65 | * 66 | */ 67 | public String getValue() { 68 | return value; 69 | } 70 | 71 | /** 72 | * Sets the value of the value property. 73 | * 74 | * @param value 75 | * allowed object is 76 | * {@link String } 77 | * 78 | */ 79 | public void setValue(String value) { 80 | this.value = value; 81 | } 82 | 83 | /** 84 | * Gets the value of the message property. 85 | * 86 | * @return 87 | * possible object is 88 | * {@link String } 89 | * 90 | */ 91 | public String getMessage() { 92 | return message; 93 | } 94 | 95 | /** 96 | * Sets the value of the message property. 97 | * 98 | * @param value 99 | * allowed object is 100 | * {@link String } 101 | * 102 | */ 103 | public void setMessage(String value) { 104 | this.message = value; 105 | } 106 | 107 | /** 108 | * Gets the value of the base property. 109 | * 110 | * @return 111 | * possible object is 112 | * {@link String } 113 | * 114 | */ 115 | public String getBase() { 116 | return base; 117 | } 118 | 119 | /** 120 | * Sets the value of the base property. 121 | * 122 | * @param value 123 | * allowed object is 124 | * {@link String } 125 | * 126 | */ 127 | public void setBase(String value) { 128 | this.base = value; 129 | } 130 | 131 | /** 132 | * Gets the value of the baseType property. 133 | * 134 | * @return 135 | * possible object is 136 | * {@link String } 137 | * 138 | */ 139 | public String getBaseType() { 140 | return baseType; 141 | } 142 | 143 | /** 144 | * Sets the value of the baseType property. 145 | * 146 | * @param value 147 | * allowed object is 148 | * {@link String } 149 | * 150 | */ 151 | public void setBaseType(String value) { 152 | this.baseType = value; 153 | } 154 | 155 | /** 156 | * Gets the value of the type property. 157 | * 158 | * @return 159 | * possible object is 160 | * {@link AssertionType } 161 | * 162 | */ 163 | public AssertionType getType() { 164 | return type; 165 | } 166 | 167 | /** 168 | * Sets the value of the type property. 169 | * 170 | * @param value 171 | * allowed object is 172 | * {@link AssertionType } 173 | * 174 | */ 175 | public void setType(AssertionType value) { 176 | this.type = value; 177 | } 178 | 179 | } 180 | -------------------------------------------------------------------------------- /org.junit.tools/src/org/junit/tools/generator/model/tml/Settings.java: -------------------------------------------------------------------------------- 1 | // 2 | // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 3 | // See http://java.sun.com/xml/jaxb 4 | // Any modifications to this file will be lost upon recompilation of the source schema. 5 | // Generated on: 2015.11.22 at 02:08:56 AM CET 6 | // 7 | 8 | 9 | package org.junit.tools.generator.model.tml; 10 | 11 | import javax.xml.bind.annotation.XmlAccessType; 12 | import javax.xml.bind.annotation.XmlAccessorType; 13 | import javax.xml.bind.annotation.XmlType; 14 | 15 | 16 | /** 17 | *

Java class for Settings complex type. 18 | * 19 | *

The following schema fragment specifies the expected content contained within this class. 20 | * 21 | *

 22 |  * <complexType name="Settings">
 23 |  *   <complexContent>
 24 |  *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
 25 |  *       <sequence>
 26 |  *         <element name="setUp" type="{http://www.w3.org/2001/XMLSchema}boolean"/>
 27 |  *         <element name="setUpBeforeClass" type="{http://www.w3.org/2001/XMLSchema}boolean"/>
 28 |  *         <element name="tearDown" type="{http://www.w3.org/2001/XMLSchema}boolean"/>
 29 |  *         <element name="tearDownBeforeClass" type="{http://www.w3.org/2001/XMLSchema}boolean"/>
 30 |  *         <element name="logger" type="{http://www.w3.org/2001/XMLSchema}boolean"/>
 31 |  *         <element name="failAssertions" type="{http://www.w3.org/2001/XMLSchema}boolean"/>
 32 |  *         <element name="testsuites" type="{http://www.w3.org/2001/XMLSchema}boolean"/>
 33 |  *       </sequence>
 34 |  *     </restriction>
 35 |  *   </complexContent>
 36 |  * </complexType>
 37 |  * 
38 | * 39 | * 40 | */ 41 | @XmlAccessorType(XmlAccessType.FIELD) 42 | @XmlType(name = "Settings", propOrder = { 43 | "setUp", 44 | "setUpBeforeClass", 45 | "tearDown", 46 | "tearDownBeforeClass", 47 | "logger", 48 | "failAssertions", 49 | "testsuites" 50 | }) 51 | public class Settings { 52 | 53 | protected boolean setUp; 54 | protected boolean setUpBeforeClass; 55 | protected boolean tearDown; 56 | protected boolean tearDownBeforeClass; 57 | protected boolean logger; 58 | protected boolean failAssertions; 59 | protected boolean testsuites; 60 | 61 | /** 62 | * Gets the value of the setUp property. 63 | * 64 | */ 65 | public boolean isSetUp() { 66 | return setUp; 67 | } 68 | 69 | /** 70 | * Sets the value of the setUp property. 71 | * 72 | */ 73 | public void setSetUp(boolean value) { 74 | this.setUp = value; 75 | } 76 | 77 | /** 78 | * Gets the value of the setUpBeforeClass property. 79 | * 80 | */ 81 | public boolean isSetUpBeforeClass() { 82 | return setUpBeforeClass; 83 | } 84 | 85 | /** 86 | * Sets the value of the setUpBeforeClass property. 87 | * 88 | */ 89 | public void setSetUpBeforeClass(boolean value) { 90 | this.setUpBeforeClass = value; 91 | } 92 | 93 | /** 94 | * Gets the value of the tearDown property. 95 | * 96 | */ 97 | public boolean isTearDown() { 98 | return tearDown; 99 | } 100 | 101 | /** 102 | * Sets the value of the tearDown property. 103 | * 104 | */ 105 | public void setTearDown(boolean value) { 106 | this.tearDown = value; 107 | } 108 | 109 | /** 110 | * Gets the value of the tearDownBeforeClass property. 111 | * 112 | */ 113 | public boolean isTearDownBeforeClass() { 114 | return tearDownBeforeClass; 115 | } 116 | 117 | /** 118 | * Sets the value of the tearDownBeforeClass property. 119 | * 120 | */ 121 | public void setTearDownBeforeClass(boolean value) { 122 | this.tearDownBeforeClass = value; 123 | } 124 | 125 | /** 126 | * Gets the value of the logger property. 127 | * 128 | */ 129 | public boolean isLogger() { 130 | return logger; 131 | } 132 | 133 | /** 134 | * Sets the value of the logger property. 135 | * 136 | */ 137 | public void setLogger(boolean value) { 138 | this.logger = value; 139 | } 140 | 141 | /** 142 | * Gets the value of the failAssertions property. 143 | * 144 | */ 145 | public boolean isFailAssertions() { 146 | return failAssertions; 147 | } 148 | 149 | /** 150 | * Sets the value of the failAssertions property. 151 | * 152 | */ 153 | public void setFailAssertions(boolean value) { 154 | this.failAssertions = value; 155 | } 156 | 157 | /** 158 | * Gets the value of the testsuites property. 159 | * 160 | */ 161 | public boolean isTestsuites() { 162 | return testsuites; 163 | } 164 | 165 | /** 166 | * Sets the value of the testsuites property. 167 | * 168 | */ 169 | public void setTestsuites(boolean value) { 170 | this.testsuites = value; 171 | } 172 | 173 | } 174 | -------------------------------------------------------------------------------- /org.junit.tools/src/org/junit/tools/reports/model/RepProject.java: -------------------------------------------------------------------------------- 1 | // 2 | // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 3 | // See http://java.sun.com/xml/jaxb 4 | // Any modifications to this file will be lost upon recompilation of the source schema. 5 | // Generated on: 2015.11.23 at 09:36:22 AM CET 6 | // 7 | 8 | 9 | package org.junit.tools.reports.model; 10 | 11 | import java.util.ArrayList; 12 | import java.util.List; 13 | 14 | import javax.xml.bind.annotation.XmlAccessType; 15 | import javax.xml.bind.annotation.XmlAccessorType; 16 | import javax.xml.bind.annotation.XmlAttribute; 17 | import javax.xml.bind.annotation.XmlElement; 18 | import javax.xml.bind.annotation.XmlRootElement; 19 | import javax.xml.bind.annotation.XmlType; 20 | 21 | 22 | /** 23 | *

Java class for anonymous complex type. 24 | * 25 | *

The following schema fragment specifies the expected content contained within this class. 26 | * 27 | *

 28 |  * <complexType>
 29 |  *   <complexContent>
 30 |  *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
 31 |  *       <sequence>
 32 |  *         <element name="statistics" type="{http://www.junit-tools.org/ntrml/ntrml.xsd}Statistics" minOccurs="0"/>
 33 |  *         <element name="newMethods" type="{http://www.junit-tools.org/ntrml/ntrml.xsd}NewMethods" maxOccurs="unbounded" minOccurs="0"/>
 34 |  *         <element name="packages" type="{http://www.junit-tools.org/ntrml/ntrml.xsd}RepPackage" maxOccurs="unbounded"/>
 35 |  *       </sequence>
 36 |  *       <attribute name="id" type="{http://www.w3.org/2001/XMLSchema}string" />
 37 |  *     </restriction>
 38 |  *   </complexContent>
 39 |  * </complexType>
 40 |  * 
41 | * 42 | * 43 | */ 44 | @XmlAccessorType(XmlAccessType.FIELD) 45 | @XmlType(name = "", propOrder = { 46 | "statistics", 47 | "newMethods", 48 | "packages" 49 | }) 50 | @XmlRootElement(name = "RepProject") 51 | public class RepProject { 52 | 53 | protected Statistics statistics; 54 | protected List newMethods; 55 | @XmlElement(required = true) 56 | protected List packages; 57 | @XmlAttribute(name = "id") 58 | protected String id; 59 | 60 | /** 61 | * Gets the value of the statistics property. 62 | * 63 | * @return 64 | * possible object is 65 | * {@link Statistics } 66 | * 67 | */ 68 | public Statistics getStatistics() { 69 | return statistics; 70 | } 71 | 72 | /** 73 | * Sets the value of the statistics property. 74 | * 75 | * @param value 76 | * allowed object is 77 | * {@link Statistics } 78 | * 79 | */ 80 | public void setStatistics(Statistics value) { 81 | this.statistics = value; 82 | } 83 | 84 | /** 85 | * Gets the value of the newMethods property. 86 | * 87 | *

88 | * This accessor method returns a reference to the live list, 89 | * not a snapshot. Therefore any modification you make to the 90 | * returned list will be present inside the JAXB object. 91 | * This is why there is not a set method for the newMethods property. 92 | * 93 | *

94 | * For example, to add a new item, do as follows: 95 | *

 96 |      *    getNewMethods().add(newItem);
 97 |      * 
98 | * 99 | * 100 | *

101 | * Objects of the following type(s) are allowed in the list 102 | * {@link NewMethods } 103 | * 104 | * 105 | */ 106 | public List getNewMethods() { 107 | if (newMethods == null) { 108 | newMethods = new ArrayList(); 109 | } 110 | return this.newMethods; 111 | } 112 | 113 | /** 114 | * Gets the value of the packages property. 115 | * 116 | *

117 | * This accessor method returns a reference to the live list, 118 | * not a snapshot. Therefore any modification you make to the 119 | * returned list will be present inside the JAXB object. 120 | * This is why there is not a set method for the packages property. 121 | * 122 | *

123 | * For example, to add a new item, do as follows: 124 | *

125 |      *    getPackages().add(newItem);
126 |      * 
127 | * 128 | * 129 | *

130 | * Objects of the following type(s) are allowed in the list 131 | * {@link RepPackage } 132 | * 133 | * 134 | */ 135 | public List getPackages() { 136 | if (packages == null) { 137 | packages = new ArrayList(); 138 | } 139 | return this.packages; 140 | } 141 | 142 | /** 143 | * Gets the value of the id property. 144 | * 145 | * @return 146 | * possible object is 147 | * {@link String } 148 | * 149 | */ 150 | public String getId() { 151 | return id; 152 | } 153 | 154 | /** 155 | * Sets the value of the id property. 156 | * 157 | * @param value 158 | * allowed object is 159 | * {@link String } 160 | * 161 | */ 162 | public void setId(String value) { 163 | this.id = value; 164 | } 165 | 166 | } 167 | -------------------------------------------------------------------------------- /org.junit.tools/src/org/junit/tools/reports/model/Statistics.java: -------------------------------------------------------------------------------- 1 | // 2 | // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 3 | // See http://java.sun.com/xml/jaxb 4 | // Any modifications to this file will be lost upon recompilation of the source schema. 5 | // Generated on: 2015.11.23 at 09:36:22 AM CET 6 | // 7 | 8 | 9 | package org.junit.tools.reports.model; 10 | 11 | import javax.xml.bind.annotation.XmlAccessType; 12 | import javax.xml.bind.annotation.XmlAccessorType; 13 | import javax.xml.bind.annotation.XmlType; 14 | 15 | 16 | /** 17 | *

Java class for Statistics complex type. 18 | * 19 | *

The following schema fragment specifies the expected content contained within this class. 20 | * 21 | *

 22 |  * <complexType name="Statistics">
 23 |  *   <complexContent>
 24 |  *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
 25 |  *       <sequence>
 26 |  *         <element name="necessaryTestClassesCounter" type="{http://www.w3.org/2001/XMLSchema}int"/>
 27 |  *         <element name="availableTestClassesCounter" type="{http://www.w3.org/2001/XMLSchema}int"/>
 28 |  *         <element name="necessaryTestMethodsCounter" type="{http://www.w3.org/2001/XMLSchema}int"/>
 29 |  *         <element name="availableTestMethodsCounter" type="{http://www.w3.org/2001/XMLSchema}int"/>
 30 |  *         <element name="classCoverage" type="{http://www.w3.org/2001/XMLSchema}double"/>
 31 |  *         <element name="methodCoverage" type="{http://www.w3.org/2001/XMLSchema}double"/>
 32 |  *         <element name="newMethodsCounter" type="{http://www.w3.org/2001/XMLSchema}int"/>
 33 |  *       </sequence>
 34 |  *     </restriction>
 35 |  *   </complexContent>
 36 |  * </complexType>
 37 |  * 
38 | * 39 | * 40 | */ 41 | @XmlAccessorType(XmlAccessType.FIELD) 42 | @XmlType(name = "Statistics", propOrder = { 43 | "necessaryTestClassesCounter", 44 | "availableTestClassesCounter", 45 | "necessaryTestMethodsCounter", 46 | "availableTestMethodsCounter", 47 | "classCoverage", 48 | "methodCoverage", 49 | "newMethodsCounter" 50 | }) 51 | public class Statistics { 52 | 53 | protected int necessaryTestClassesCounter; 54 | protected int availableTestClassesCounter; 55 | protected int necessaryTestMethodsCounter; 56 | protected int availableTestMethodsCounter; 57 | protected double classCoverage; 58 | protected double methodCoverage; 59 | protected int newMethodsCounter; 60 | 61 | /** 62 | * Gets the value of the necessaryTestClassesCounter property. 63 | * 64 | */ 65 | public int getNecessaryTestClassesCounter() { 66 | return necessaryTestClassesCounter; 67 | } 68 | 69 | /** 70 | * Sets the value of the necessaryTestClassesCounter property. 71 | * 72 | */ 73 | public void setNecessaryTestClassesCounter(int value) { 74 | this.necessaryTestClassesCounter = value; 75 | } 76 | 77 | /** 78 | * Gets the value of the availableTestClassesCounter property. 79 | * 80 | */ 81 | public int getAvailableTestClassesCounter() { 82 | return availableTestClassesCounter; 83 | } 84 | 85 | /** 86 | * Sets the value of the availableTestClassesCounter property. 87 | * 88 | */ 89 | public void setAvailableTestClassesCounter(int value) { 90 | this.availableTestClassesCounter = value; 91 | } 92 | 93 | /** 94 | * Gets the value of the necessaryTestMethodsCounter property. 95 | * 96 | */ 97 | public int getNecessaryTestMethodsCounter() { 98 | return necessaryTestMethodsCounter; 99 | } 100 | 101 | /** 102 | * Sets the value of the necessaryTestMethodsCounter property. 103 | * 104 | */ 105 | public void setNecessaryTestMethodsCounter(int value) { 106 | this.necessaryTestMethodsCounter = value; 107 | } 108 | 109 | /** 110 | * Gets the value of the availableTestMethodsCounter property. 111 | * 112 | */ 113 | public int getAvailableTestMethodsCounter() { 114 | return availableTestMethodsCounter; 115 | } 116 | 117 | /** 118 | * Sets the value of the availableTestMethodsCounter property. 119 | * 120 | */ 121 | public void setAvailableTestMethodsCounter(int value) { 122 | this.availableTestMethodsCounter = value; 123 | } 124 | 125 | /** 126 | * Gets the value of the classCoverage property. 127 | * 128 | */ 129 | public double getClassCoverage() { 130 | return classCoverage; 131 | } 132 | 133 | /** 134 | * Sets the value of the classCoverage property. 135 | * 136 | */ 137 | public void setClassCoverage(double value) { 138 | this.classCoverage = value; 139 | } 140 | 141 | /** 142 | * Gets the value of the methodCoverage property. 143 | * 144 | */ 145 | public double getMethodCoverage() { 146 | return methodCoverage; 147 | } 148 | 149 | /** 150 | * Sets the value of the methodCoverage property. 151 | * 152 | */ 153 | public void setMethodCoverage(double value) { 154 | this.methodCoverage = value; 155 | } 156 | 157 | /** 158 | * Gets the value of the newMethodsCounter property. 159 | * 160 | */ 161 | public int getNewMethodsCounter() { 162 | return newMethodsCounter; 163 | } 164 | 165 | /** 166 | * Sets the value of the newMethodsCounter property. 167 | * 168 | */ 169 | public void setNewMethodsCounter(int value) { 170 | this.newMethodsCounter = value; 171 | } 172 | 173 | } 174 | -------------------------------------------------------------------------------- /org.junit.tools/src/org/junit/tools/messages/messages.properties: -------------------------------------------------------------------------------- 1 | #Eclipse modern messages class 2 | #Thu Feb 11 17:05:11 CET 2016 3 | General_error=Error 4 | General_error_processing=Error while processing\! To report the error, please send an email to the JUnit-Tools-Team or create an issue (see www.junit-tools.org). 5 | General_info_generation_successful=Generation successful completed. 6 | General_info_process_successful=Process successful completed. 7 | General_information=Information 8 | General_select_all=Select All 9 | General_warning=Warning 10 | General_warning_base_project_not_found=The base-project could not be found\! Check the configuration. 11 | General_warning_nothing_selected=Nothing selected or open in the editor\! Select a java-class. 12 | General_warning_project_initialization=Error while project initialization\! Check the configuration. 13 | General_warning_test_project_not_found=The test-project could not be found\! Create a test-project or check the configuration. 14 | GeneratorUtils_ErrorPackageCreation=Error during package creation\! 15 | GeneratorUtils_MethodExists=method already exists\: 16 | GeneratorUtils_OnlyJavaProjects=Only java-projects are supported\! 17 | GeneratorUtils_SelectionEnd=Selection must end with .java\! 18 | GeneratorUtils_SelectionNotSupported=Selection is not supported\! 19 | GeneratorWizardMainPage_Browse=Browse... 20 | GeneratorWizardMainPage_Deselect_all=Deselect All 21 | GeneratorWizardMainPage_Filter=Filter\: 22 | GeneratorWizardMainPage_Generate=Generate\: 23 | GeneratorWizardMainPage_Hooks_for_manuals=Hooks for manuals 24 | GeneratorWizardMainPage_Other=Other 25 | GeneratorWizardMainPage_Select_all=Select All 26 | GeneratorWizardMainPage_Standardmethods=Standardmethods 27 | GeneratorWizardMainPage_Super_class=Super-Class 28 | GeneratorWizardMainPage_Testmethod_prefix=Testmethod-prefix 29 | GeneratorWizardMainPage_Testpriority=Testpriority 30 | GeneratorWizardMainPage_Testproject=Testproject 31 | GeneratorWizardMainPage_afterMethodCall=afterMethodCall() 32 | GeneratorWizardMainPage_beforeMethodCall=beforeMethodCall() 33 | GeneratorWizardMainPage_createTestBaseAfter=createTestBaseAfter() 34 | GeneratorWizardMainPage_createTestBaseBefore=createTestBaseBefore() 35 | GeneratorWizardMainPage_existing_methods=existing-methods 36 | GeneratorWizardMainPage_fail_assertions=fail-assertions 37 | GeneratorWizardMainPage_high=high 38 | GeneratorWizardMainPage_logger=logger 39 | GeneratorWizardMainPage_low=low 40 | GeneratorWizardMainPage_main_settings=main settings 41 | GeneratorWizardMainPage_methods=methods 42 | GeneratorWizardMainPage_modifier=modifier 43 | GeneratorWizardMainPage_name=name 44 | GeneratorWizardMainPage_setUp=setUp() 45 | GeneratorWizardMainPage_setUpBeforeClass=setUpBeforeClass() 46 | GeneratorWizardMainPage_standard=standard 47 | GeneratorWizardMainPage_tearDown=tearDown() 48 | GeneratorWizardMainPage_tearDownAfterClass=tearDownAfterClass() 49 | GeneratorWizardMainPage_testsuites=testsuites 50 | GeneratorWizardMainPage_toggle=toggle 51 | GeneratorWizardTestBasesPage_Constructor=Constructor 52 | GeneratorWizardTestBasesPage_mocks=mocks 53 | GeneratorWizardTestBasesPage_testbases=testbases 54 | GeneratorWizardTestBases_ErrorDuringConstructorHandling=Error during constructor handling\! 55 | GeneratorWizardTestBases_ErrorWhileGetParamsFromSelectedMethod=Error while getParameters from selected method\! 56 | GeneratorWizardTestBases_ErrorWhileWritingTmlFile=Error while writing the tml-file\! 57 | GeneratorWizardTestBases_MustEditTestIds=You must edit one of the test-base-IDs\! 58 | GeneratorWizardTestBases_ReturnValue=return-value 59 | GeneratorWizardTestBases_TestBaseIdMustBeUnique=The test-base-IDs must be unique\! 60 | GeneratorWizardTestBases_method=method 61 | GeneratorWizardTestBases_testBaseId=testbase-id 62 | GeneratorWizardTestCasesPage_Method=Method 63 | GeneratorWizardTestCasesPage_assertions=assertions 64 | GeneratorWizardTestCasesPage_testcases=testcases 65 | GeneratorWizard_Unit_test_class_generator=Unit test-class-generator 66 | GeneratorWizard_description_main=This wizard creates a unit test-class-file or synchronise it if exists. 67 | GeneratorWizard_description_testbases=Here you can define the testbases depend on constructors and mocks. 68 | GeneratorWizard_description_testcases=Here you can define the testcases for every method. 69 | GeneratorWizard_mainPage=mainPage 70 | GeneratorWizard_testbases=\ - testbases 71 | GeneratorWizard_testbasesPage=testbasesPage 72 | GeneratorWizard_testcases=\ - testcases 73 | GeneratorWizard_testcasesPage=testcasesPage 74 | JUTPreferenceFilterPage_Modifier_filter=Modifier filter 75 | JUTPreferenceFilterPage_Name_filter=Name filter 76 | JUTPreferenceFilterPage_description_filters=Filters for the selection of the methods to test 77 | JUTPreferenceAnnotationsPage_description=Here you can set additional annotations for the generated test- and mock-classes. 78 | JUTPreferenceStaticBindingsPage_description=Here you can set static bindings between the project under test and the corresponding test-project. 79 | JUTPreferenceMainPage_Mock_Project=Default mock-project: 80 | JUTPreferenceMainPage_Mock_Framework=Mock framework: 81 | JUTPreferenceMainPage_Mock_Save_In_Test_Project=Save mocks in the corresponding test-project if available 82 | JUTPreferenceMainPage_TML_container=&TML-container\: 83 | JUTPreferenceMainPage_Test_Method_postfix=Test-method-postfix\: 84 | JUTPreferenceMainPage_Test_class_prefix=Test-class-prefix\: 85 | JUTPreferenceMainPage_Test_class_postfix=Test-class-postfix\: 86 | JUTPreferenceMainPage_Test_method_prefix=Test-method-prefix\: 87 | JUTPreferenceMainPage_Test_package_postfix=Test-package-postfix\: 88 | JUTPreferenceMainPage_Test_project_postfix=Test-project-postfix\: 89 | JUTPreferenceMainPage_Test_source_folder_name=Test-source-folder-name\: 90 | JUTPreferenceMainPage_Testclass_supertype=Test-class supertype: 91 | JUTPreferenceMainPage_description_Main_settings=The main settings for the JUnit-Tools plug-in. \n\nHere you can set the structure and names of the corresponding test elements. Under every setting you can see a short description or an example.\n\nFor exceptions you can define static bindings (see "Static bindings" tab). 92 | JUTPreferenceMainPage_write_TML=Write TML-files 93 | TableViewerBase_Add=Add 94 | TableViewerBase_Copy=Copy 95 | TableViewerBase_Delete=Delete 96 | -------------------------------------------------------------------------------- /org.junit.tools/classes/org/junit/tools/messages/messages.properties: -------------------------------------------------------------------------------- 1 | #Eclipse modern messages class 2 | #Thu Feb 11 17:05:11 CET 2016 3 | General_error=Error 4 | General_error_processing=Error while processing\! To report the error, please send an email to the JUnit-Tools-Team or create an issue (see www.junit-tools.org). 5 | General_info_generation_successful=Generation successful completed. 6 | General_info_process_successful=Process successful completed. 7 | General_information=Information 8 | General_select_all=Select All 9 | General_warning=Warning 10 | General_warning_base_project_not_found=The base-project could not be found\! Check the configuration. 11 | General_warning_nothing_selected=Nothing selected or open in the editor\! Select a java-class. 12 | General_warning_project_initialization=Error while project initialization\! Check the configuration. 13 | General_warning_test_project_not_found=The test-project could not be found\! Create a test-project or check the configuration. 14 | GeneratorUtils_ErrorPackageCreation=Error during package creation\! 15 | GeneratorUtils_MethodExists=method already exists\: 16 | GeneratorUtils_OnlyJavaProjects=Only java-projects are supported\! 17 | GeneratorUtils_SelectionEnd=Selection must end with .java\! 18 | GeneratorUtils_SelectionNotSupported=Selection is not supported\! 19 | GeneratorWizardMainPage_Browse=Browse... 20 | GeneratorWizardMainPage_Deselect_all=Deselect All 21 | GeneratorWizardMainPage_Filter=Filter\: 22 | GeneratorWizardMainPage_Generate=Generate\: 23 | GeneratorWizardMainPage_Hooks_for_manuals=Hooks for manuals 24 | GeneratorWizardMainPage_Other=Other 25 | GeneratorWizardMainPage_Select_all=Select All 26 | GeneratorWizardMainPage_Standardmethods=Standardmethods 27 | GeneratorWizardMainPage_Super_class=Super-Class 28 | GeneratorWizardMainPage_Testmethod_prefix=Testmethod-prefix 29 | GeneratorWizardMainPage_Testpriority=Testpriority 30 | GeneratorWizardMainPage_Testproject=Testproject 31 | GeneratorWizardMainPage_afterMethodCall=afterMethodCall() 32 | GeneratorWizardMainPage_beforeMethodCall=beforeMethodCall() 33 | GeneratorWizardMainPage_createTestBaseAfter=createTestBaseAfter() 34 | GeneratorWizardMainPage_createTestBaseBefore=createTestBaseBefore() 35 | GeneratorWizardMainPage_existing_methods=existing-methods 36 | GeneratorWizardMainPage_fail_assertions=fail-assertions 37 | GeneratorWizardMainPage_high=high 38 | GeneratorWizardMainPage_logger=logger 39 | GeneratorWizardMainPage_low=low 40 | GeneratorWizardMainPage_main_settings=main settings 41 | GeneratorWizardMainPage_methods=methods 42 | GeneratorWizardMainPage_modifier=modifier 43 | GeneratorWizardMainPage_name=name 44 | GeneratorWizardMainPage_setUp=setUp() 45 | GeneratorWizardMainPage_setUpBeforeClass=setUpBeforeClass() 46 | GeneratorWizardMainPage_standard=standard 47 | GeneratorWizardMainPage_tearDown=tearDown() 48 | GeneratorWizardMainPage_tearDownAfterClass=tearDownAfterClass() 49 | GeneratorWizardMainPage_testsuites=testsuites 50 | GeneratorWizardMainPage_toggle=toggle 51 | GeneratorWizardTestBasesPage_Constructor=Constructor 52 | GeneratorWizardTestBasesPage_mocks=mocks 53 | GeneratorWizardTestBasesPage_testbases=testbases 54 | GeneratorWizardTestBases_ErrorDuringConstructorHandling=Error during constructor handling\! 55 | GeneratorWizardTestBases_ErrorWhileGetParamsFromSelectedMethod=Error while getParameters from selected method\! 56 | GeneratorWizardTestBases_ErrorWhileWritingTmlFile=Error while writing the tml-file\! 57 | GeneratorWizardTestBases_MustEditTestIds=You must edit one of the test-base-IDs\! 58 | GeneratorWizardTestBases_ReturnValue=return-value 59 | GeneratorWizardTestBases_TestBaseIdMustBeUnique=The test-base-IDs must be unique\! 60 | GeneratorWizardTestBases_method=method 61 | GeneratorWizardTestBases_testBaseId=testbase-id 62 | GeneratorWizardTestCasesPage_Method=Method 63 | GeneratorWizardTestCasesPage_assertions=assertions 64 | GeneratorWizardTestCasesPage_testcases=testcases 65 | GeneratorWizard_Unit_test_class_generator=Unit test-class-generator 66 | GeneratorWizard_description_main=This wizard creates a unit test-class-file or synchronise it if exists. 67 | GeneratorWizard_description_testbases=Here you can define the testbases depend on constructors and mocks. 68 | GeneratorWizard_description_testcases=Here you can define the testcases for every method. 69 | GeneratorWizard_mainPage=mainPage 70 | GeneratorWizard_testbases=\ - testbases 71 | GeneratorWizard_testbasesPage=testbasesPage 72 | GeneratorWizard_testcases=\ - testcases 73 | GeneratorWizard_testcasesPage=testcasesPage 74 | JUTPreferenceFilterPage_Modifier_filter=Modifier filter 75 | JUTPreferenceFilterPage_Name_filter=Name filter 76 | JUTPreferenceFilterPage_description_filters=Filters for the selection of the methods to test 77 | JUTPreferenceAnnotationsPage_description=Here you can set additional annotations for the generated test- and mock-classes. 78 | JUTPreferenceStaticBindingsPage_description=Here you can set static bindings between the project under test and the corresponding test-project. 79 | JUTPreferenceMainPage_Mock_Project=Default mock-project: 80 | JUTPreferenceMainPage_Mock_Framework=Mock framework: 81 | JUTPreferenceMainPage_Mock_Save_In_Test_Project=Save mocks in the corresponding test-project if available 82 | JUTPreferenceMainPage_TML_container=&TML-container\: 83 | JUTPreferenceMainPage_Test_Method_postfix=Test-method-postfix\: 84 | JUTPreferenceMainPage_Test_class_prefix=Test-class-prefix\: 85 | JUTPreferenceMainPage_Test_class_postfix=Test-class-postfix\: 86 | JUTPreferenceMainPage_Test_method_prefix=Test-method-prefix\: 87 | JUTPreferenceMainPage_Test_package_postfix=Test-package-postfix\: 88 | JUTPreferenceMainPage_Test_project_postfix=Test-project-postfix\: 89 | JUTPreferenceMainPage_Test_source_folder_name=Test-source-folder-name\: 90 | JUTPreferenceMainPage_Testclass_supertype=Test-class supertype: 91 | JUTPreferenceMainPage_description_Main_settings=The main settings for the JUnit-Tools plug-in. \n\nHere you can set the structure and names of the corresponding test elements. Under every setting you can see a short description or an example.\n\nFor exceptions you can define static bindings (see "Static bindings" tab). 92 | JUTPreferenceMainPage_write_TML=Write TML-files 93 | TableViewerBase_Add=Add 94 | TableViewerBase_Copy=Copy 95 | TableViewerBase_Delete=Delete 96 | -------------------------------------------------------------------------------- /org.junit.tools/src/org/junit/tools/refactoring/DeleteTestElements.java: -------------------------------------------------------------------------------- 1 | package org.junit.tools.refactoring; 2 | 3 | import org.eclipse.core.runtime.CoreException; 4 | import org.eclipse.core.runtime.IProgressMonitor; 5 | import org.eclipse.core.runtime.OperationCanceledException; 6 | import org.eclipse.jdt.core.ICompilationUnit; 7 | import org.eclipse.jdt.core.IJavaProject; 8 | import org.eclipse.jdt.core.IPackageFragment; 9 | import org.eclipse.jdt.core.IType; 10 | import org.eclipse.ltk.core.refactoring.Change; 11 | import org.eclipse.ltk.core.refactoring.CompositeChange; 12 | import org.eclipse.ltk.core.refactoring.PerformChangeOperation; 13 | import org.eclipse.ltk.core.refactoring.RefactoringStatus; 14 | import org.eclipse.ltk.core.refactoring.participants.CheckConditionsContext; 15 | import org.eclipse.ltk.core.refactoring.participants.DeleteParticipant; 16 | import org.junit.tools.Activator; 17 | import org.junit.tools.generator.ITestSuitesGenerator; 18 | import org.junit.tools.generator.model.JUTElements; 19 | import org.junit.tools.generator.utils.GeneratorUtils; 20 | import org.junit.tools.generator.utils.JDTUtils; 21 | 22 | public class DeleteTestElements extends DeleteParticipant { 23 | 24 | private ICompilationUnit deletedCu = null; 25 | 26 | private IPackageFragment deletedPackage = null; 27 | 28 | private IJavaProject deletedProject; 29 | 30 | /** 31 | * @see org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant# 32 | * initialize(java.lang.Object) 33 | */ 34 | @Override 35 | protected boolean initialize(Object element) { 36 | if (element instanceof ICompilationUnit) { 37 | this.deletedCu = (ICompilationUnit) element; 38 | } else if (element instanceof IPackageFragment) { 39 | this.deletedPackage = (IPackageFragment) element; 40 | } else if (element instanceof IJavaProject) { 41 | this.deletedProject = (IJavaProject) element; 42 | } 43 | 44 | return true; 45 | } 46 | 47 | /** 48 | * @see org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant# 49 | * checkConditions(org.eclipse.core.runtime.IProgressMonitor, 50 | * org.eclipse.ltk.core.refactoring.participants.CheckConditionsContext) 51 | */ 52 | @Override 53 | public RefactoringStatus checkConditions(IProgressMonitor pm, 54 | CheckConditionsContext context) { 55 | return new RefactoringStatus(); 56 | } 57 | 58 | /** 59 | * Creates the change for the renaming 60 | * 61 | * @see org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant# 62 | * createChange(org.eclipse.core.runtime.IProgressMonitor) 63 | */ 64 | 65 | @Override 66 | public Change createChange(IProgressMonitor pm1) throws CoreException { 67 | 68 | CompositeChange deleteTestElementsChange = new CompositeChange( 69 | "org.junit.tools delete dependent test-elements"); //$NON-NLS-1$ 70 | 71 | PerformChangeOperation change = new PerformChangeOperation( 72 | 73 | new Change() { 74 | 75 | @Override 76 | public Change perform(IProgressMonitor pm2) throws CoreException { 77 | 78 | JUTElements utmElements = null; 79 | 80 | try { 81 | if (deletedCu != null) { 82 | try { 83 | utmElements = JUTElements.initJUTElements( 84 | deletedCu.getJavaProject(), deletedCu); 85 | } catch (Exception ex) { 86 | return null; 87 | } 88 | ICompilationUnit testClass = utmElements 89 | .getClassesAndPackages().getTestClass(); 90 | 91 | if (utmElements.getProjects().isBaseProjectSelected() 92 | && utmElements.getProjects() 93 | .isTestProjectFound()) { 94 | if (testClass != null && testClass.exists()) { 95 | // delete the test-class 96 | testClass.delete(true, pm2); 97 | } else { 98 | // nothing to do 99 | return null; 100 | } 101 | } 102 | 103 | if (!utmElements.getProjects().isBaseProjectSelected() && utmElements.getProjects() 104 | .isTestProjectFound()) { 105 | if (!GeneratorUtils.isTestClass(deletedCu.findPrimaryType())) { 106 | return null; 107 | } 108 | } 109 | 110 | // actualize the test-suites 111 | for (ITestSuitesGenerator testSuiteGenerator : Activator 112 | .getDefault().getExtensionHandler() 113 | .getTestSuitesGenerators()) { 114 | testSuiteGenerator.deleteTestSuiteElement( 115 | utmElements.getClassesAndPackages() 116 | .getTestPackage(), testClass); 117 | } 118 | 119 | } else if (deletedPackage != null) { 120 | utmElements = JUTElements.initJUTElements( 121 | deletedPackage.getJavaProject(), deletedPackage); 122 | if (utmElements.getProjects().isBaseProjectSelected() 123 | && utmElements.getProjects() 124 | .isTestProjectFound()) { 125 | IPackageFragment testPackage = utmElements 126 | .getClassesAndPackages().getTestPackage(); 127 | if (testPackage.hasSubpackages()) { 128 | for (ICompilationUnit cu : testPackage 129 | .getCompilationUnits()) { 130 | cu.delete(true, pm2); 131 | } 132 | } else { 133 | JDTUtils.deletePackagesWithParents(testPackage); 134 | } 135 | } 136 | } else if (deletedProject != null) { 137 | utmElements = JUTElements 138 | .initJUTElements(deletedProject); 139 | 140 | if (utmElements.getProjects().isBaseProjectSelected() 141 | && utmElements.getProjects() 142 | .isTestProjectFound()) { 143 | utmElements.getProjects().getTestProject().close(); 144 | } 145 | } 146 | 147 | } catch (Exception e) { 148 | // nothing 149 | } 150 | 151 | return null; 152 | } 153 | 154 | @Override 155 | public RefactoringStatus isValid(IProgressMonitor pm) 156 | throws CoreException, OperationCanceledException { 157 | return new RefactoringStatus(); 158 | } 159 | 160 | @Override 161 | public void initializeValidationData(IProgressMonitor pm) { 162 | // nothing 163 | } 164 | 165 | @Override 166 | public String getName() { 167 | String ar = getArguments().getClass().toString(); 168 | return ar; 169 | } 170 | 171 | @Override 172 | public Object getModifiedElement() { 173 | return null; 174 | } 175 | }); 176 | 177 | deleteTestElementsChange.add(change.getChange()); 178 | 179 | return deleteTestElementsChange; 180 | } 181 | 182 | @Override 183 | public String getName() { 184 | return getArguments().getClass().toString(); 185 | } 186 | 187 | } 188 | -------------------------------------------------------------------------------- /org.junit.tools/src/org/junit/tools/base/MethodAnalyzer.java: -------------------------------------------------------------------------------- 1 | package org.junit.tools.base; 2 | 3 | import java.util.ArrayList; 4 | import java.util.HashMap; 5 | import java.util.List; 6 | import java.util.Map; 7 | 8 | import org.eclipse.jdt.core.ICompilationUnit; 9 | import org.eclipse.jdt.core.IMethod; 10 | import org.eclipse.jdt.core.IType; 11 | import org.eclipse.jdt.core.JavaModelException; 12 | import org.eclipse.jdt.core.dom.ASTNode; 13 | import org.eclipse.jdt.core.dom.Block; 14 | import org.eclipse.jdt.core.dom.CompilationUnit; 15 | import org.eclipse.jdt.core.dom.DoStatement; 16 | import org.eclipse.jdt.core.dom.Expression; 17 | import org.eclipse.jdt.core.dom.IfStatement; 18 | import org.eclipse.jdt.core.dom.InfixExpression; 19 | import org.eclipse.jdt.core.dom.InfixExpression.Operator; 20 | import org.eclipse.jdt.core.dom.MethodDeclaration; 21 | import org.eclipse.jdt.core.dom.Statement; 22 | import org.eclipse.jdt.core.dom.WhileStatement; 23 | import org.junit.tools.generator.model.tml.Testprio; 24 | import org.junit.tools.generator.utils.JDTUtils; 25 | 26 | /** 27 | * Analyzer for a base method. The result can be used for test-case generations 28 | * and test-reports. 29 | * 30 | * @author JUnit-Tools-Team 31 | * 32 | */ 33 | public class MethodAnalyzer { 34 | 35 | public class MethodAnalyzeResult { 36 | 37 | private Testprio testPrio = Testprio.DEFAULT; 38 | 39 | private List ifStatements = new ArrayList(); 40 | 41 | private boolean onlyNullChecks = false; 42 | 43 | public Testprio getTestPrio() { 44 | return testPrio; 45 | } 46 | 47 | public void setTestPrio(Testprio testPrio) { 48 | this.testPrio = testPrio; 49 | } 50 | 51 | public List getIfStatements() { 52 | return ifStatements; 53 | } 54 | 55 | public void setIfStatements(List ifInstructions) { 56 | this.ifStatements = ifInstructions; 57 | } 58 | 59 | public boolean isOnlyNullChecks() { 60 | return onlyNullChecks; 61 | } 62 | 63 | public void setOnlyNullChecks(boolean onlyNullChecks) { 64 | this.onlyNullChecks = onlyNullChecks; 65 | } 66 | 67 | public int getNumberOfIfStatements() { 68 | return ifStatements.size(); 69 | } 70 | } 71 | 72 | private List collectIfStatements(Statement st) { 73 | List ifStatements = new ArrayList(); 74 | 75 | if (st == null) { 76 | return ifStatements; 77 | } 78 | 79 | if (st.getNodeType() == ASTNode.IF_STATEMENT) { 80 | IfStatement ifSt = (IfStatement) st; 81 | ifStatements.add(ifSt); 82 | 83 | ifStatements.addAll(collectIfStatements(ifSt.getThenStatement())); 84 | ifStatements.addAll(collectIfStatements(ifSt.getElseStatement())); 85 | } else if (st.getNodeType() == ASTNode.BLOCK) { 86 | Block block = (Block) st; 87 | 88 | for (Object blockSt : block.statements()) { 89 | if (blockSt instanceof Statement) { 90 | ifStatements 91 | .addAll(collectIfStatements((Statement) blockSt)); 92 | } 93 | } 94 | } else if (st.getNodeType() == ASTNode.DO_STATEMENT) { 95 | DoStatement doSt = (DoStatement) st; 96 | ifStatements.addAll(collectIfStatements(doSt.getBody())); 97 | } else if (st.getNodeType() == ASTNode.WHILE_STATEMENT) { 98 | WhileStatement whileSt = (WhileStatement) st; 99 | ifStatements.addAll(collectIfStatements(whileSt.getBody())); 100 | } 101 | 102 | return ifStatements; 103 | } 104 | 105 | public Map analyzeAllMethods( 106 | ICompilationUnit cu) throws JavaModelException { 107 | Map analyzeResult = new HashMap(); 108 | 109 | CompilationUnit astCu = JDTUtils.createASTRoot(cu); 110 | MethodAnalyzeResult mar; 111 | 112 | for (IType type : cu.getAllTypes()) { 113 | for (IMethod method : type.getMethods()) { 114 | mar = analyzeMethod(astCu, method); 115 | 116 | if (mar != null && mar.getTestPrio() != null) { 117 | analyzeResult.put(method, mar); 118 | } 119 | } 120 | } 121 | 122 | return analyzeResult; 123 | } 124 | 125 | private MethodAnalyzeResult analyzeMethod(CompilationUnit astCu, 126 | IMethod method) { 127 | MethodAnalyzeResult mar = new MethodAnalyzeResult(); 128 | MethodDeclaration md = JDTUtils.createMethodDeclaration(astCu, method); 129 | if (md == null) { 130 | return mar; 131 | } 132 | 133 | List ifStatements = collectIfStatements(md); 134 | int numberOfIfStatements = ifStatements.size(); 135 | 136 | mar.setIfStatements(ifStatements); 137 | 138 | // check if only null checks 139 | if (ifStatements.size() > 0) { 140 | boolean onlyNullChecks = true; 141 | 142 | for (IfStatement ifSt : ifStatements) { 143 | Expression expression = ifSt.getExpression(); 144 | 145 | if (expression.getNodeType() == ASTNode.INFIX_EXPRESSION) { 146 | InfixExpression infixEx = (InfixExpression) expression; 147 | Expression leftOperand = infixEx.getLeftOperand(); 148 | Expression rightOperand = infixEx.getRightOperand(); 149 | Operator operator = infixEx.getOperator(); 150 | 151 | if (operator.equals(Operator.EQUALS) 152 | || operator.equals(Operator.NOT_EQUALS)) { 153 | if (leftOperand.getNodeType() == ASTNode.NULL_LITERAL 154 | || rightOperand.getNodeType() == ASTNode.NULL_LITERAL) { 155 | continue; 156 | } 157 | } 158 | 159 | } 160 | 161 | onlyNullChecks = false; 162 | } 163 | 164 | mar.setOnlyNullChecks(onlyNullChecks); 165 | } 166 | 167 | // define test priority 168 | if (numberOfIfStatements > 6) { 169 | mar.setTestPrio(Testprio.HIGH); 170 | } else if (numberOfIfStatements > 3) { 171 | mar.setTestPrio(Testprio.DEFAULT); 172 | } else if (numberOfIfStatements > 0) { 173 | mar.setTestPrio(Testprio.LOW); 174 | } else { 175 | mar.setTestPrio(null); 176 | } 177 | 178 | return mar; 179 | } 180 | 181 | private List collectIfStatements(MethodDeclaration md) { 182 | List ifStatements = new ArrayList(); 183 | 184 | Block body = md.getBody(); 185 | 186 | if (body == null) { 187 | return ifStatements; 188 | } 189 | 190 | for (Object statement : body.statements()) { 191 | if (statement instanceof Statement) { 192 | Statement st = (Statement) statement; 193 | ifStatements.addAll(collectIfStatements(st)); 194 | } 195 | } 196 | 197 | return ifStatements; 198 | } 199 | } 200 | --------------------------------------------------------------------------------