Commit c3df782
Convert tests to JUnit5
Because most all the tests remaining tests are in huge class hierarchy
under Test_org_eclipse_swt_widgets_Widget they all need changing
at once. The tests that are not under Test_org_eclipse_swt_widgets_Widget
are generally pretty small, so included here to fully remove JUnit4
dependency.
This means that junit-vintage-engine and org.junit removed from
Require-Bundle of the manifest.
Messages have been removed from assertions that didn't add value.
The order of parameters to assertEquals and others changed, and for most
of the calls I removed the message based on previous guidance. I
tried to leave in messages that were more useful for documenting or
diagnosing errors. But I removed messages that more or less repeated
as a string what the item being tested is.
A lot of things work quite differently in JUnit5. Here are some highlights
that have affected or benefited this change:
There is a better way of integrating screenshots into failed tests as
tests can be intercepted between the test completion and the `@AfterEach`
methods. Therefore we can take a screenshot prior to disposal, and
then let the tear down message cleanup in a less convoluted way. See
Test_org_eclipse_swt_widgets_Widget.afterTestExecutionCallback and
tearDown methods to see this in action.
The way to get a test name is quite different. Instead of a TestName
`@Rule` a `TestInfo` can be obtained. The name returned is not exactly
the same format, but where the name needed a specific format, I adjusted
the code appropriately. See Test_org_eclipse_swt_browser_Browser.testInfo
and Test_org_eclipse_swt_widgets_Widget.testInfo for a couple of use
cases.
Whole class parameterized tests don't really exist in a simple way in
JUnit5. As there was very little use of this, rather than having complicated
setup, I used sub-classes to provide the parameterization. See for
example Test_org_eclipse_swt_widgets_DateTime and its new subclasses.1 parent 12ac449 commit c3df782
File tree
84 files changed
+2290
-2334
lines changed- tests/org.eclipse.swt.tests
- JUnit Tests/org/eclipse/swt/tests
- graphics
- junit
- performance
- META-INF
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
84 files changed
+2290
-2334
lines changedLines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
| 17 | + | |
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| |||
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
23 | 24 | | |
24 | 25 | | |
25 | 26 | | |
Lines changed: 3 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
51 | | - | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
52 | 54 | | |
53 | 55 | | |
54 | 56 | | |
| |||
Lines changed: 12 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| |||
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
67 | | - | |
| 67 | + | |
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
71 | | - | |
72 | | - | |
| 71 | + | |
| 72 | + | |
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
| |||
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
82 | | - | |
83 | | - | |
| 82 | + | |
| 83 | + | |
84 | 84 | | |
85 | 85 | | |
86 | 86 | | |
87 | | - | |
88 | | - | |
| 87 | + | |
| 88 | + | |
89 | 89 | | |
90 | | - | |
| 90 | + | |
91 | 91 | | |
92 | 92 | | |
93 | 93 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
18 | 17 | | |
| 18 | + | |
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| |||
Lines changed: 13 additions & 17 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
| 17 | + | |
22 | 18 | | |
| 19 | + | |
| 20 | + | |
23 | 21 | | |
24 | 22 | | |
25 | 23 | | |
| |||
49 | 47 | | |
50 | 48 | | |
51 | 49 | | |
52 | | - | |
53 | 50 | | |
54 | 51 | | |
55 | 52 | | |
| |||
130 | 127 | | |
131 | 128 | | |
132 | 129 | | |
133 | | - | |
| 130 | + | |
134 | 131 | | |
135 | 132 | | |
136 | | - | |
| 133 | + | |
137 | 134 | | |
138 | 135 | | |
139 | 136 | | |
140 | 137 | | |
141 | 138 | | |
142 | | - | |
| 139 | + | |
143 | 140 | | |
144 | 141 | | |
145 | | - | |
| 142 | + | |
146 | 143 | | |
147 | 144 | | |
148 | 145 | | |
| |||
369 | 366 | | |
370 | 367 | | |
371 | 368 | | |
372 | | - | |
| 369 | + | |
373 | 370 | | |
374 | 371 | | |
375 | 372 | | |
| |||
478 | 475 | | |
479 | 476 | | |
480 | 477 | | |
481 | | - | |
| 478 | + | |
482 | 479 | | |
483 | 480 | | |
484 | 481 | | |
| |||
586 | 583 | | |
587 | 584 | | |
588 | 585 | | |
589 | | - | |
590 | | - | |
591 | | - | |
592 | | - | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
593 | 589 | | |
594 | 590 | | |
595 | | - | |
| 591 | + | |
596 | 592 | | |
597 | 593 | | |
598 | 594 | | |
| |||
0 commit comments