Note that there are some explanatory texts on larger screens.

plurals
  1. POJava Localized test fails on Jenkins
    primarykey
    data
    text
    <p>We are testing some features of our software, and some of them are working with a Locale. So, when we test in our machines, all tests runs, but in Jenkins some test using locale (java locale) fails.</p> <p>Here's an example:</p> <pre><code>@Test public void testCurrencyFormat_withCLPFormat_returnValidFormat() { BigDecimal amount = new BigDecimal("500456.789"); java.util.Currency currency = java.util.Currency .getInstance(chileLocale); Currency c = new Currency(currency); assertEquals("500.456,789", defaultCurrencyFormatter.format(c, amount, chileLocale)); } </code></pre> <p>Note that the locale it's setted for use the right locale for the test. Like i said, in my machine the test run without problems, but in jenkins it fails:</p> <pre><code>org.junit.ComparisonFailure: expected:&lt;500[.456,]789&gt; but was:&lt;500[,456.]789&gt; at org.junit.Assert.assertEquals(Assert.java:125) at org.junit.Assert.assertEquals(Assert.java:147) at cl.taisachile.antaios.domain.currency.CurrencyTest.testCurrencyFormat_withCLPFormat_returnValidFormat(CurrencyTest.java:93) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20) at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28) at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222) at org.junit.runners.ParentRunner.run(ParentRunner.java:300) at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:53) at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:123) at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:104) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:164) at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:110) at org.apache.maven.surefire.booter.SurefireStarter.invokeProvider(SurefireStarter.java:175) at org.apache.maven.surefire.booter.SurefireStarter.runSuitesInProcessWhenForked(SurefireStarter.java:107) at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:68) </code></pre> <p>EDIT:</p> <p>I manually run the test on the server. I installed jenkins using yum on CentOS, so, Jenkins has his own user. If i run the test using the default login user to the server, all run's ok. But, when i log in into the jenkins user, the test's fails. I think it's not jenkis or the code. But i don't see where is the difference. Any Help?</p> <p>Thanks in advance.</p> <p>EDIT 2: Just for the record: We changed the setup of the server and the errors disapear. We tested several configurations and couldn't determine why fails on centos/32bits. Thanks for all.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload