Skip to content

Commit d5c25f9

Browse files
ptzieglerlaeubi
authored andcommitted
Create an RCPTT test for the table-based DependencyEditor.
1 parent 9d4fefb commit d5c25f9

File tree

3 files changed

+381
-0
lines changed

3 files changed

+381
-0
lines changed
Lines changed: 296 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,296 @@
1+
--- RCPTT testcase ---
2+
Format-Version: 1.0
3+
Contexts: _mo5J8IfaEe2N1bfX2b9TRQ
4+
Element-Name: DependencyEditorTest
5+
Element-Type: testcase
6+
Element-Version: 3.0
7+
External-Reference:
8+
Id: _WA75MIfaEe2N1bfX2b9TRQ
9+
Runtime-Version: 2.5.4.202210020716
10+
Save-Time: 2/3/23, 7:35 PM
11+
Tags: org.eclipse.m2e.pde.ui
12+
Testcase-Type: ecl
13+
Verifications: _7el9kIfGEe2DibE_7T1Sqw
14+
15+
------=_.content-0a7243a0-75d3-3d5f-9791-539de0e5b7ac
16+
Content-Type: text/ecl
17+
Entry-Name: .content
18+
19+
with [get-view "Project Explorer" | get-tree] {
20+
select "target-platform" | double-click
21+
select "target-platform/target-platform.target" | double-click
22+
}
23+
24+
with [get-editor "target-platform.target" | get-section Locations | get-tree] {
25+
get-item -path "Maven Central.*" | click
26+
select "Maven Central.*" | double-click
27+
}
28+
29+
with [get-window "Maven Artifact Target Entry - Maven Central"] {
30+
// Check the initial button enablement. All buttons except Undo/Redo should be enabled.
31+
get-button Add | get-property enablement | equals true | verify-true
32+
get-button Remove | get-property enablement | equals true | verify-true
33+
get-button Update | get-property enablement | equals true | verify-true
34+
get-button Undo | get-property enablement | equals false | verify-true
35+
get-button Redo | get-property enablement | equals false | verify-true
36+
37+
// #################################################################### //
38+
// //
39+
// [I] Check behavior of the Add button with and without the clipboard //
40+
// //
41+
// #################################################################### //
42+
43+
to-clipboard -input ""
44+
45+
// Click add -> Create blank dependency
46+
get-button Add | click -metaKeys ""
47+
48+
// Invalid GAV -> Update & Finish button should be disabled
49+
get-button Update | get-property enablement | equals false | verify-true
50+
get-button Finish | get-property enablement | equals false | verify-true
51+
52+
// Check error messages
53+
get-editbox -after [get-label "Edit Maven Dependency"] | get-property text
54+
| equals "The target location contains one or more incomplete Maven dependencies.\n"
55+
+ " Each dependency requires a group id, artifact id, version and type." | verify-true
56+
57+
get-label "" -after [get-label "Edit Maven Dependency"]
58+
| get-property "image.path" | equals "org.eclipse.jface/icons/full/message_error.png" | verify-true
59+
60+
with [get-table | get-item -path "<required>"] {
61+
get-property "columns[0]" | equals "<required>" | verify-true
62+
get-property "columns[1]" | equals "<required>" | verify-true
63+
get-property "columns[2]" | equals "<required>" | verify-true
64+
}
65+
66+
// Fill the row with meaningful data...
67+
with [get-window "Maven Artifact Target Entry - Maven Central" | get-table] {
68+
get-property "getItems().TableItem[19].getData().getClassifier()" | equals "" | verify-true
69+
get-property "getItems().TableItem[19].getData().getType()" | equals jar | verify-true
70+
get-property "getItems().TableItem[19].getData().getVersion()" | equals "" | verify-true
71+
get-property "getItems().TableItem[19].getData().getGroupId()" | equals "" | verify-true
72+
get-property "getItems().TableItem[19].getData().getArtifactId()" | equals "" | verify-true
73+
// Check selection
74+
get-property "getSelectionCount()" | equals 1 | verify-true
75+
get-property "getSelection().TableItem[0].getData().getKey()" | equals "::jar:" | verify-true
76+
// Set GAV to org.apache.commons:commons-lang3:3.12.0
77+
select "<required>" | activate-cell-edit -type MouseClickSelection
78+
get-editbox | set-text "org.apache.commons"
79+
select "<required>" | apply-cell-edit -deactivate
80+
select "org.apache.commons" | activate-cell-edit -column 1 -type MouseClickSelection
81+
get-editbox | set-text "commons-lang3"
82+
select "org.apache.commons" | apply-cell-edit -deactivate
83+
select "org.apache.commons" | activate-cell-edit -column 2 -type MouseClickSelection
84+
get-editbox | set-text "3.12.0"
85+
apply-cell-edit -deactivate
86+
select "org.apache.commons" | activate-cell-edit -column 3 -type MouseClickSelection
87+
}
88+
89+
//Valid GAV -> Update & Finish button should now be enabled again
90+
get-button Update | get-property enablement | equals true | verify-true
91+
get-button Finish | get-property enablement | equals true | verify-true
92+
93+
to-clipboard -input "<dependency>\
94+
<groupId>org.eclipse.platform</groupId>\
95+
<artifactId>org.eclipse.core.runtime</artifactId>\
96+
<version>3.26.100</version>\
97+
</dependency>"
98+
99+
// Click add -> Copy dependency from clipboard
100+
get-button Add | click -metaKeys ""
101+
102+
with [get-window "Maven Artifact Target Entry - Maven Central" | get-table] {
103+
get-property "getItems().TableItem[20].getData().getClassifier()" | equals "" | verify-true
104+
get-property "getItems().TableItem[20].getData().getType()" | equals jar | verify-true
105+
get-property "getItems().TableItem[20].getData().getVersion()" | equals "3.26.100" | verify-true
106+
get-property "getItems().TableItem[20].getData().getGroupId()" | equals "org.eclipse.platform" | verify-true
107+
get-property "getItems().TableItem[20].getData().getArtifactId()" | equals "org.eclipse.core.runtime"
108+
| verify-true
109+
// Check selection
110+
get-property "getSelectionCount()" | equals 1 | verify-true
111+
get-property "getSelection().TableItem[0].getData().getKey()"
112+
| equals "org.eclipse.platform:org.eclipse.core.runtime:jar:3.26.100" | verify-true
113+
}
114+
115+
// Check whether you can edit the remaining columns directly. I.e. whether SWT.FULL_SELECTION is enabled.
116+
with [get-table] {
117+
select "org.eclipse.jdt" | activate-cell-edit -type MouseClickSelection
118+
get-editbox | set-text newGroupId
119+
select "org.apache.commons" | apply-cell-edit -deactivate
120+
select newGroupId | activate-cell-edit -column 1 -type MouseClickSelection
121+
get-editbox | set-text newArtifactId
122+
select "jakarta.xml.bind" | apply-cell-edit -deactivate
123+
select "jakarta.xml.bind" | activate-cell-edit -column 2 -type MouseClickSelection
124+
get-editbox | set-text newVersion
125+
apply-cell-edit -deactivate
126+
}
127+
128+
// ############################################################################# //
129+
// //
130+
// [II] Check behavior of the Update button with one more more selected elements //
131+
// //
132+
// ############################################################################# //
133+
134+
// Select org.jetbrains.kotlin:kotlin-stdlib-common -> Click Update
135+
with [get-table] {
136+
select "org.jetbrains.kotlin" | activate-cell-edit -type MouseClickSelection
137+
get-editbox | click-text 1 21
138+
cancel-cell-edit
139+
deactivate-cell-edit
140+
}
141+
142+
get-button Update | click -metaKeys ""
143+
144+
with [get-table] {
145+
get-property "getItems().TableItem[12].getData().getVersion()" | equals "1.7.22" | verify-false
146+
}
147+
148+
// Select org.jetbrains.kotlin:kotlin-stdlib-jdk7 to org.jetbrains.kotlin:kotlin-stdlib -> Click Update
149+
with [get-table] {
150+
select [get-item -path "org.jetbrains.kotlin" -index 1] | activate-cell-edit -type MouseClickSelection
151+
get-editbox | click-text 1 21
152+
cancel-cell-edit
153+
deactivate-cell-edit
154+
select [get-item -path "org.jetbrains.kotlin" -index 3] [get-item -path "org.jetbrains.kotlin"
155+
-index 2] [get-item -path "org.jetbrains.kotlin" -index 1]
156+
}
157+
158+
get-button Update | click -metaKeys ""
159+
160+
with [get-table] {
161+
get-property "getItems().TableItem[13].getData().getVersion()" | equals "1.7.22" | verify-false
162+
get-property "getItems().TableItem[14].getData().getVersion()" | equals "1.7.22" | verify-false
163+
get-property "getItems().TableItem[15].getData().getVersion()" | equals "1.7.22" | verify-false
164+
}
165+
166+
// ########################################################################## //
167+
// //
168+
// [III] Check behavior of the Remove button on one or more selected elements //
169+
// //
170+
// ########################################################################## //
171+
172+
// Selected and remove com.fasterxml.jackson.core:jackson-annotations to com.fasterxml.jackson.core:jackson-databind
173+
with [get-table] {
174+
select "com.fasterxml.jackson.core" | activate-cell-edit -type MouseClickSelection
175+
get-editbox | click-text 1 27
176+
cancel-cell-edit
177+
deactivate-cell-edit
178+
select [get-item -path "com.fasterxml.jackson.core" -index 2] [get-item -path "com.fasterxml.jackson.core"
179+
-index 1] "com.fasterxml.jackson.core"
180+
}
181+
182+
get-button Remove | click -metaKeys ""
183+
184+
// The selected elements should no longer be in the table, with com.github.ben-manes.caffeine:caffeine being the first element
185+
with [get-table] {
186+
get-property "getSelection().length" | equals 0
187+
get-property "getItemCount()" | equals 18 | verify-true
188+
get-property "getItems().TableItem[0].getText()" | equals "com.github.ben-manes.caffeine" | verify-true
189+
}
190+
191+
get-button Undo | click -metaKeys ""
192+
193+
// The artifacts com.fasterxml.jackson.core:jackson-annotations to com.fasterxml.jackson.core:jackson-databind are back and selected
194+
with [get-table] {
195+
get-property "getItemCount()" | equals 21 | verify-true
196+
get-property "getSelection().length" | equals 3 | verify-true
197+
get-property "getSelection().TableItem[0].getData().getKey()"
198+
| equals "com.fasterxml.jackson.core:jackson-annotations:jar:2.14.1" | verify-true
199+
get-property "getSelection().TableItem[1].getData().getKey()"
200+
| equals "com.fasterxml.jackson.core:jackson-core:jar:2.14.1" | verify-true
201+
get-property "getSelection().TableItem[2].getData().getKey()"
202+
| equals "com.fasterxml.jackson.core:jackson-databind:jar:2.14.1" | verify-true
203+
}
204+
205+
// Select and remove com.squareup.okio:okio-jvm
206+
with [get-table] {
207+
select "com.squareup.okio" | activate-cell-edit -type MouseClickSelection
208+
get-editbox | click-text 1 18
209+
cancel-cell-edit
210+
deactivate-cell-edit
211+
}
212+
213+
get-button Remove | click -metaKeys ""
214+
215+
// The artifact jakarta.activation:jakarta.activation-api should now be selected, because it now at the same position as the removed element
216+
with [get-table] {
217+
get-property "getSelection().length" | equals 1 | verify-true
218+
get-property "getSelection().TableItem[0].getData().getKey()"
219+
| equals "jakarta.activation:jakarta.activation-api:jar:1.2.2" | verify-true
220+
}
221+
222+
// ############################################ //
223+
// //
224+
// [IV] Check behavior when sorting by columns //
225+
// //
226+
// ############################################ //
227+
228+
with [get-table] {
229+
// Sort by Version -> jakarta.inject:jakarta.inject-api should be first element
230+
get-column-header Version | click
231+
get-property "getItems().TableItem[0].getData().getKey()" | equals "jakarta.inject:jakarta.inject-api:jar:1.0.5"
232+
| verify-true
233+
// Sort by Artifact Id -> com.github.ben-manes.caffeine:caffeine should be the first element
234+
get-column-header "Artifact Id" | click
235+
get-property "getItems().TableItem[0].getData().getKey()"
236+
| equals "com.github.ben-manes.caffeine:caffeine:jar:3.1.2" | verify-true
237+
// Sort by Group Id -> com.fasterxml.jackson.core:jackson-annotations should be the first element
238+
get-column-header "Group Id" | click
239+
get-property "getItems().TableItem[0].getData().getKey()"
240+
| equals "com.fasterxml.jackson.core:jackson-annotations:jar:2.14.1" | verify-true
241+
}
242+
243+
// Check whether dependencies are inserted into the correct position when the table is sorted
244+
to-clipboard -input "<dependency>\
245+
<groupId>com.fasterxml.jackson.core</groupId>\
246+
<artifactId>jackson-databind</artifactId>\
247+
<version>2.14.0</version>\
248+
</dependency>"
249+
250+
get-button Add | click -metaKeys ""
251+
252+
with [get-table] {
253+
get-property enablement | equals true | verify-true
254+
get-property "getItems().TableItem[2].getData().getKey()"
255+
| equals "com.fasterxml.jackson.core:jackson-databind:jar:2.14.0" | verify-true
256+
}
257+
258+
// ################################## //
259+
// //
260+
// [V] Check multi-selection behavior //
261+
// //
262+
// ################################## //
263+
264+
// Make sure items don't get lost when selecting more than one element
265+
with [get-table] {
266+
// Forward selection
267+
select "com.fasterxml.jackson.core" | activate-cell-edit -type MouseClickSelection
268+
get-editbox | click-text 1 27
269+
cancel-cell-edit
270+
deactivate-cell-edit
271+
select "com.github.ben-manes.caffeine" [get-item -path "com.fasterxml.jackson.core" -index 3] [get-item
272+
-path "com.fasterxml.jackson.core" -index 2] [get-item -path "com.fasterxml.jackson.core"
273+
-index 1] "com.fasterxml.jackson.core"
274+
275+
get-property "selection[0].path[0]" | equals "com.fasterxml.jackson.core" | verify-true
276+
get-property "selection[1].path[0]" | equals "com.fasterxml.jackson.core%1%" | verify-true
277+
get-property "selection[2].path[0]" | equals "com.fasterxml.jackson.core%2%" | verify-true
278+
get-property "selection[3].path[0]" | equals "com.fasterxml.jackson.core%3%" | verify-true
279+
get-property "selection[4].path[0]" | equals "com.github.ben-manes.caffeine" | verify-true
280+
281+
// Backward selection
282+
select [get-item -path "org.slf4j" -index 2] | activate-cell-edit -type MouseClickSelection
283+
get-editbox | click-text 1 10
284+
cancel-cell-edit
285+
deactivate-cell-edit
286+
select [get-item -path "org.slf4j" -index 2] [get-item -path "org.slf4j" -index 1] "org.slf4j" [get-item
287+
-path "org.jetbrains.kotlin" -index 3] [get-item -path "org.jetbrains.kotlin" -index 2]
288+
289+
get-property "selection[0].path[0]" | equals "org.jetbrains.kotlin%2%" | verify-true
290+
get-property "selection[1].path[0]" | equals "org.jetbrains.kotlin%3%" | verify-true
291+
get-property "selection[2].path[0]" | equals "org.slf4j" | verify-true
292+
get-property "selection[3].path[0]" | equals "org.slf4j%1%" | verify-true
293+
get-property "selection[4].path[0]" | equals "org.slf4j%2%" | verify-true
294+
}
295+
}
296+
------=_.content-0a7243a0-75d3-3d5f-9791-539de0e5b7ac--
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
--- RCPTT testcase ---
2+
Format-Version: 1.0
3+
Context-Type: org.eclipse.rcptt.ctx.workspace
4+
Element-Name: WorkspaceWithTargetPlatform
5+
Element-Type: context
6+
Element-Version: 2.0
7+
Id: _mo5J8IfaEe2N1bfX2b9TRQ
8+
Runtime-Version: 2.5.4.202210020716
9+
Save-Time: 12/30/22, 1:40 AM
10+
11+
------=_contents/target-platform/target-platform.target-39adf134-5244-371e-a7da-2823002f1d57
12+
Content-Type: q7/binary
13+
Entry-Name: contents/target-platform/target-platform.target
14+
15+
UEsDBBQACAgIAAAAIQAAAAAAAAAAAAAAAAAIAAkALmNvbnRlbnRVVAUAAQAAAADdl8+OmzAQxs+bp0Dc
16+
cUjYNjlAcmhVqYc9bfsAE3sgJsamtkmbt6+B/NnNSjXSiijdnGD4Bn+/kT1k0vWfSgR71IYrmYUzEocB
17+
SqoYl0UW/vzxLVqGgbEgGQglMQulCterSbquGV7SErLsohZ0gTaQUDllfxPVAmyudBWuJoH7pUJRsC7L
18+
rCYPrwIBl1Q0DL9ijZI5Ewd3ZbftkhLDt0+fqarRZCFVVc3FRfGsGk3b9XXjggI2KLLwCfYogy8orQYR
19+
BhU3xhE+geQ5GpuFBUrUYF2CPdR41DvLD71HdlqVY+v7OnroYn2w0Kqpv7OVs0VyMBa1qzApge6MkoQq
20+
jen0pLlkgbY8B2pd8CiNQEpl+1Kl0xfPL0nH+q/mZPZIZun0dH9RtDDuhTqddldn59Mr6zfA6aX/PwcD
21+
Cxsu2Z2wFNxumw3ZoIwqkGgIhTxHLn04F9k/MRIyI/PxKcyvBjQ2NVG7rbV14jHfqzzWXfljEt/UO1de
22+
41xF5b7yVn0+tvMSds4CEGeB77su493/1wkR1NwD4jbP2Nvn7OvcLoeCnBMGgSTk021AuCyR2oEQvXgQ
23+
QHwrgN+GaDPQf6cdYN+1U/L5Nvbb70Lf4AcRnOSDIBKSjAuhdEGQCl4bJCXz7aIr9asz5CGZk0U8cotq
24+
3ZVoNxq4NGSnrOC+s92LImOZ4Bv3l6OqvCgzsiDzkXvUu0lKtlt8EI7lB+C4EwQj8sfS16aoiJQzEh3F
25+
nmMdj91lh/ruNIN66p1ZNryqhX/SeZ/rq1g/lfbB0zh9HLenL+Zt99JuJl/9BVBLBwjVgN3qVwIAAPYP
26+
AABQSwECFAAUAAgICAAAACEA1YDd6lcCAAD2DwAACAAJAAAAAAAAAAAAAAAAAAAALmNvbnRlbnRVVAUA
27+
AQAAAABQSwUGAAAAAAEAAQA/AAAAlgIAAAAA
28+
------=_contents/target-platform/target-platform.target-39adf134-5244-371e-a7da-2823002f1d57--
29+
------=_contents/target-platform/.project-faabef30-8b6b-367d-9526-544b3980ac44
30+
Content-Type: q7/binary
31+
Entry-Name: contents/target-platform/.project
32+
33+
UEsDBBQACAgIAAAAIQAAAAAAAAAAAAAAAAAIAAkALmNvbnRlbnRVVAUAAQAAAABVjsEOwiAQRM/2Kxru
34+
Fb15oPRi+gPqByBdGwwsZNkaP1+s2tjbm5mdzajuGXz9AMouYiv2252oAW0cHI6tuJz75iA6XalE8Q6W
35+
j5AtucTlWFcbhSaAZkMjcJO84VukoOTsltTGEABZK/mjYn4f5TfLf3GdnB9OCeycrBQangg+lYWX9mrT
36+
C1BLBwhlg0YFhgAAANAAAABQSwECFAAUAAgICAAAACEAZYNGBYYAAADQAAAACAAJAAAAAAAAAAAAAAAA
37+
AAAALmNvbnRlbnRVVAUAAQAAAABQSwUGAAAAAAEAAQA/AAAAxQAAAAAA
38+
------=_contents/target-platform/.project-faabef30-8b6b-367d-9526-544b3980ac44--
39+
------=_contents/target-platform/.settings/org.eclipse.core.resources.prefs-423fdf98-40c5-315c-9909-2031eed35758
40+
Content-Type: q7/binary
41+
Entry-Name: contents/target-platform/.settings/org.eclipse.core.resources.prefs
42+
43+
UEsDBBQACAgIAAAAIQAAAAAAAAAAAAAAAAAIAAkALmNvbnRlbnRVVAUAAQAAAABLTc7JLChO1SsoSk1L
44+
LUrNS04t1itLLSrOzM+zNeQC8vNTMvPS9W0KivKzUpNL7GxDQ9x0LbgAUEsHCA3o3k03AAAANwAAAFBL
45+
AQIUABQACAgIAAAAIQAN6N5NNwAAADcAAAAIAAkAAAAAAAAAAAAAAAAAAAAuY29udGVudFVUBQABAAAA
46+
AFBLBQYAAAAAAQABAD8AAAB2AAAAAAA=
47+
------=_contents/target-platform/.settings/org.eclipse.core.resources.prefs-423fdf98-40c5-315c-9909-2031eed35758--
48+
------=_.q7.content-3d2e0690-ce48-3609-83e0-c704d49f1eaf
49+
Content-Type: q7/binary
50+
Entry-Name: .q7.content
51+
52+
UEsDBBQACAgIAAAAIQAAAAAAAAAAAAAAAAAIAAkALmNvbnRlbnRVVAUAAQAAAACVkV1rgzAUhu/7K0Lu
53+
m6zCoBO1F2MXHWxso9DeDRtPbDZNJDmd/vxFa0RKYewuH895Tt6TZNPVFfkB65TRKV2xO0pAC1MoXab0
54+
jHK5pptskRhbMhCVahwwKxpEJrBjrbHfrskFxPuwejQaoUPS1SqetFGv9Y20i/15Sk+ITcx527bM1CXz
55+
cn542Qbkj15TeWD68oHjnuMTR4nOa09PT9srPO1yWwK+VTlKY2tKVJHSz9rcP6+3Mn+C6HV1lIfo+LD7
56+
eKfZgpBE9Hk09mu/a6z5AoFuVONgWzZBd6E8J1UFAWJjEeU3r68c7LKfw6Yq/CCDzQGi/xw3Nbvyzacn
57+
jPUjBGfOVoDzDwHpZmY+qsdwPKQbgvMpecL/+/vZ4hdQSwcIDa6p8x0BAABYAgAAUEsBAhQAFAAICAgA
58+
AAAhAA2uqfMdAQAAWAIAAAgACQAAAAAAAAAAAAAAAAAAAC5jb250ZW50VVQFAAEAAAAAUEsFBgAAAAAB
59+
AAEAPwAAAFwBAAAAAA==
60+
------=_.q7.content-3d2e0690-ce48-3609-83e0-c704d49f1eaf--
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
--- RCPTT verification ---
2+
Format-Version: 1.0
3+
Element-Name: Empty Log Verification
4+
Element-Type: verification
5+
Element-Version: 2.0
6+
Id: _7el9kIfGEe2DibE_7T1Sqw
7+
Runtime-Version: 2.5.4.202210020716
8+
Save-Time: 12/29/22, 11:33 PM
9+
Verification-Type: org.eclipse.rcptt.verifications.log
10+
11+
------=_.description-216f885c-d591-38ce-8ea2-e4f8cb4d6ffa
12+
Content-Type: text/plain
13+
Entry-Name: .description
14+
15+
Validates that no error has been thrown during the test execution.
16+
------=_.description-216f885c-d591-38ce-8ea2-e4f8cb4d6ffa--
17+
------=_.errorlog.verification-3ceb5b18-8b7c-3939-9191-416e6e78eb57
18+
Content-Type: text/errorlog-verification
19+
Entry-Name: .errorlog.verification
20+
21+
INCLUDE CONTEXTS: true
22+
DENIED:
23+
4 0 .* Message:.*
24+
25+
------=_.errorlog.verification-3ceb5b18-8b7c-3939-9191-416e6e78eb57--

0 commit comments

Comments
 (0)