Skip to content

Commit

Permalink
test: skip executing HttpSamplerTest on filesystems that do not suppo…
Browse files Browse the repository at this point in the history
…rt unicode filenames
  • Loading branch information
vlsi committed Jun 16, 2023
1 parent 049697b commit 234e959
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,11 @@ import org.apache.jmeter.junit.JMeterTestCase
import org.apache.jmeter.protocol.http.util.HTTPFileArg
import org.apache.jmeter.test.assertions.executePlanAndCollectEvents
import org.apache.jmeter.threads.ThreadGroup
import org.junit.jupiter.api.Assumptions.assumeTrue
import org.junit.jupiter.api.io.TempDir
import org.junit.jupiter.params.ParameterizedTest
import org.junit.jupiter.params.provider.ValueSource
import java.nio.file.InvalidPathException
import java.nio.file.Path
import kotlin.io.path.absolutePathString
import kotlin.io.path.writeText
Expand All @@ -57,7 +59,14 @@ class HttpSamplerTest : JMeterTestCase() {

// Quote is invalid character for a filename in Windows, so we do not test it here
// See ConversionUtilsTest for escaping quotes.
val testFile = dir.resolve("testfile привет %.txt")
val testFile = try {
dir.resolve("testfile привет %.txt")
} catch (e: InvalidPathException) {
assumeTrue(false) {
"Skipping the test as the filesystem does not suppport unicode filenames"
}
TODO("This is never reached as the assumption above throws error")
}
testFile.writeText("hello, привет")

executePlanAndCollectEvents(10.seconds) {
Expand Down

0 comments on commit 234e959

Please sign in to comment.