You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jmeter.apache.org by vl...@apache.org on 2023/06/16 06:35:46 UTC

[jmeter] branch master updated: test: skip executing HttpSamplerTest on filesystems that do not support unicode filenames

This is an automated email from the ASF dual-hosted git repository.

vladimirsitnikov pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/jmeter.git


The following commit(s) were added to refs/heads/master by this push:
     new 234e959c2a test: skip executing HttpSamplerTest on filesystems that do not support unicode filenames
234e959c2a is described below

commit 234e959c2a617593c7e4a710090d14aae7340348
Author: Vladimir Sitnikov <si...@gmail.com>
AuthorDate: Fri Jun 16 09:35:37 2023 +0300

    test: skip executing HttpSamplerTest on filesystems that do not support unicode filenames
---
 .../apache/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 f533763787..72b6eea1c7 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) {