You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "Daniel Kulp (JIRA)" <ji...@apache.org> on 2007/09/13 14:52:32 UTC

[jira] Created: (CXF-1000) Remove string compares of XML from unit tests

Remove string compares of XML from unit tests
---------------------------------------------

                 Key: CXF-1000
                 URL: https://issues.apache.org/jira/browse/CXF-1000
             Project: CXF
          Issue Type: Task
    Affects Versions: 2.0.1
            Reporter: Daniel Kulp



There are a lot of tests that are doing striaght string compares of XML results with files on the disk.   This makes it harder than necessary to update things when behavior changes.  (like different XML serialization routine used).

The tests should either normalize the XML and use a normalization compare routine, or preferably, use XPATHS to test specifically if the interested nodes and information that the test is actually testing is in the XML so the format of the XML is irrelevant.



-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CXF-1000) Remove string compares of XML from unit tests

Posted by "maomaode (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-1000?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12529428 ] 

maomaode commented on CXF-1000:
-------------------------------

Dan,

The ordering will not fail the tests, the assertWsdlEquals already take that into account, the only thing will fail the tests is the anonymous types v.s non anonymous types.

I agree with you though, we should use the xpath for the latter tests.

The reason I replace assertWsdlEquals with assertFileEquals is that i don't know how many xpath i'll need to write for the existing tests, as you saw, i didn't change any testing resources.

> Remove string compares of XML from unit tests
> ---------------------------------------------
>
>                 Key: CXF-1000
>                 URL: https://issues.apache.org/jira/browse/CXF-1000
>             Project: CXF
>          Issue Type: Task
>    Affects Versions: 2.0.1
>            Reporter: Daniel Kulp
>
> There are a lot of tests that are doing striaght string compares of XML results with files on the disk.   This makes it harder than necessary to update things when behavior changes.  (like different XML serialization routine used).
> The tests should either normalize the XML and use a normalization compare routine, or preferably, use XPATHS to test specifically if the interested nodes and information that the test is actually testing is in the XML so the format of the XML is irrelevant.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (CXF-1000) Remove string compares of XML from unit tests

Posted by "Daniel Kulp (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-1000?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Daniel Kulp updated CXF-1000:
-----------------------------

    Component/s: Build system

> Remove string compares of XML from unit tests
> ---------------------------------------------
>
>                 Key: CXF-1000
>                 URL: https://issues.apache.org/jira/browse/CXF-1000
>             Project: CXF
>          Issue Type: Task
>          Components: Build system
>    Affects Versions: 2.0.1
>            Reporter: Daniel Kulp
>
> There are a lot of tests that are doing striaght string compares of XML results with files on the disk.   This makes it harder than necessary to update things when behavior changes.  (like different XML serialization routine used).
> The tests should either normalize the XML and use a normalization compare routine, or preferably, use XPATHS to test specifically if the interested nodes and information that the test is actually testing is in the XML so the format of the XML is irrelevant.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CXF-1000) Remove string compares of XML from unit tests

Posted by "maomaode (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-1000?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12529409 ] 

maomaode commented on CXF-1000:
-------------------------------

I wrote couple asserts, assertXmlEquals(File f1, File f2), assertWsdlEquals(File f1, File f2), and it's Stax based, can filter(ignore) some attributes, tags. it's not fully featured, (e.g can not diff the anonymous type with non-anonymous type, which is same in semantics, but has different dom/tagTree represent). But should sufficient for the current use.

I have tested with the jaxb2.1 and jaxb2.0, and all test passed, I have updated all the tests under the javato module.

> Remove string compares of XML from unit tests
> ---------------------------------------------
>
>                 Key: CXF-1000
>                 URL: https://issues.apache.org/jira/browse/CXF-1000
>             Project: CXF
>          Issue Type: Task
>    Affects Versions: 2.0.1
>            Reporter: Daniel Kulp
>
> There are a lot of tests that are doing striaght string compares of XML results with files on the disk.   This makes it harder than necessary to update things when behavior changes.  (like different XML serialization routine used).
> The tests should either normalize the XML and use a normalization compare routine, or preferably, use XPATHS to test specifically if the interested nodes and information that the test is actually testing is in the XML so the format of the XML is irrelevant.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CXF-1000) Remove string compares of XML from unit tests

Posted by "Daniel Kulp (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-1000?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12529417 ] 

Daniel Kulp commented on CXF-1000:
----------------------------------


I still don't think we should be comparing entire WSDL documents for 95% of the cases.   It's too fragile and you end up testing things that that specific test shouldn't be.   A test that tests if a particular method is mapped correctly should use xpaths to make sure the operation is correctly found in the wsdl.   It should not compare the entire wsdl.   Tests that test fault mapping should XPath to make sure the faults are there.    etc..

For example, if I change the ordering of how the wsdl generator orders the messages or operations (the order right now seems awkward), tests like the the above should NOT fail.   The mapping is still correct.   It's just in a different place in the wsdl.    

Likewise, we don't have control over the internals of JAXB and XMLBeans and JIBX and such.   If they use HashMaps internally to hold data, when they write out schemas, it could completely depend on what order the JVM puts them in the HashMaps.   That's not good.



> Remove string compares of XML from unit tests
> ---------------------------------------------
>
>                 Key: CXF-1000
>                 URL: https://issues.apache.org/jira/browse/CXF-1000
>             Project: CXF
>          Issue Type: Task
>    Affects Versions: 2.0.1
>            Reporter: Daniel Kulp
>
> There are a lot of tests that are doing striaght string compares of XML results with files on the disk.   This makes it harder than necessary to update things when behavior changes.  (like different XML serialization routine used).
> The tests should either normalize the XML and use a normalization compare routine, or preferably, use XPATHS to test specifically if the interested nodes and information that the test is actually testing is in the XML so the format of the XML is irrelevant.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CXF-1000) Remove string compares of XML from unit tests

Posted by "maomaode (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-1000?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12527363 ] 

maomaode commented on CXF-1000:
-------------------------------

Yes, I'm working on migrate the jaxb version to 2.1, and it's really hard to pass the tests in string compares way.


I'm going to change all the tests in the tools package

> Remove string compares of XML from unit tests
> ---------------------------------------------
>
>                 Key: CXF-1000
>                 URL: https://issues.apache.org/jira/browse/CXF-1000
>             Project: CXF
>          Issue Type: Task
>    Affects Versions: 2.0.1
>            Reporter: Daniel Kulp
>
> There are a lot of tests that are doing striaght string compares of XML results with files on the disk.   This makes it harder than necessary to update things when behavior changes.  (like different XML serialization routine used).
> The tests should either normalize the XML and use a normalization compare routine, or preferably, use XPATHS to test specifically if the interested nodes and information that the test is actually testing is in the XML so the format of the XML is irrelevant.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CXF-1000) Remove string compares of XML from unit tests

Posted by "Daniel Kulp (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-1000?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12527459 ] 

Daniel Kulp commented on CXF-1000:
----------------------------------


One more note: this is also the reason why many of the tests fail with JDK 1.6. 

> Remove string compares of XML from unit tests
> ---------------------------------------------
>
>                 Key: CXF-1000
>                 URL: https://issues.apache.org/jira/browse/CXF-1000
>             Project: CXF
>          Issue Type: Task
>    Affects Versions: 2.0.1
>            Reporter: Daniel Kulp
>
> There are a lot of tests that are doing striaght string compares of XML results with files on the disk.   This makes it harder than necessary to update things when behavior changes.  (like different XML serialization routine used).
> The tests should either normalize the XML and use a normalization compare routine, or preferably, use XPATHS to test specifically if the interested nodes and information that the test is actually testing is in the XML so the format of the XML is irrelevant.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.