You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@santuario.apache.org by "Eric Johnson (Created) (JIRA)" <ji...@apache.org> on 2011/10/31 13:39:32 UTC

[jira] [Created] (SANTUARIO-286) Test case Santuario273.testC14n11Base() tests for a side-effect of canonicalization, rather than the desired effect

Test case Santuario273.testC14n11Base() tests for a side-effect of canonicalization, rather than the desired effect
-------------------------------------------------------------------------------------------------------------------

                 Key: SANTUARIO-286
                 URL: https://issues.apache.org/jira/browse/SANTUARIO-286
             Project: Santuario
          Issue Type: Bug
          Components: Java
    Affects Versions: Java 1.4.6
            Reporter: Eric Johnson
            Assignee: Colm O hEigeartaigh
            Priority: Minor


This test case, added in the 1.4.6 release, does the following:

        NamedNodeMap attributes = signedInfo.getAttributes();
        boolean foundBase = false;
        for (int i = 0; i < attributes.getLength(); i++) {
            Node attribute = attributes.item(i);
            if ("base".equals(attribute.getLocalName())
                && "http://www.acme.com/resources/subresources/".equals(attribute.getNodeValue())) {
                foundBase = true;
                break;
            }
        }
        if (!foundBase) {
            fail("The base attribute was not found or was incorrect");
        }

However, if you inspect the above, you'll notice that what it is doing is verifying a change to the *input* document, rather than verifying that the output is correct.

I ran across this issue when porting the Santuario library to use the GenXDM library, and the ported version of the c14n code does not modify the input document, which means that this test fails after the port.

I could change my port of the library to actually modify the original document - as an optional feature - but that seems like an anti-feature, rather than a benefit, so I'm requesting that the test case itself be updated.

Patch to follow.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Closed] (SANTUARIO-286) Test case Santuario273.testC14n11Base() tests for a side-effect of canonicalization, rather than the desired effect

Posted by "Colm O hEigeartaigh (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SANTUARIO-286?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Colm O hEigeartaigh closed SANTUARIO-286.
-----------------------------------------

    
> Test case Santuario273.testC14n11Base() tests for a side-effect of canonicalization, rather than the desired effect
> -------------------------------------------------------------------------------------------------------------------
>
>                 Key: SANTUARIO-286
>                 URL: https://issues.apache.org/jira/browse/SANTUARIO-286
>             Project: Santuario
>          Issue Type: Bug
>          Components: Java
>    Affects Versions: Java 1.4.6
>            Reporter: Eric Johnson
>            Assignee: Colm O hEigeartaigh
>            Priority: Minor
>             Fix For: Java 1.4.7
>
>         Attachments: santuario286.patch
>
>
> This test case, added in the 1.4.6 release, does the following:
>         NamedNodeMap attributes = signedInfo.getAttributes();
>         boolean foundBase = false;
>         for (int i = 0; i < attributes.getLength(); i++) {
>             Node attribute = attributes.item(i);
>             if ("base".equals(attribute.getLocalName())
>                 && "http://www.acme.com/resources/subresources/".equals(attribute.getNodeValue())) {
>                 foundBase = true;
>                 break;
>             }
>         }
>         if (!foundBase) {
>             fail("The base attribute was not found or was incorrect");
>         }
> However, if you inspect the above, you'll notice that what it is doing is verifying a change to the *input* document, rather than verifying that the output is correct.
> I ran across this issue when porting the Santuario library to use the GenXDM library, and the ported version of the c14n code does not modify the input document, which means that this test fails after the port.
> I could change my port of the library to actually modify the original document - as an optional feature - but that seems like an anti-feature, rather than a benefit, so I'm requesting that the test case itself be updated.
> Patch to follow.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (SANTUARIO-286) Test case Santuario273.testC14n11Base() tests for a side-effect of canonicalization, rather than the desired effect

Posted by "Eric Johnson (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SANTUARIO-286?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Eric Johnson updated SANTUARIO-286:
-----------------------------------

    Attachment: santuario286.patch

Patch to the existing test case to have it check results, instead of side-effect.
                
> Test case Santuario273.testC14n11Base() tests for a side-effect of canonicalization, rather than the desired effect
> -------------------------------------------------------------------------------------------------------------------
>
>                 Key: SANTUARIO-286
>                 URL: https://issues.apache.org/jira/browse/SANTUARIO-286
>             Project: Santuario
>          Issue Type: Bug
>          Components: Java
>    Affects Versions: Java 1.4.6
>            Reporter: Eric Johnson
>            Assignee: Colm O hEigeartaigh
>            Priority: Minor
>         Attachments: santuario286.patch
>
>
> This test case, added in the 1.4.6 release, does the following:
>         NamedNodeMap attributes = signedInfo.getAttributes();
>         boolean foundBase = false;
>         for (int i = 0; i < attributes.getLength(); i++) {
>             Node attribute = attributes.item(i);
>             if ("base".equals(attribute.getLocalName())
>                 && "http://www.acme.com/resources/subresources/".equals(attribute.getNodeValue())) {
>                 foundBase = true;
>                 break;
>             }
>         }
>         if (!foundBase) {
>             fail("The base attribute was not found or was incorrect");
>         }
> However, if you inspect the above, you'll notice that what it is doing is verifying a change to the *input* document, rather than verifying that the output is correct.
> I ran across this issue when porting the Santuario library to use the GenXDM library, and the ported version of the c14n code does not modify the input document, which means that this test fails after the port.
> I could change my port of the library to actually modify the original document - as an optional feature - but that seems like an anti-feature, rather than a benefit, so I'm requesting that the test case itself be updated.
> Patch to follow.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (SANTUARIO-286) Test case Santuario273.testC14n11Base() tests for a side-effect of canonicalization, rather than the desired effect

Posted by "Colm O hEigeartaigh (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SANTUARIO-286?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Colm O hEigeartaigh updated SANTUARIO-286:
------------------------------------------

    Fix Version/s: Java 1.4.7
    
> Test case Santuario273.testC14n11Base() tests for a side-effect of canonicalization, rather than the desired effect
> -------------------------------------------------------------------------------------------------------------------
>
>                 Key: SANTUARIO-286
>                 URL: https://issues.apache.org/jira/browse/SANTUARIO-286
>             Project: Santuario
>          Issue Type: Bug
>          Components: Java
>    Affects Versions: Java 1.4.6
>            Reporter: Eric Johnson
>            Assignee: Colm O hEigeartaigh
>            Priority: Minor
>             Fix For: Java 1.4.7
>
>         Attachments: santuario286.patch
>
>
> This test case, added in the 1.4.6 release, does the following:
>         NamedNodeMap attributes = signedInfo.getAttributes();
>         boolean foundBase = false;
>         for (int i = 0; i < attributes.getLength(); i++) {
>             Node attribute = attributes.item(i);
>             if ("base".equals(attribute.getLocalName())
>                 && "http://www.acme.com/resources/subresources/".equals(attribute.getNodeValue())) {
>                 foundBase = true;
>                 break;
>             }
>         }
>         if (!foundBase) {
>             fail("The base attribute was not found or was incorrect");
>         }
> However, if you inspect the above, you'll notice that what it is doing is verifying a change to the *input* document, rather than verifying that the output is correct.
> I ran across this issue when porting the Santuario library to use the GenXDM library, and the ported version of the c14n code does not modify the input document, which means that this test fails after the port.
> I could change my port of the library to actually modify the original document - as an optional feature - but that seems like an anti-feature, rather than a benefit, so I'm requesting that the test case itself be updated.
> Patch to follow.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Resolved] (SANTUARIO-286) Test case Santuario273.testC14n11Base() tests for a side-effect of canonicalization, rather than the desired effect

Posted by "Colm O hEigeartaigh (Resolved) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SANTUARIO-286?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Colm O hEigeartaigh resolved SANTUARIO-286.
-------------------------------------------

    Resolution: Fixed


Applied patch, thanks.

Colm.
                
> Test case Santuario273.testC14n11Base() tests for a side-effect of canonicalization, rather than the desired effect
> -------------------------------------------------------------------------------------------------------------------
>
>                 Key: SANTUARIO-286
>                 URL: https://issues.apache.org/jira/browse/SANTUARIO-286
>             Project: Santuario
>          Issue Type: Bug
>          Components: Java
>    Affects Versions: Java 1.4.6
>            Reporter: Eric Johnson
>            Assignee: Colm O hEigeartaigh
>            Priority: Minor
>             Fix For: Java 1.4.7
>
>         Attachments: santuario286.patch
>
>
> This test case, added in the 1.4.6 release, does the following:
>         NamedNodeMap attributes = signedInfo.getAttributes();
>         boolean foundBase = false;
>         for (int i = 0; i < attributes.getLength(); i++) {
>             Node attribute = attributes.item(i);
>             if ("base".equals(attribute.getLocalName())
>                 && "http://www.acme.com/resources/subresources/".equals(attribute.getNodeValue())) {
>                 foundBase = true;
>                 break;
>             }
>         }
>         if (!foundBase) {
>             fail("The base attribute was not found or was incorrect");
>         }
> However, if you inspect the above, you'll notice that what it is doing is verifying a change to the *input* document, rather than verifying that the output is correct.
> I ran across this issue when porting the Santuario library to use the GenXDM library, and the ported version of the c14n code does not modify the input document, which means that this test fails after the port.
> I could change my port of the library to actually modify the original document - as an optional feature - but that seems like an anti-feature, rather than a benefit, so I'm requesting that the test case itself be updated.
> Patch to follow.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira