fix: trim whitespace when parsing numeric properties #2760
Annotations
7 errors and 1 warning
Test:
src/core/src/test/kotlin/org/apache/jmeter/threads/ThreadGroupTest.kt#L32
Replace 6 lines 32..44 with
val events = executePlanAndCollectEvents(
10.seconds,
fun TreeBuilder.() {
ThreadGroup::class {
props {
it[numThreads] = "1 "
|
Test:
src/core/src/test/kotlin/org/apache/jmeter/threads/ThreadGroupTest.kt#L46
Replace 10 lines 46..46 with
rampUp = 0
scheduler = true
delay = 0
duration = 1
setSamplerController(
LoopController().apply {
loops = 1
setContinueForever(false)
}
)
|
Test:
src/core/src/test/kotlin/org/apache/jmeter/threads/ThreadGroupTest.kt#L48
Replace 3 lines 48..49 with
ThreadSleep::class {
duration = 0.seconds
}
|
Test:
src/core/src/test/kotlin/org/apache/jmeter/threads/ThreadGroupTest.kt#L52
Replace 1 line 52..52 with
)
|
Test:
src/core/src/test/kotlin/org/apache/jmeter/threads/ThreadGroupTest.kt#L58
Remove 1 line: 58..58
|
Test:
task ':src:core:autostyleKotlinCheck'#L1
Execution failed for task ':src:core:autostyleKotlinCheck':
See 'What went wrong' below
|
Test
Execution failed for task ':src:core:autostyleKotlinCheck'.
> The following files have format violations:
src/test/kotlin/org/apache/jmeter/threads/ThreadGroupTest.kt
@@ -29,31 +29,33 @@
class ThreadGroupTest : JMeterTestCase() {
@test
fun `threadNum with trailing whitespace`() {
-········val·events·=·executePlanAndCollectEvents(10.seconds,·fun·TreeBuilder.()·{␊
-············ThreadGroup::class·{␊
-················props·{␊
-····················it[numThreads]·=·"1·"␊
-················}␊
-················rampUp·=·0␊
-················scheduler·=·true␊
-················delay·=·0␊
-················duration·=·1␊
-················setSamplerController(␊
-····················LoopController().apply·{␊
-························loops·=·1␊
-························setContinueForever(false)␊
+········val·events·=·executePlanAndCollectEvents(␊
+············10.seconds,␊
+············fun·TreeBuilder.()·{␊
+················ThreadGroup::class·{␊
+····················props·{␊
+························it[numThreads]·=·"1·"␊
}
-················)␊
+····················rampUp·=·0␊
+····················scheduler·=·true␊
+····················delay·=·0␊
+····················duration·=·1␊
+····················setSamplerController(␊
+························LoopController().apply·{␊
+····························loops·=·1␊
+····························setContinueForever(false)␊
+························}␊
+····················)␊
-················ThreadSleep::class·{␊
-····················duration·=·0.seconds␊
+····················ThreadSleep::class·{␊
+························duration·=·0.seconds␊
+····················}␊
}
}
-········})␊
+········)␊
assertEquals(1, events.size) {
"ThreadGroup.threadNum has trailing whitespace, it should be trimmed, so one event should be generated. " +
"Actual events are $events"
}
... (3 more lines that didn't fit)
You might want to adjust -PmaxCheckMessageLines=50
-PmaxFilesToList=10
-PminLinesPerFile=4
to see more violations
Run './gradlew autostyleApply' to fix the violations.
|
Node.js 16 actions are deprecated. Please update the following actions to use Node.js 20: burrunan/gradle-cache-action@v1. For more information see: https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/.
|
Loading