@@ -137,7 +137,7 @@ class TestLoggerPluginSpec extends AbstractFunctionalSpec {
137
137
and :
138
138
lines. size() == 10
139
139
lines[0 ] == render(' ' )
140
- lines[1 ] == render(' [erase-ahead,bold]FirstTest[/]' )
140
+ lines[1 ] == render(' [erase-ahead,bold]com.adarshr.test. FirstTest[/]' )
141
141
lines[2 ] == render(' ' )
142
142
lines[3 ] == render(' [erase-ahead,bold] Test [bold-off]thisTestShouldBeSkipped()[yellow] SKIPPED[/]' )
143
143
lines[4 ] == render(' [erase-ahead,bold] Test [bold-off]this test should fail[red] FAILED[red]' )
@@ -162,16 +162,16 @@ class TestLoggerPluginSpec extends AbstractFunctionalSpec {
162
162
and :
163
163
lines. size() == 14
164
164
lines[0 ] == render(' ' )
165
- lines[1 ] == render(' [erase-ahead,bold]NestedTestsetOne [/]' )
165
+ lines[1 ] == render(' [erase-ahead,bold]com.adarshr.test.NestedTest$NestedTestsetThree [/]' )
166
166
lines[2 ] == render(' ' )
167
- lines[3 ] == render(' [erase-ahead,bold] Test [bold-off]secondTestOfNestedTestsetOne ()[green] PASSED[/]' )
168
- lines[4 ] == render(' [erase-ahead,bold] Test [bold-off]firstTestOfNestedTestsetOne()[green] PASSED[/] ' )
169
- lines[5 ] == render(' ' )
170
- lines[6 ] == render(' [erase-ahead,bold]NestedTestsetThree[/] ' )
171
- lines[7 ] == render(' ' )
172
- lines[8 ] == render(' [erase-ahead,bold] Test [bold-off]firstTestOfNestedTestsetThree ()[green] PASSED[/]' )
167
+ lines[3 ] == render(' [erase-ahead,bold] Test [bold-off]firstTestOfNestedTestsetThree ()[green] PASSED[/]' )
168
+ lines[4 ] == render(' ' )
169
+ lines[5 ] == render(' [erase-ahead,bold]com.adarshr.test.NestedTest$NestedTestsetTwo[/] ' )
170
+ lines[6 ] == render(' ' )
171
+ lines[7 ] == render(' [erase-ahead,bold] Test [bold-off]secondTestOfNestedTestsetTwo()[green] PASSED[/] ' )
172
+ lines[8 ] == render(' [erase-ahead,bold] Test [bold-off]firstTestOfNestedTestsetTwo ()[green] PASSED[/]' )
173
173
lines[9 ] == render(' ' )
174
- lines[10 ] == render(' [erase-ahead,bold]NestedTestsetTwo [/]' )
174
+ lines[10 ] == render(' [erase-ahead,bold]com.adarshr.test.NestedTest$NestedTestsetOne [/]' )
175
175
lines[11 ] == render(' ' )
176
176
lines[12 ] == render(' [erase-ahead,bold] Test [bold-off]secondTestOfNestedTestsetOne()[green] PASSED[/]' )
177
177
lines[13 ] == render(' [erase-ahead,bold] Test [bold-off]firstTestOfNestedTestsetOne()[green] PASSED[/]' )
@@ -187,6 +187,29 @@ class TestLoggerPluginSpec extends AbstractFunctionalSpec {
187
187
)
188
188
then :
189
189
def lines = getLoggerOutput(result. output). lines
190
+ and :
191
+ lines. size() == 8
192
+ lines[0 ] == render(' ' )
193
+ lines[1 ] == render(' [erase-ahead,bold]com.adarshr.test.DeepNestedTest$NestedTestsetLevelOne[/]' )
194
+ lines[2 ] == render(' ' )
195
+ lines[3 ] == render(' [erase-ahead,bold] Test [bold-off]nestedTestsetLevelOne()[green] PASSED[/]' )
196
+ lines[4 ] == render(' ' )
197
+ lines[5 ] == render(' [erase-ahead,bold]Nested test set level two[/]' )
198
+ lines[6 ] == render(' ' )
199
+ lines[7 ] == render(' [erase-ahead,bold] Test [bold-off]nestedTestsetLevelTwo()[green] PASSED[/]' )
200
+ and :
201
+ result. task(" :test" ). outcome == SUCCESS
202
+ }
203
+
204
+ def " log junit5 jupiter engine deep-nested tests when showSimpleNames is true" () {
205
+ when :
206
+ def result = run(
207
+ ' sample-junit5-jupiter-deep-nested-tests' ,
208
+ ' testlogger { showSimpleNames true }' ,
209
+ ' clean test'
210
+ )
211
+ then :
212
+ def lines = getLoggerOutput(result. output). lines
190
213
and :
191
214
lines. size() == 8
192
215
lines[0 ] == render(' ' )
@@ -226,6 +249,29 @@ class TestLoggerPluginSpec extends AbstractFunctionalSpec {
226
249
result. task(" :test" ). outcome == FAILED
227
250
}
228
251
252
+ def " log spock tests when showSimpleNames is true" () {
253
+ when :
254
+ def result = run(
255
+ ' single-spock-test' ,
256
+ '''
257
+ testlogger {
258
+ theme 'plain'
259
+ showSimpleNames true
260
+ }
261
+ ''' ,
262
+ ' clean test'
263
+ )
264
+ def lines = getLoggerOutput(result. output). lines
265
+ then :
266
+ lines. size() == 4
267
+ lines[0 ] == render(' ' )
268
+ lines[1 ] == render(' SingleSpec' )
269
+ lines[2 ] == render(' ' )
270
+ lines[3 ] == render(' Test this is a single test PASSED' )
271
+ and :
272
+ result. task(' :test' ). outcome == SUCCESS
273
+ }
274
+
229
275
def " do not print empty suites when filtering tests" () {
230
276
when :
231
277
def result = run(
0 commit comments