camel-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Willem Jiang (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CAMEL-8346) JsonPathEngine skips file encoding
Date Fri, 27 Feb 2015 08:27:05 GMT

    [ https://issues.apache.org/jira/browse/CAMEL-8346?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14339877#comment-14339877
] 

Willem Jiang commented on CAMEL-8346:
-------------------------------------

Hi Stefan,

I just tried to apply the patch, but the test of testPriceResultTypeOnGenericFileISO88591
is failed.
{code}
java.lang.AssertionError: Assertion error at index 0 on mock mock://title with predicate:
Simple: body == Joseph und seine Brüder evaluated as: Joseph und seine Br�der == Joseph
und seine Brüder on Exchange[Message: Joseph und seine Br�der]
	at org.apache.camel.util.PredicateAssertHelper.assertMatches(PredicateAssertHelper.java:43)
	at org.apache.camel.component.mock.AssertionClause.applyAssertionOn(AssertionClause.java:106)
	at org.apache.camel.component.mock.MockEndpoint$17.run(MockEndpoint.java:958)
	at org.apache.camel.component.mock.MockEndpoint.doAssertIsSatisfied(MockEndpoint.java:410)
	at org.apache.camel.component.mock.MockEndpoint.assertIsSatisfied(MockEndpoint.java:378)
	at org.apache.camel.component.mock.MockEndpoint.assertIsSatisfied(MockEndpoint.java:366)
	at org.apache.camel.component.mock.MockEndpoint.assertIsSatisfied(MockEndpoint.java:204)
	at org.apache.camel.test.junit4.CamelTestSupport.assertMockEndpointsSatisfied(CamelTestSupport.java:675)
	at org.apache.camel.jsonpath.JsonPathSourceTest.testPriceResultTypeOnGenericFileISO88591(JsonPathSourceTest.java:92)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:483)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
	at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
	at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
	at org.junit.rules.TestWatcher$1.evaluate(TestWatcher.java:55)
	at org.junit.rules.RunRules.evaluate(RunRules.java:20)
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
	at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)


{code}
Can you double check it in you system?

> JsonPathEngine skips file encoding
> ----------------------------------
>
>                 Key: CAMEL-8346
>                 URL: https://issues.apache.org/jira/browse/CAMEL-8346
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-jsonpath
>    Affects Versions: 2.14.1, 2.15.0
>            Reporter: Stefan Mandel
>             Fix For: 2.14.2, 2.15.0
>
>         Attachments: JsonPathSourceTest.java, germanbooks-iso-8859-1.json, germanbooks-utf8.json
>
>
> This occurs if one uses the camel file component with a charset parameter, e.g. file:/url?charset=UTF-8.
It leads to strange effects:
> # testing the same utf8-file under linux (default encoding:UTF-8) and german windows
(default encoding:windows-1252) leads to problems with german umlauts.
> # using a file in another encoding than the default (ISO-8859-1 on linux) leads also
to problems with german umlauts.
> - Both problems can be reproduced with the attached unit test files in 2.14.1.
> - Problem 1 is hidden in 2.15-SNAPSHOT, because UTF-8 is hard-coded as file encoding
(maybe ok, since JSON is almost never used with language specific encondings), Problem 2 also
occurs in 2.15-SNAPSHOT
> I can provide or help with a fix (or pull request), if these problems are classified
as true defects.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message