Closed GoogleCodeExporter closed 8 years ago
Thanks for reporting. This is happening due to a recent fix for Issue 191.
Looking into this.
Original comment by subwiz
on 4 Dec 2013 at 11:17
Fixed. Please verify (I don't have Windows)!
Original comment by subwiz
on 4 Dec 2013 at 11:52
Hi @subwiz still failing, but i dont think is a JSON stuff, because the test
fails with XML thing:
at org.junit.Assert.assertEquals(Assert.java:115)
at org.junit.Assert.assertEquals(Assert.java:144)
at org.wiztools.restclient.util.XMLIndentUtilTest.testGetIndentedNONE(XMLIndentUtilTest.java:53)
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:47)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:252)
at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141)
at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112)
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:189)
at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)
Same as before
What i dont like is this:
Running org.wiztools.restclient.util.XMLIndentUtilTest
Read 492 bytes from input_NONE.xml
Read 509 bytes from input_UTF.xml
Expected bytes: 509 content:
<?xml version="1.0" encoding="UTF-8"?>
<zp:webspace xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:zp="http://zp.mnet.de/types" xsi:schemaLocation="http://zp.mnet.de/types http://zp-rest-test.m-online.net/types/staticwebspace.xsd">
<quota unit="MB">10</quota>
<owner>71714</owner>
<ftpuser>someuser</ftpuser>
<ftppassword>somepassword</ftppassword>
<createdate>2012-04-19T11:15:43</createdate>
<url>someurl.com</url>
<webid>12892</webid>
</zp:webspace>
Is bytes: 498 content:
<?xml version="1.0" encoding="UTF-8"?>
<zp:webspace xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:zp="http://zp.mnet.de/types" xsi:schemaLocation="http://zp.mnet.de/types http://zp-rest-test.m-online.net/types/staticwebspace.xsd">
<quota unit="MB">10</quota>
<owner>71714</owner>
<ftpuser>someuser</ftpuser>
<ftppassword>somepassword</ftppassword>
<createdate>2012-04-19T11:15:43</createdate>
<url>someurl.com</url>
<webid>12892</webid>
</zp:webspace>
I just added the bytes thing. Using a text comparer tool says the those xml are
equal, but assert is failing, even equalsignorecase says are not equals and
there is some bytes of difference
Original comment by yera...@gmail.com
on 4 Dec 2013 at 12:31
Ah, ok! I will try to work on this later in the day.
Original comment by subwiz
on 4 Dec 2013 at 3:47
Original comment by subwiz
on 4 Dec 2013 at 3:47
Can you please verify with the latest checkin? I think this should fix it.
Original comment by subwiz
on 7 Dec 2013 at 1:54
Hi and thanks for your support
The problem is still present, as i mentioned earlier, is a problem with the end
of files, the file used in the test has a unix eol style.
but when pass the XMLIndentUtil.getIndented , as i'm on windows , uses the
windows eol style
So this is my solution for this problem:
assertEquals(expectedResult.replaceAll("\\r\\n?", "\n"),
result.replaceAll("\\r\\n?", "\n"));
Just normalized the eol to one style because when comparing strings the eol is
compared too.
Attached is a patch with my changes.
Now works, just failing the Mac OS X package creation on windows.
Regards
Original comment by yera...@gmail.com
on 9 Dec 2013 at 12:36
Attachments:
I added a patch inspired by your patch--please let me know if this works. The
only problem with your patch seemed to be defensive in nature, while I wanted
to fix the root cause.
Thanks for supporting the project.
Original comment by subwiz
on 11 Dec 2013 at 3:06
Marking as Fixed due to time lapse. Please reopen if not.
Original comment by subwiz
on 16 Dec 2013 at 7:21
Original issue reported on code.google.com by
yera...@gmail.com
on 2 Dec 2013 at 8:42Attachments: