From 234e959c2a617593c7e4a710090d14aae7340348 Mon Sep 17 00:00:00 2001 From: Vladimir Sitnikov Date: Fri, 16 Jun 2023 09:35:37 +0300 Subject: [PATCH] test: skip executing HttpSamplerTest on filesystems that do not support unicode filenames --- .../jmeter/protocol/http/sampler/HttpSamplerTest.kt | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/protocol/http/src/test/kotlin/org/apache/jmeter/protocol/http/sampler/HttpSamplerTest.kt b/src/protocol/http/src/test/kotlin/org/apache/jmeter/protocol/http/sampler/HttpSamplerTest.kt index f5337637879..72b6eea1c7d 100644 --- a/src/protocol/http/src/test/kotlin/org/apache/jmeter/protocol/http/sampler/HttpSamplerTest.kt +++ b/src/protocol/http/src/test/kotlin/org/apache/jmeter/protocol/http/sampler/HttpSamplerTest.kt @@ -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 @@ -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) {