Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

InvalidConfigurationTest depends on system locale setting #8169

Closed
zerhacker opened this issue May 13, 2016 · 6 comments

Comments

Projects
None yet
4 participants
@zerhacker
Copy link
Contributor

commented May 13, 2016

The tests check the messages of the InvalidConfigurationExeptions thrown by the XmlConfigBuilder.
But these messages are often extracted from SAXParseExceptions which are localized.
So the maven build is platform dependend and fails.

@jerrinot jerrinot added this to the 3.7 milestone May 13, 2016

@zerhacker

This comment has been minimized.

Copy link
Contributor Author

commented May 13, 2016

There are several options to fix this:

  • The maven build can be configured to a fixed locale.
    -> Con: test executions in an ide may still fail.
  • The InvalidConfigurationTest can set the default locale in a @before setup() method.
    -> Con: This is not side effect free.
  • The tests could be changed. Relying on exception messages is in general a bad practice. (But its "only" test code.)
    -> Con: None. But more work.
@jerrinot

This comment has been minimized.

Copy link
Contributor

commented May 13, 2016

@bilalyasar: can you please have a look? thanks!

@bilalyasar

This comment has been minimized.

Copy link
Collaborator

commented May 13, 2016

can you run with -Djaxp.debug=1 parameter and post the logs? I want to reproduce this issue in my local.

@zerhacker

This comment has been minimized.

Copy link
Contributor Author

commented May 13, 2016

The build is running... Meanwhile: here is my mvn --version output:

Apache Maven 3.3.3 (7994120775791599e205a5524ec3e0dfe41d4a06; 2015-04-22T13:57:37+02:00)
Maven home: /usr/local/Cellar/maven/3.3.3/libexec
Java version: 1.8.0_65, vendor: Oracle Corporation
Java home: /Library/Java/JavaVirtualMachines/jdk1.8.0_65.jdk/Contents/Home/jre
Default locale: de_DE, platform encoding: UTF-8
OS name: "mac os x", version: "10.11.4", arch: "x86_64", family: "mac"

@zerhacker

This comment has been minimized.

Copy link
Contributor Author

commented May 13, 2016

Here is the maven build log file:
build.txt
There are other tests that fail caused by locale sensitivity.

@pveentjer

This comment has been minimized.

Copy link
Member

commented Jun 20, 2016

I'll fix it. Just remove the message content check; one should not assert on generated string messages.

@pveentjer pveentjer self-assigned this Jun 20, 2016

@jerrinot jerrinot assigned jerrinot and unassigned pveentjer Jul 25, 2016

jerrinot added a commit to jerrinot/hazelcast that referenced this issue Jul 25, 2016

Do not make assertions on message generated by JDK control.
Fix hazelcast#8169

Also added testWhenXmlValidAndPropertiesAreResolved()
to make sure the basic config skeleton is right.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.