Skip to content

quickfix.DataDictionaryTest failed because maven language is not english #443

@thawk

Description

@thawk

Describe the bug

Though I set console language to en_US.UTF-8, maven use zh for unittest, so a unittest related to error message failed.

  • My locale is en_US.UTF-8:
    $ locale
    LANG="en_US.UTF-8"
    LC_COLLATE="en_US.UTF-8"
    LC_CTYPE="en_US.UTF-8"
    LC_MESSAGES="en_US.UTF-8"
    LC_MONETARY="en_US.UTF-8"
    LC_NUMERIC="en_US.UTF-8"
    LC_TIME="en_US.UTF-8"
    LC_ALL="en_US.UTF-8"
  • What the unittest used is zh:
    <testsuite xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://maven.apache.org/surefire/maven-surefire-plugin/xsd/surefire-test-report.xsd" name="quickfix.test.util.ExpectedTestFailureTest" time="0.002" tests="3" errors="0" skipped="0" failures="0">
      <properties>
        <property name="java.specification.version" value="14"/>
        <property name="sun.jnu.encoding" value="UTF-8"/>
    ...
        <property name="user.language" value="zh"/>
        <property name="java.specification.vendor" value="Oracle Corporation"/>
        <property name="java.version.date" value="2020-07-14"/>
  • The unittest is failed becuase the error message is using an incorrect language:
    -------------------------------------------------------------------------------
    Test set: quickfix.DataDictionaryTest
    -------------------------------------------------------------------------------
    Tests run: 65, Failures: 1, Errors: 1, Skipped: 0, Time elapsed: 8.906 s <<< FAILURE! - in quickfix.DataDictionaryTest
    shouldFailToLoadDictionaryWhenExternalDTDisDisabled(quickfix.DataDictionaryTest)  Time elapsed: 0.019 s  <<< FAILURE!
    org.junit.ComparisonFailure: expected:<[External DTD: Failed to read external DTD 'mathml.dtd', because 'http' access is not allowed due to restriction set by the accessExternalDTD property.]> but was:<[外部 DTD: 无法读取外部 DTD 'mathml.dtd', 因为 accessExternalDTD 属性设置的限制导致不允许 'http' 访问。]>
        at org.junit.Assert.assertEquals(Assert.java:117)
        at org.junit.Assert.assertEquals(Assert.java:146)
        at quickfix.DataDictionaryTest.shouldFailToLoadDictionaryWhenExternalDTDisDisabled(DataDictionaryTest.java:1412)
    

To Reproduce

  • Using a MacBook Pro with macOS Monterey, and the interface language is zh_CN
  • Run mvn package

Expected behavior
Pass all unittests.

system information:

  • OS: macOS Monterey 12.0.1
  • Java version OpenJDK 14.0.2
  • QFJ Version 2f4fda1

Additional context

$ mvn --version
Apache Maven 3.8.4 (9b656c72d54e5bacbed989b64718c159fe39b537)
Maven home: /usr/local/Cellar/maven/3.8.4/libexec
Java version: 14.0.2, vendor: Oracle Corporation, runtime: /Library/Java/JavaVirtualMachines/openjdk-14.0.2.jdk/Contents/Home
Default locale: zh_CN_#Hans, platform encoding: UTF-8
OS name: "mac os x", version: "10.16", arch: "x86_64", family: "mac"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions