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 | ArrayListJava 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
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 Java class for TestBases complex type.
21 | *
22 | * The following schema fragment specifies the expected content contained within this class.
23 | *
24 | *
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
56 | * For example, to add a new item, do as follows:
57 | *
63 | * Objects of the following type(s) are allowed in the list
64 | * {@link Constructor }
65 | *
66 | *
67 | */
68 | public List 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 | * Java class for RepClass complex type.
23 | *
24 | * The following schema fragment specifies the expected content contained within this class.
25 | *
26 | *
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
62 | * For example, to add a new item, do as follows:
63 | *
69 | * Objects of the following type(s) are allowed in the list
70 | * {@link RepMethod }
71 | *
72 | *
73 | */
74 | public List Java class for RepPackage complex type.
23 | *
24 | * The following schema fragment specifies the expected content contained within this class.
25 | *
26 | *
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
62 | * For example, to add a new item, do as follows:
63 | *
69 | * Objects of the following type(s) are allowed in the list
70 | * {@link RepClass }
71 | *
72 | *
73 | */
74 | public List Java class for NewMethods complex type.
22 | *
23 | * The following schema fragment specifies the expected content contained within this class.
24 | *
25 | *
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
60 | * For example, to add a new item, do as follows:
61 | *
67 | * Objects of the following type(s) are allowed in the list
68 | * {@link String }
69 | *
70 | *
71 | */
72 | public List Java class for Precondition complex type.
23 | *
24 | * The following schema fragment specifies the expected content contained within this class.
25 | *
26 | *
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
62 | * For example, to add a new item, do as follows:
63 | *
69 | * Objects of the following type(s) are allowed in the list
70 | * {@link String }
71 | *
72 | *
73 | */
74 | public List Java class for Param complex type.
19 | *
20 | * The following schema fragment specifies the expected content contained within this class.
21 | *
22 | * Java class for Result complex type.
20 | *
21 | * The following schema fragment specifies the expected content contained within this class.
22 | *
23 | * Java class for Constructor complex type.
22 | *
23 | * The following schema fragment specifies the expected content contained within this class.
24 | *
25 | *
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
61 | * For example, to add a new item, do as follows:
62 | *
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
90 | * For example, to add a new item, do as follows:
91 | *
97 | * Objects of the following type(s) are allowed in the list
98 | * {@link TestBase }
99 | *
100 | *
101 | */
102 | public List 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 | *
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
63 | * For example, to add a new item, do as follows:
64 | *
70 | * Objects of the following type(s) are allowed in the list
71 | * {@link String }
72 | *
73 | *
74 | */
75 | public List Java class for RepMethod complex type.
20 | *
21 | * The following schema fragment specifies the expected content contained within this class.
22 | *
23 | * Java class for Assertion complex type.
20 | *
21 | * The following schema fragment specifies the expected content contained within this class.
22 | *
23 | * Java class for Settings complex type.
18 | *
19 | * The following schema fragment specifies the expected content contained within this class.
20 | *
21 | * Java class for anonymous complex type.
24 | *
25 | * The following schema fragment specifies the expected content contained within this class.
26 | *
27 | *
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
94 | * For example, to add a new item, do as follows:
95 | *
101 | * Objects of the following type(s) are allowed in the list
102 | * {@link NewMethods }
103 | *
104 | *
105 | */
106 | public List
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
123 | * For example, to add a new item, do as follows:
124 | *
130 | * Objects of the following type(s) are allowed in the list
131 | * {@link RepPackage }
132 | *
133 | *
134 | */
135 | public List Java class for Statistics complex type.
18 | *
19 | * The following schema fragment specifies the expected content contained within this class.
20 | *
21 | *
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 Listset method for the constructor property.
54 | *
55 | *
58 | * getConstructor().add(newItem);
59 | *
60 | *
61 | *
62 | *
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 |
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 Listset method for the methods property.
60 | *
61 | *
64 | * getMethods().add(newItem);
65 | *
66 | *
67 | *
68 | *
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 Listset method for the classes property.
60 | *
61 | *
64 | * getClasses().add(newItem);
65 | *
66 | *
67 | *
68 | *
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 Listset method for the fullQualifiedName property.
58 | *
59 | *
62 | * getFullQualifiedName().add(newItem);
63 | *
64 | *
65 | *
66 | *
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 Listset method for the condition property.
60 | *
61 | *
64 | * getCondition().add(newItem);
65 | *
66 | *
67 | *
68 | *
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 | *
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
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 Listset method for the param property.
59 | *
60 | *
63 | * getParam().add(newItem);
64 | *
65 | *
66 | *
67 | * set method for the testBase property.
88 | *
89 | *
92 | * getTestBase().add(newItem);
93 | *
94 | *
95 | *
96 | *
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 Listset method for the paramValue property.
61 | *
62 | *
65 | * getParamValue().add(newItem);
66 | *
67 | *
68 | *
69 | *
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 |
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 | *
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 | *
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 Listset method for the newMethods property.
92 | *
93 | *
96 | * getNewMethods().add(newItem);
97 | *
98 | *
99 | *
100 | * set method for the packages property.
121 | *
122 | *
125 | * getPackages().add(newItem);
126 | *
127 | *
128 | *
129 | *
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