Skip to content

Conversation

@zhfeng
Copy link
Contributor

@zhfeng zhfeng commented Nov 29, 2024

Note that the main branch points at the latest stable Camel Quarkus release.
Pull requests should be generally send against the camel-quarkus-main branch pointing at the current Camel Quarkus SNAPSHOT.

@zhfeng zhfeng requested a review from aldettinger November 29, 2024 07:21
@aldettinger
Copy link
Contributor

Interesting, do we by any chance remind what kind of issue it generate when we don't force english locale please ?

@zhfeng
Copy link
Contributor Author

zhfeng commented Nov 29, 2024

Well, it's just failing with the test like

ERROR] Failures: 
[ERROR]   RouteTest.unstructuredFileTranscriptsAreTransformedToPojos:70 1 expectation failed.
JSON path pojos[0].customerBirthday doesn't match.
Expected: is "10 July 1986"
  Actual: 10 七月 1986

[INFO] 
[ERROR] Tests run: 1, Failures: 1, Errors: 0, Skipped: 0

@ppalaga
Copy link
Contributor

ppalaga commented Nov 29, 2024

@zhfeng sounds like it fails for you in JVM mode on a machine where the default locale is non-english, right? (I just wonder whether it has to do with some recent changes in GraalVM or whether it is an old issue that just popped up now?)

@aldettinger
Copy link
Contributor

It smells non localized String.format.

Could you please try to use the localized format override, ala String.format(Locale.US,... ? That way, it would give indication whether GraalVM recent changes are involved and it could also work outside of surefire.

@zhfeng
Copy link
Contributor Author

zhfeng commented Nov 29, 2024

Yeah, I will try String.format.

@zhfeng zhfeng force-pushed the fix_data_extract_lang branch from 3dc74ae to 7183d11 Compare November 29, 2024 09:54
@zhfeng
Copy link
Contributor Author

zhfeng commented Nov 29, 2024

@aldettinger @ppalaga OK, it works with using String.format(Locale.US, FORMAT, ...)

@zhfeng
Copy link
Contributor Author

zhfeng commented Nov 29, 2024

Hmm, but in native build, it is failing

[ERROR] Failures: 
[ERROR]   RouteIT>RouteTest.unstructuredFileTranscriptsAreTransformedToPojos:70 1 expectation failed.
JSON path pojos[0].customerBirthday doesn't match.
Expected: is "10 July 1986"
  Actual: 10 Jul 1986

[INFO] 
[ERROR] Tests run: 1, Failures: 1, Errors: 0, Skipped: 0

Is it related to GaalVM changes?

@ppalaga
Copy link
Contributor

ppalaga commented Nov 29, 2024

IIRC somebody mentioned some locale related changes in GraalVM on X. Not sure at all, what kind of they were...

@aldettinger
Copy link
Contributor

Aha, 2 problems are better than 1 :)

"Jul" it looks like, short month notation, strange.

Not sure, it's related but maybe it could be tried to play with quarkus native locale:
https://camel.apache.org/camel-quarkus/3.15.x/user-guide/native-mode.html#locale

@zhfeng
Copy link
Contributor Author

zhfeng commented Nov 29, 2024

Now the native test works with adding the following configurations:

quarkus.native.user-country=US
quarkus.native.user-language=en

@aldettinger
Copy link
Contributor

IMHO it seems fair enough to add those properties, anyone building with a non US default locale should have tests working. Otherwise we could try format the date independent of Locale, maybe ISO 8601.

@zhfeng zhfeng force-pushed the fix_data_extract_lang branch from 7183d11 to c4253ba Compare November 30, 2024 01:10
@ppalaga ppalaga merged commit eb3b796 into apache:camel-quarkus-main Nov 30, 2024
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants