You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@knox.apache.org by "pascal oliva (JIRA)" <ji...@apache.org> on 2014/10/01 14:51:33 UTC
[jira] [Updated] (KNOX-436) HaDescriptorManagerTest fail with IBM
JVM JAVA
[ https://issues.apache.org/jira/browse/KNOX-436?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
pascal oliva updated KNOX-436:
------------------------------
Fix Version/s: 0.6.0
Status: Patch Available (was: Open)
To compare the strings, I propose to use assertXMLEqual(xml, descriptorXml) from xmlunit tools instead of assertEquals(xml, descriptorXml).
> HaDescriptorManagerTest fail with IBM JVM JAVA
> ----------------------------------------------
>
> Key: KNOX-436
> URL: https://issues.apache.org/jira/browse/KNOX-436
> Project: Apache Knox
> Issue Type: Test
> Components: Server
> Affects Versions: 0.6.0
> Environment: ppc64 - RHEL 7 - Java version: 1.7.0, vendor: IBM Corporation
> Reporter: pascal oliva
> Fix For: 0.6.0
>
>
> With JVM IBM : HaDescriptorManagerTest failed :
> Tests run: 3, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.159 sec <<< FAILURE! - in org.apache.hadoop.gateway.ha.provider.impl.HaDescriptorManagerTest
> testDescriptorStoring(org.apache.hadoop.gateway.ha.provider.impl.HaDescriptorManagerTest) Time elapsed: 0.076 sec <<< FAILURE!
> org.junit.ComparisonFailure: expected:<...Sleep="8000"/>
> </ha>[
> ]> but was:<...Sleep="8000"/>
> </ha>[]>
> Test impacted : testDescriptorStoring
> ...
> HaDescriptorManager.store(descriptor, writer);
> String descriptorXml = writer.toString();
> ...
> by using JAVA JVM IBM there is no "\n" at the end of the xml string <descriptorXml>
> So,
> the test failed with assertEquals(xml, descriptorXml); due to "\n" into "...</ha>\n";
> String xml = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n" +
> "<ha>\n" +
> " <service enabled=\"false\" failoverSleep=\"1000\" maxFailoverAttempts=\"42\" maxRet:a!ryAttempts=\"3\" name=\"foo\" retrySleep=\"3000\"/>\n" +
> " <service enabled=\"true\" failoverSleep=\"5000\" maxFailoverAttempts=\"3\" maxRetryAttempts=\"5\" name=\"bar\" retrySleep=\"8000\"/>\n" +
> "</ha>\n";
> assertEquals(xml, descriptorXml);
>
> The test passed without "\n" at the end of the string (xml) used to compare the expected result:
> string xml = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n" +
> "<ha>\n" +
> " <service enabled=\"false\" failoverSleep=\"1000\" maxFailoverAttempts=\"42\" maxRet:a!ryAttempts=\"3\" name=\"foo\" retrySleep=\"3000\"/>\n" +
> " <service enabled=\"true\" failoverSleep=\"5000\" maxFailoverAttempts=\"3\" maxRetryAttempts=\"5\" name=\"bar\" retrySleep=\"8000\"/>\n" +
> "</ha>\;
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)