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

do not explicitly set "en_US" locale in maven surefire tests #919

Closed
tofi86 opened this issue Nov 27, 2018 · 1 comment
Closed

do not explicitly set "en_US" locale in maven surefire tests #919

tofi86 opened this issue Nov 27, 2018 · 1 comment
Assignees
Labels
status: has PR The issue is being processed in a pull request type: maintenance The issue is related to a meta task (build system, dependency update, etc)
Milestone

Comments

@tofi86
Copy link
Collaborator

tofi86 commented Nov 27, 2018

From #916 (comment):

Currently the maven-surefire-plugin explicitly sets the locale in pom.xml:

<argLine>-Xmx1g -Duser.language=en -Duser.country=US</argLine>

However, now that we can define the locale with EPUBCheck 4.1 we should remove this, make it platform specific and set the locale explicitly in the tests where needed (Don't forget to reset to the system default after the test!)

Removing the -Duser.language=en -Duser.country=US results in the following errors on a german system:

Results :

Failed tests:
  OCFCheckerTest.testInvalidLoremBasic30:346 null
  OCFCheckerTest.testInvalidLoremBindings30:365 null
  OCFCheckerTest.testInvalidLoremForeign30:386 null
  OCFCheckerTest.testInvalidLoremRNG30:423 null
  UtilMessage_LocalizationTest.ensureDefault:23 Default constructor should use the (host) default locale. expected:<en> but was:<en_US>
  UtilMessage_LocalizationTest.ensureNullIsDefault:32 Null locale should use (host) default locale. expected:<en> but was:<en_US>
  api_Test.EpubCheck_InputStream_Test:76 Expected: ERROR: EPUB/lorem.opf(13,63): Spine item with non-standard media-type 'font/opentype' has no fallback. Actual: ERROR: EPUB/lorem.opf(13,63): Ein 'spine'-Eintrag mit MimeType 'font/opentype' ist nicht erlaubt und enthält auch kein Fallback. expected:<...B/lorem.opf(13,63): [Spine item with non-standard media-type 'font/opentype' has no f]allback.> but was:<...B/lorem.opf(13,63): [Ein 'spine'-Eintrag mit MimeType 'font/opentype' ist nicht erlaubt und enthält auch kein F]allback.>
  api_Test.EpubCheck_PrintWriter_Test:48 Expected: ERROR: EPUB/lorem.opf(13,63): Spine item with non-standard media-type 'font/opentype' has no fallback. Actual: ERROR: EPUB/lorem.opf(13,63): Ein 'spine'-Eintrag mit MimeType 'font/opentype' ist nicht erlaubt und enthält auch kein Fallback. expected:<...B/lorem.opf(13,63): [Spine item with non-standard media-type 'font/opentype' has no f]allback.> but was:<...B/lorem.opf(13,63): [Ein 'spine'-Eintrag mit MimeType 'font/opentype' ist nicht erlaubt und enthält auch kein F]allback.>

Tests run: 1027, Failures: 8, Errors: 0, Skipped: 1

So these are the tests which need to be fixed.

@tofi86 tofi86 added status: ready for implem The issue is ready to be implemented type: maintenance The issue is related to a meta task (build system, dependency update, etc) labels Nov 27, 2018
@rdeltour rdeltour self-assigned this Nov 27, 2018
@rdeltour rdeltour added this to the 4.1.1 milestone Nov 27, 2018
@rdeltour
Copy link
Member

However, now that we can define the locale with EPUBCheck 4.1 we should remove this, make it platform specific and set the locale explicitly in the tests where needed

I would rather use Locale#getDefault() (to get the previous locale to reset in a @before method) and Locale.#setDefault(Locale) (to set the locale used in the test in an @after method), rather than the new EPUBCheck API…

@rdeltour rdeltour added status: has PR The issue is being processed in a pull request and removed status: ready for implem The issue is ready to be implemented labels Dec 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: has PR The issue is being processed in a pull request type: maintenance The issue is related to a meta task (build system, dependency update, etc)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants