jmeter-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Felix Schumacher <felix.schumac...@internetallee.de>
Subject Re: Build error "unmappable character encoding for Japanese characters"
Date Fri, 31 May 2019 11:18:34 GMT

Am 31.05.19 um 12:36 schrieb Sanjay Chaurasia:
> Hi Team,
>
> I have added some JUnit test cases in TestHTTPArgument.java file to test some Japanese
characters. Below is the code snippet for same.
>
> @Test
>         public void testWithFix() throws Exception {
>             HTTPArgument arg;
>             //Passing real encoded value of 初期値大阪市 as %8F%89%8A%FA%92l%91%E5%8D%E3%8Es
and try to decode with Shift_JIS encoding
>             arg = new HTTPArgument("name.?", "%8F%89%8A%FA%92l%91%E5%8D%E3%8Es", true,
"Shift_JIS");
>             assertEquals("arg.getValue() should be equal to 初期値大阪市","初期値大阪市",
arg.getValue());
>         }
>
>
> When I run the test from the eclipse (right click on method name -> run as -> Junit
test), it is working fine but when I am trying to build the JMeter code using ant test, getting
error as  “ unmappable character encoding for Japanese characters”.

I get a different error:

     [java] 1)
testWithFix(org.apache.jmeter.protocol.http.util.TestHTTPArgument)
     [java] org.junit.ComparisonFailure: arg.getValue() should be equal
to 初期値大阪市 expected:<初期[値大阪市]> but was:<初期[�l大阪�s]>
     [java]     at org.junit.Assert.assertEquals(Assert.java:115)
     [java]     at
org.apache.jmeter.protocol.http.util.TestHTTPArgument.testWithFix(TestHTTPArgument.java:103)
     [java]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
Method)
     [java]     at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
     [java]     at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
     [java]     at java.lang.reflect.Method.invoke(Method.java:498)
     [java]     at
org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
     [java]     at
org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
     [java]     at
org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
     [java]     at
org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
     [java]     at
org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
     [java]     at
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
     [java]     at
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
     [java]     at
org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
     [java]     at
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
     [java]     at java.util.concurrent.FutureTask.run(FutureTask.java:266)
     [java]     at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
     [java]     at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
     [java]     at java.lang.Thread.run(Thread.java:748)
     [java]

When using eclipse together with ant, you have to use 'ant clean install
...' to remove the properties files from the classpath that eclipse
copied there. That should probably haven been taken care of by the
gradle conversion that Vladimir mentioned.

What is your intention for "withFix"? HTTPArgument stores the value as
is, if you pass "true" for the alreadyEncoded parameter.

Felix

>
> To resolve this issue I am reading Japanese characters from the property file and using
it in the test method testWithFix().
>
> Could you please confirm if it is good way to solve the issue, else suggest me any other
solution if any.
>
>
> Regards,
> Sanjay Chaurasia
>
>

Mime
View raw message