cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jo...@apache.org
Subject svn commit: r597535 - in /cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src: main/java/org/apache/cocoon/forms/datatype/FlowJXPathSelectionList.java test/java/org/apache/cocoon/forms/datatype/FlowJXPathSelectionListTestCase.java
Date Fri, 23 Nov 2007 03:49:59 GMT
Author: joerg
Date: Thu Nov 22 19:49:58 2007
New Revision: 597535

URL: http://svn.apache.org/viewvc?rev=597535&view=rev
Log:
Fix FlowJXPathSelectionList test-case in a different way:
Since it was the test case that's broken, not our code, fix the issue in the test case.

Modified:
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/datatype/FlowJXPathSelectionList.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/test/java/org/apache/cocoon/forms/datatype/FlowJXPathSelectionListTestCase.java

Modified: cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/datatype/FlowJXPathSelectionList.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/datatype/FlowJXPathSelectionList.java?rev=597535&r1=597534&r2=597535&view=diff
==============================================================================
--- cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/datatype/FlowJXPathSelectionList.java
(original)
+++ cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/datatype/FlowJXPathSelectionList.java
Thu Nov 22 19:49:58 2007
@@ -23,7 +23,6 @@
 import org.apache.cocoon.forms.FormsConstants;
 import org.apache.cocoon.forms.util.I18nMessage;
 import org.apache.cocoon.processing.ProcessInfoProvider;
-import org.apache.cocoon.xml.AttributeTypes;
 import org.apache.cocoon.xml.AttributesImpl;
 import org.apache.cocoon.xml.XMLUtils;
 import org.apache.commons.jxpath.JXPathContext;
@@ -117,11 +116,7 @@
         }
 
         // Start the selection-list
-        //FIXME: I added attribute for namespace declaration because it would not be serialized
otherwise
-        //why it's not printed even if we specify necessary information in startElement()
method? (GK)
-        AttributesImpl attrs = new AttributesImpl();
-        attrs.addAttribute("", FormsConstants.INSTANCE_PREFIX, "xmlns:" + FormsConstants.INSTANCE_PREFIX,
AttributeTypes.CDATA, FormsConstants.INSTANCE_NS);
-        contentHandler.startElement(FormsConstants.INSTANCE_NS, SELECTION_LIST_EL, FormsConstants.INSTANCE_PREFIX_COLON
+ SELECTION_LIST_EL, attrs);
+        contentHandler.startElement(FormsConstants.INSTANCE_NS, SELECTION_LIST_EL, FormsConstants.INSTANCE_PREFIX_COLON
+ SELECTION_LIST_EL, XMLUtils.EMPTY_ATTRIBUTES);
         if( this.nullable ) {
             final AttributesImpl voidAttrs = new AttributesImpl(  );
             voidAttrs.addCDATAAttribute( "value", "" );

Modified: cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/test/java/org/apache/cocoon/forms/datatype/FlowJXPathSelectionListTestCase.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/test/java/org/apache/cocoon/forms/datatype/FlowJXPathSelectionListTestCase.java?rev=597535&r1=597534&r2=597535&view=diff
==============================================================================
--- cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/test/java/org/apache/cocoon/forms/datatype/FlowJXPathSelectionListTestCase.java
(original)
+++ cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/test/java/org/apache/cocoon/forms/datatype/FlowJXPathSelectionListTestCase.java
Thu Nov 22 19:49:58 2007
@@ -68,8 +68,10 @@
         Source expectedSource = new ResourceSource("resource://org/apache/cocoon/forms/datatype/FlowJXPathSelectionListTestCase.dest.xml");
         Document expected = this.parser.parse(expectedSource.getInputStream());
         Document destDocument = dest.getDocument();
-        assertEqual("Test if generated list matches expected",
-            expected, destDocument);
+        // FIXME: Why is the namespace declaration available as attribute on the expected
document?
+        //        That's the reason why we have to add it to destDocument as well.
+        destDocument.getDocumentElement().setAttribute("xmlns:" + FormsConstants.INSTANCE_PREFIX,
FormsConstants.INSTANCE_NS);
+        assertEqual("Test if generated list matches expected", expected, destDocument);
     }
     
     /**
@@ -94,8 +96,10 @@
         Source expectedSource = new ResourceSource("resource://org/apache/cocoon/forms/datatype/FlowJXPathSelectionListTestCaseWithNull.dest.xml");
         Document expected = this.parser.parse(expectedSource.getInputStream());
         Document destDocument = dest.getDocument();
-        assertEqual("Test if generated list matches expected",
-                expected, destDocument);
+        // FIXME: Why is the namespace declaration available as attribute on the expected
document?
+        //        That's the reason why we have to add it to destDocument as well.
+        destDocument.getDocumentElement().setAttribute("xmlns:" + FormsConstants.INSTANCE_PREFIX,
FormsConstants.INSTANCE_NS);
+        assertEqual("Test if generated list matches expected", expected, destDocument);
     }
     
     public static class TestBean {



Mime
View raw message