cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jheym...@apache.org
Subject svn commit: r330548 [117/132] - in /cocoon/whiteboard/maven2/cocoon-flat-layout: ./ cocoon-ajax-block/ cocoon-ajax-block/api/ cocoon-ajax-block/api/src/ cocoon-ajax-block/api/src/main/ cocoon-ajax-block/api/src/main/java/ cocoon-ajax-block/api/src/main...
Date Thu, 03 Nov 2005 14:00:48 GMT
Added: cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/main/resources/org/apache/cocoon/forms/system/i18n/messages_zh_CN.xml
URL: http://svn.apache.org/viewcvs/cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/main/resources/org/apache/cocoon/forms/system/i18n/messages_zh_CN.xml?rev=330548&view=auto
==============================================================================
--- cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/main/resources/org/apache/cocoon/forms/system/i18n/messages_zh_CN.xml (added)
+++ cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/main/resources/org/apache/cocoon/forms/system/i18n/messages_zh_CN.xml Thu Nov  3 05:41:06 2005
@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Copyright 1999-2004 The Apache Software Foundation
+
+  Licensed under the Apache License, Version 2.0 (the "License");
+  you may not use this file except in compliance with the License.
+  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+<!-- This catalogue file contains translations for built-in CForms messages. -->
+<catalogue>
+  <message key="validation.captcha.mismatch">#CAPTCHA check failed.#</message>
+  
+  <message key="general.field-required">此域是必须的</message>
+
+  <message key="datatype.conversion-failed">不是一个有效的{0}类型.</message>
+  <message key="datatype.decimal">小数</message> 
+  <message key="datatype.integer">整数</message> 
+  <message key="datatype.long">整数</message>
+  <message key="datatype.float">小数</message> 
+  <message key="datatype.double">小数</message> 
+  <message key="datatype.date.date">日期</message>
+  <message key="datatype.date.time">#time#</message>
+  <message key="datatype.date.datetime">#date-time#</message>
+
+  <message key="validation.string.exact-length">应为{0}个字符.</message>
+  <message key="validation.string.range-length">应包含{0}到{1}个字符.</message>
+  <message key="validation.string.min-length">应包含至少{0}个字符.</message>
+  <message key="validation.string.max-length">不应超过{0}个字符.</message>
+  <message key="validation.string.regexp">不能满足如下表达式: {0}</message>
+
+  <message key="validation.string.invalidemail">域不包含有效的邮件地址</message>
+
+  <message key="validation.array.exact-valuecount">应有{0}个项目被选中.</message>
+  <message key="validation.array.range-valuecount">至少{0}个和最多{1}个项目应被选中.</message>
+  <message key="validation.array.min-valuecount">至少{0}个项目应被选中.</message>
+  <message key="validation.array.max-valuecount">至多{0}个项目应被选中.</message>
+
+  <message key="multivaluefield.conversionfailed">选中的值当中有一个类型不正确.</message>
+
+  <message key="validation.numeric.range">数字范围应在{0}到{1}之间.</message>
+  <message key="validation.numeric.min">数字应大于等于{0}.</message>
+  <message key="validation.numeric.max">数字应小于等于{0}.</message>
+
+  <message key="validation.mod10">Mod 10 检查失败.</message>
+
+
+  <message key="aggregatedfield.split-failed">域的内容不能满足如下表达式: {0}</message>
+  <message key="upload.invalid-type">内容类型不正确: {0}.</message>
+  <message key="calendar.alt"></message>
+</catalogue>

Propchange: cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/main/resources/org/apache/cocoon/forms/system/i18n/messages_zh_CN.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/test/java/org/apache/cocoon/forms/datatype/DynamicSelectionListTestCase.java
URL: http://svn.apache.org/viewcvs/cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/test/java/org/apache/cocoon/forms/datatype/DynamicSelectionListTestCase.java?rev=330548&view=auto
==============================================================================
--- cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/test/java/org/apache/cocoon/forms/datatype/DynamicSelectionListTestCase.java (added)
+++ cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/test/java/org/apache/cocoon/forms/datatype/DynamicSelectionListTestCase.java Thu Nov  3 05:41:06 2005
@@ -0,0 +1,124 @@
+/*
+ * Copyright 1999-2004 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.cocoon.forms.datatype;
+
+import java.io.Writer;
+import java.util.Locale;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.stream.StreamResult;
+
+import org.apache.cocoon.core.container.ContainerTestCase;
+import org.apache.cocoon.forms.FormsConstants;
+import org.apache.cocoon.xml.dom.DOMBuilder;
+import org.apache.excalibur.source.impl.ResourceSource;
+import org.custommonkey.xmlunit.Diff;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+
+/**
+ * Test case for CForms's DynamicSelectionList datatype.
+ * @version $Id: DynamicSelectionListTestCase.java 326838 2005-10-20 06:26:53Z sylvain $
+ */
+public class DynamicSelectionListTestCase extends ContainerTestCase {
+
+    protected DatatypeManager datatypeManager;
+    protected DocumentBuilder parser;
+
+    /* (non-Javadoc)
+     * @see junit.framework.TestCase#setUp()
+     */
+    protected void setUp() throws Exception {
+        super.setUp();
+        datatypeManager = (DatatypeManager) this.lookup(DatatypeManager.ROLE);
+        DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
+        factory.setNamespaceAware(true);
+        parser = factory.newDocumentBuilder();
+    }
+    
+    /* (non-Javadoc)
+     * @see junit.framework.TestCase#tearDown()
+     */
+    protected void tearDown() throws Exception {
+        if (datatypeManager != null) {
+            this.release(datatypeManager);
+        }
+        super.tearDown();
+    }
+    
+    /**
+     * Test the generateSaxFragment method.
+     * @throws MalformedURLException
+     * @throws ParserConfigurationException
+     */
+    public void testGenerateSaxFragment() throws Exception {
+        DOMBuilder dest = new DOMBuilder();
+        ResourceSource source = 
+            new ResourceSource("resource://org/apache/cocoon/forms/datatype/DynamicSelectionListTestCase.source.xml");
+        Document sourceDoc = parser.parse(source.getInputStream());
+        Element datatypeElement = (Element) sourceDoc.getElementsByTagNameNS(FormsConstants.DEFINITION_NS, "convertor").item(0);
+        Datatype datatype = datatypeManager.createDatatype(datatypeElement, false);
+        DynamicSelectionList list = 
+            new DynamicSelectionList(datatype, null, this.getManager());
+        list.generateSaxFragment(dest, Locale.ENGLISH, source);
+        ResourceSource expectedSource =
+            new ResourceSource("resource://org/apache/cocoon/forms/datatype/DynamicSelectionListTestCase.dest.xml");
+        Document expected = parser.parse(expectedSource.getInputStream());
+        assertEqual("Test if output is what is expected",
+                expected, dest.getDocument());
+    }
+
+    /**
+     * Check is the source document is equal to the one produced by the method under test.
+     * @param message A message to print in case of failure.
+     * @param expected The expected (source) document.
+     * @param actual The actual (output) document.
+     */
+    private void assertEqual(String message, Document expected, Document actual) {
+        expected.getDocumentElement().normalize();
+        actual.getDocumentElement().normalize();
+        // DIRTY HACK WARNING: we add the "xmlns:wi" attribute reported
+        // by DOM, as expected, but not generated by the method under test,
+        // otherwise the comparison would fail. 
+        actual.getDocumentElement().setAttribute(FormsConstants.INSTANCE_PREFIX,
+                FormsConstants.INSTANCE_NS);
+        Diff diff =  new Diff(expected, actual);
+        assertTrue(message + ", " + diff.toString(), diff.similar());
+    }
+
+    /**
+     * Print a document to a writer for debugging purposes.
+     * @param document The document to print.
+     * @param out The writer to write to.
+     */
+    public final void print(Document document, Writer out) {
+        TransformerFactory factory = TransformerFactory.newInstance();
+        try {
+            javax.xml.transform.Transformer serializer =
+                factory.newTransformer();
+            serializer.transform(
+                new DOMSource(document),
+                new StreamResult(out));
+            out.write('\n');
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+}

Propchange: cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/test/java/org/apache/cocoon/forms/datatype/DynamicSelectionListTestCase.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/test/java/org/apache/cocoon/forms/datatype/EnumSelectionListTestCase.java
URL: http://svn.apache.org/viewcvs/cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/test/java/org/apache/cocoon/forms/datatype/EnumSelectionListTestCase.java?rev=330548&view=auto
==============================================================================
--- cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/test/java/org/apache/cocoon/forms/datatype/EnumSelectionListTestCase.java (added)
+++ cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/test/java/org/apache/cocoon/forms/datatype/EnumSelectionListTestCase.java Thu Nov  3 05:41:06 2005
@@ -0,0 +1,140 @@
+/*
+ * Copyright 1999-2004 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.cocoon.forms.datatype;
+
+import java.io.Writer;
+import java.util.Locale;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.stream.StreamResult;
+
+import org.apache.cocoon.transformation.I18nTransformer;
+import org.apache.cocoon.core.container.ContainerTestCase;
+import org.apache.cocoon.forms.FormsConstants;
+import org.apache.cocoon.forms.datatype.typeimpl.EnumType;
+import org.apache.cocoon.xml.dom.DOMBuilder;
+import org.apache.excalibur.source.impl.ResourceSource;
+import org.custommonkey.xmlunit.Diff;
+import org.w3c.dom.Document;
+
+/**
+ * Test case for CForms's DynamicSelectionList datatype.
+ *
+ * @version $Id: EnumSelectionListTestCase.java 326838 2005-10-20 06:26:53Z sylvain $
+ */
+public class EnumSelectionListTestCase extends ContainerTestCase {
+
+    protected DatatypeManager datatypeManager;
+    protected DocumentBuilder parser;
+
+    /* (non-Javadoc)
+     * @see junit.framework.TestCase#setUp()
+     */
+    protected void setUp() throws Exception {
+        super.setUp();
+        datatypeManager = (DatatypeManager) this.lookup(DatatypeManager.ROLE);
+        DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
+        factory.setNamespaceAware(true);
+        parser = factory.newDocumentBuilder();
+    }
+    
+    /* (non-Javadoc)
+     * @see junit.framework.TestCase#tearDown()
+     */
+    protected void tearDown() throws Exception {
+        if (datatypeManager != null) {
+            this.release(datatypeManager);
+        }
+        super.tearDown();
+    }
+    
+    /**
+     * Test the generateSaxFragment method.
+     * @throws MalformedURLException
+     * @throws ParserConfigurationException
+     */
+    public void testGenerateSaxFragment() throws Exception {
+        DOMBuilder dest = new DOMBuilder();
+        EnumSelectionList list = 
+            new EnumSelectionList(Sex.class.getName(), new EnumType(), false);
+        list.generateSaxFragment(dest, Locale.ENGLISH);
+        ResourceSource expectedSource =
+            new ResourceSource("resource://org/apache/cocoon/forms/datatype/EnumSelectionListTestCase.dest-no-null.xml");
+        Document expected = parser.parse(expectedSource.getInputStream());
+        assertEqual("Test if output is what is expected",
+                expected, dest.getDocument());
+    }
+    
+    /**
+     * Test the generateSaxFragment method with a nullable selection list
+     * @throws MalformedURLException
+     * @throws ParserConfigurationException
+     */
+    public void testGenerateSaxFragmentNullable() throws Exception {
+        DOMBuilder dest = new DOMBuilder();
+        EnumSelectionList list = 
+            new EnumSelectionList(Sex.class.getName(), new EnumType(), true);
+        list.generateSaxFragment(dest, Locale.ENGLISH);
+        ResourceSource expectedSource =
+            new ResourceSource("resource://org/apache/cocoon/forms/datatype/EnumSelectionListTestCase.dest.xml");
+        Document expected = parser.parse(expectedSource.getInputStream());
+        assertEqual("Test if output is what is expected",
+                expected, dest.getDocument());
+    }
+    
+    /**
+     * Check is the source document is equal to the one produced by the method under test.
+     * @param message A message to print in case of failure.
+     * @param expected The expected (source) document.
+     * @param actual The actual (output) document.
+     */
+    private void assertEqual(String message, Document expected, Document actual) {
+        expected.getDocumentElement().normalize();
+        actual.getDocumentElement().normalize();
+        // DIRTY HACK WARNING: we add the "xmlns:*" attributes reported
+        // by DOM, as expected, but not generated by the method under test,
+        // otherwise the comparison would fail. 
+        actual.getDocumentElement().setAttribute(FormsConstants.INSTANCE_PREFIX,
+                FormsConstants.INSTANCE_NS);
+        actual.getDocumentElement().setAttribute("i18n",
+                I18nTransformer.I18N_NAMESPACE_URI);
+        Diff diff =  new Diff(expected, actual);
+        assertTrue(message + ", " + diff.toString(), diff.similar());
+    }
+
+    /**
+     * Print a document to a writer for debugging purposes.
+     * @param document The document to print.
+     * @param out The writer to write to.
+     */
+    public final void print(Document document, Writer out) {
+        TransformerFactory factory = TransformerFactory.newInstance();
+        try {
+            javax.xml.transform.Transformer serializer =
+                factory.newTransformer();
+            serializer.transform(
+                new DOMSource(document),
+                new StreamResult(out));
+            out.write('\n');
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+}

Propchange: cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/test/java/org/apache/cocoon/forms/datatype/EnumSelectionListTestCase.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/test/java/org/apache/cocoon/forms/datatype/FlowJXPathSelectionListTestCase.java
URL: http://svn.apache.org/viewcvs/cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/test/java/org/apache/cocoon/forms/datatype/FlowJXPathSelectionListTestCase.java?rev=330548&view=auto
==============================================================================
--- cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/test/java/org/apache/cocoon/forms/datatype/FlowJXPathSelectionListTestCase.java (added)
+++ cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/test/java/org/apache/cocoon/forms/datatype/FlowJXPathSelectionListTestCase.java Thu Nov  3 05:41:06 2005
@@ -0,0 +1,197 @@
+/*
+ * Copyright 1999-2004 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.cocoon.forms.datatype;
+
+import java.io.Writer;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Locale;
+import java.util.Map;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.stream.StreamResult;
+
+import org.apache.avalon.framework.context.Context;
+import org.apache.avalon.framework.context.DefaultContext;
+import org.apache.cocoon.components.ContextHelper;
+import org.apache.cocoon.components.flow.FlowHelper;
+import org.apache.cocoon.core.container.ContainerTestCase;
+import org.apache.cocoon.environment.ObjectModelHelper;
+import org.apache.cocoon.environment.Request;
+import org.apache.cocoon.environment.mock.MockRequest;
+import org.apache.cocoon.forms.FormsConstants;
+import org.apache.cocoon.xml.dom.DOMBuilder;
+import org.apache.excalibur.source.Source;
+import org.apache.excalibur.source.impl.ResourceSource;
+import org.custommonkey.xmlunit.Diff;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+
+/**
+ * Test case for CForms's FlowModelSelectionList datatype.
+ * @version $Id: FlowJXPathSelectionListTestCase.java 326838 2005-10-20 06:26:53Z sylvain $
+ */
+public class FlowJXPathSelectionListTestCase extends ContainerTestCase {
+
+    protected DatatypeManager datatypeManager;
+    protected DocumentBuilder parser;
+
+    /* (non-Javadoc)
+     * @see junit.framework.TestCase#setUp()
+     */
+    protected void setUp() throws Exception {
+        super.setUp();
+        datatypeManager = (DatatypeManager) this.lookup(DatatypeManager.ROLE);
+        DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
+        factory.setNamespaceAware(true);
+        parser = factory.newDocumentBuilder();
+    }
+    
+    /* (non-Javadoc)
+     * @see junit.framework.TestCase#tearDown()
+     */
+    protected void tearDown() throws Exception {
+        if (datatypeManager != null) {
+            this.release(datatypeManager);
+        }
+        super.tearDown();
+    }
+    
+    /**
+     * Test the generateSaxFragment method.
+     */
+    public void testGenerateSaxFragment() throws Exception {
+        List beans = new ArrayList(2);
+        beans.add(new TestBean("1", "One"));
+        beans.add(new TestBean("2", "Two"));
+        Map flowContextObject = new HashMap();
+        flowContextObject.put("beans", beans);
+        Request request = new MockRequest();
+        Map objectModel = new HashMap();
+        FlowHelper.setContextObject(objectModel, flowContextObject);
+        objectModel.put(ObjectModelHelper.REQUEST_OBJECT, request);
+        Map contextObjectModel = new HashMap();
+        contextObjectModel.put(ContextHelper.CONTEXT_OBJECT_MODEL, objectModel);
+        Context context = new DefaultContext(contextObjectModel);
+        Source sampleSource = new ResourceSource("resource://org/apache/cocoon/forms/datatype/FlowJXPathSelectionListTestCase.source.xml");
+        Document sample = parser.parse(sampleSource.getInputStream());
+        Element datatypeElement = (Element) sample.getElementsByTagNameNS(FormsConstants.DEFINITION_NS, "datatype").item(0);
+        Datatype datatype = datatypeManager.createDatatype(datatypeElement, false);
+        FlowJXPathSelectionList list = new FlowJXPathSelectionList
+            (context, "beans", "key", "value", datatype,null,false,null,false);
+        DOMBuilder dest = new DOMBuilder();
+        list.generateSaxFragment(dest, Locale.ENGLISH);
+        Source expectedSource = new ResourceSource("resource://org/apache/cocoon/forms/datatype/FlowJXPathSelectionListTestCase.dest.xml");
+        Document expected = parser.parse(expectedSource.getInputStream());
+        assertEqual("Test if generated list matches expected",
+            expected, dest.getDocument());
+    }
+    
+    /**
+     * Test the generateSaxFragment method with a list containing a null value.
+     */
+    public void testGenerateSaxFragmentWithNull() throws Exception {
+        List beans = new ArrayList(2);
+        beans.add(null);
+        beans.add(new TestBean("1", "One"));
+        beans.add(new TestBean("2", "Two"));
+        Map flowContextObject = new HashMap();
+        flowContextObject.put("beans", beans);
+        Request request = new MockRequest();
+        Map objectModel = new HashMap();
+        FlowHelper.setContextObject(objectModel, flowContextObject);
+        objectModel.put(ObjectModelHelper.REQUEST_OBJECT, request);
+        Map contextObjectModel = new HashMap();
+        contextObjectModel.put(ContextHelper.CONTEXT_OBJECT_MODEL, objectModel);
+        Context context = new DefaultContext(contextObjectModel);
+        Source sampleSource = new ResourceSource("resource://org/apache/cocoon/forms/datatype/FlowJXPathSelectionListTestCase.source.xml");
+        Document sample = parser.parse(sampleSource.getInputStream());
+        Element datatypeElement = (Element) sample.getElementsByTagNameNS(FormsConstants.DEFINITION_NS, "datatype").item(0);
+        Datatype datatype = datatypeManager.createDatatype(datatypeElement, false);
+        FlowJXPathSelectionList list = new FlowJXPathSelectionList
+            (context, "beans", "key", "value", datatype,null,false,null,false);
+        DOMBuilder dest = new DOMBuilder();
+        list.generateSaxFragment(dest, Locale.ENGLISH);
+        Source expectedSource = new ResourceSource("resource://org/apache/cocoon/forms/datatype/FlowJXPathSelectionListTestCaseWithNull.dest.xml");
+        Document expected = parser.parse(expectedSource.getInputStream());
+        assertEqual("Test if generated list matches expected",
+                expected, dest.getDocument());
+    }
+    
+    /**
+     * Check is the source document is equal to the one produced by the method under test.
+     * @param message A message to print in case of failure.
+     * @param expected The expected (source) document.
+     * @param actual The actual (output) document.
+     */
+    private void assertEqual(String message, Document expected, Document actual) {
+        expected.getDocumentElement().normalize();
+        actual.getDocumentElement().normalize();
+        // DIRTY HACK WARNING: we add the "xmlns:wi" attribute reported
+        // by DOM, as expected, but not generated by the method under test,
+        // otherwise the comparison would fail. 
+        actual.getDocumentElement().setAttribute(FormsConstants.INSTANCE_PREFIX,
+                FormsConstants.INSTANCE_NS);
+        Diff diff =  new Diff(expected, actual);
+        assertTrue(message + ", " + diff.toString(), diff.similar());
+    }
+
+    /**
+     * Print a document to a writer for debugging purposes.
+     * @param document The document to print.
+     * @param out The writer to write to.
+     */
+    public final void print(Document document, Writer out) {
+        TransformerFactory factory = TransformerFactory.newInstance();
+        try {
+            javax.xml.transform.Transformer serializer =
+                factory.newTransformer();
+            serializer.transform(
+                new DOMSource(document),
+                new StreamResult(out));
+            out.write('\n');
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+    
+    public static class TestBean {
+        private String key;
+        private String value;
+
+        public TestBean(String key, String value) {
+            this.key = key;
+            this.value = value;
+        }
+        
+        public String getKey() {
+            return key;
+        }
+        
+        public String getValue() {
+            return value;
+        }
+        
+        public String toString() {
+            return "{ " + key + " : " + value + " }";
+        }
+    }
+}

Propchange: cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/test/java/org/apache/cocoon/forms/datatype/FlowJXPathSelectionListTestCase.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/test/java/org/apache/cocoon/forms/datatype/Sex.java
URL: http://svn.apache.org/viewcvs/cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/test/java/org/apache/cocoon/forms/datatype/Sex.java?rev=330548&view=auto
==============================================================================
--- cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/test/java/org/apache/cocoon/forms/datatype/Sex.java (added)
+++ cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/test/java/org/apache/cocoon/forms/datatype/Sex.java Thu Nov  3 05:41:06 2005
@@ -0,0 +1,40 @@
+/*
+ * Copyright 1999-2004 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.cocoon.forms.datatype;
+
+
+/**
+ * Description of Sex.
+ *
+ * @version $Id: Sex.java 151050 2005-02-02 20:47:40Z tim $
+ */
+public class Sex {
+
+    public static final Sex MALE = new Sex("M");
+    public static final Sex FEMALE = new Sex("F");
+    private String code;
+
+    private Sex(String code) { this.code = code; }
+
+    public String toString() {
+      // Will probably have some i18n support here
+      switch(code.charAt(0)) {
+          case 'M' : return this.getClass().getName() + ".MALE";
+          case 'F' : return this.getClass().getName() + ".FEMALE";
+          default : return "unknown"; // Should never happen
+      }
+    }
+}

Propchange: cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/test/java/org/apache/cocoon/forms/datatype/Sex.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/test/java/org/apache/cocoon/forms/datatype/convertor/EnumConvertorBuilderTestCase.java
URL: http://svn.apache.org/viewcvs/cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/test/java/org/apache/cocoon/forms/datatype/convertor/EnumConvertorBuilderTestCase.java?rev=330548&view=auto
==============================================================================
--- cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/test/java/org/apache/cocoon/forms/datatype/convertor/EnumConvertorBuilderTestCase.java (added)
+++ cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/test/java/org/apache/cocoon/forms/datatype/convertor/EnumConvertorBuilderTestCase.java Thu Nov  3 05:41:06 2005
@@ -0,0 +1,69 @@
+/*
+ * Copyright 1999-2004 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.cocoon.forms.datatype.convertor;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+
+import junit.framework.TestCase;
+
+import org.apache.cocoon.forms.FormsConstants;
+import org.apache.excalibur.source.Source;
+import org.apache.excalibur.source.impl.ResourceSource;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+
+/**
+ * Test case for the {@link EnumConvertorBuilder} class.
+ * 
+ * @version $Id: EnumConvertorBuilderTestCase.java 326838 2005-10-20 06:26:53Z sylvain $
+ */
+public class EnumConvertorBuilderTestCase extends TestCase {
+
+    protected DocumentBuilder parser;
+
+    /* (non-Javadoc)
+     * @see junit.framework.TestCase#setUp()
+     */
+    protected void setUp() throws Exception {
+        super.setUp();
+        DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
+        factory.setNamespaceAware(true);
+        parser = factory.newDocumentBuilder();
+    }
+
+    public EnumConvertorBuilderTestCase(String name) {
+        super(name);
+    }
+
+    /**
+     * Test the {@link EnumConvertorBuilder#build(org.w3c.dom.Element)
+     * build} method.
+     * @throws Exception
+     */
+    public void testBuild() throws Exception {
+        Source confSource = new ResourceSource("resource://org/apache/cocoon/forms/datatype/convertor/EnumConvertorTestCase.conf.xml");
+        Document sample = parser.parse(confSource.getInputStream());
+        Element convertorElement = (Element) sample.getElementsByTagNameNS(FormsConstants.DEFINITION_NS, "convertor").item(0);
+        String enumClassName = convertorElement.getElementsByTagNameNS(FormsConstants.DEFINITION_NS, "enum").item(0).getFirstChild().getNodeValue();
+        EnumConvertorBuilder builder = new EnumConvertorBuilder();
+        Convertor convertor = builder.build(convertorElement);
+        assertTrue("The returned convertor is not an EnumConvertor",
+                convertor instanceof EnumConvertor);
+        assertEquals("The convertor does not convert the expected class",
+                Class.forName(enumClassName), convertor.getTypeClass());
+    }
+}

Propchange: cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/test/java/org/apache/cocoon/forms/datatype/convertor/EnumConvertorBuilderTestCase.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/test/java/org/apache/cocoon/forms/datatype/convertor/EnumConvertorTestCase.java
URL: http://svn.apache.org/viewcvs/cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/test/java/org/apache/cocoon/forms/datatype/convertor/EnumConvertorTestCase.java?rev=330548&view=auto
==============================================================================
--- cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/test/java/org/apache/cocoon/forms/datatype/convertor/EnumConvertorTestCase.java (added)
+++ cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/test/java/org/apache/cocoon/forms/datatype/convertor/EnumConvertorTestCase.java Thu Nov  3 05:41:06 2005
@@ -0,0 +1,57 @@
+/*
+ * Copyright 1999-2004 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.cocoon.forms.datatype.convertor;
+
+import java.util.Locale;
+
+import org.apache.cocoon.forms.datatype.Sex;
+
+import junit.framework.TestCase;
+
+/**
+ * Test case for the {@link EnumConvertor} class.
+ * 
+ * @version $Id: EnumConvertorTestCase.java 151050 2005-02-02 20:47:40Z tim $
+ */
+public class EnumConvertorTestCase extends TestCase {
+
+    public EnumConvertorTestCase(String name) {
+        super(name);
+    }
+
+    /**
+     * Test the {@link EnumConvertor#convertFromString(java.lang.String, java.util.Locale, org.apache.cocoon.forms.datatype.convertor.Convertor.FormatCache)
+     * method.
+     */
+    public void testConvertFromString() {
+        EnumConvertor convertor = new EnumConvertor("org.apache.cocoon.forms.datatype.Sex");
+        ConversionResult conversionResult = convertor.convertFromString
+            (Sex.class.getName() + ".FEMALE", Locale.getDefault(), null);
+        assertSame("Returned sex must be FEMALE", Sex.FEMALE, conversionResult.getResult());
+    }
+    
+    /**
+     * Test the {@link EnumConvertor##convertToString(java.lang.Object, java.util.Locale, org.apache.cocoon.forms.datatype.convertor.Convertor.FormatCache)
+     * method.
+     */
+    public void testConvertToString() {
+        EnumConvertor convertor = new EnumConvertor("org.apache.cocoon.forms.datatype.Sex");
+        assertEquals("Converted value must match string",
+                Sex.class.getName() + ".MALE",
+                convertor.convertToString
+                    (Sex.MALE, Locale.getDefault(), null));
+    }
+}

Propchange: cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/test/java/org/apache/cocoon/forms/datatype/convertor/EnumConvertorTestCase.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/test/java/org/apache/cocoon/forms/datatype/validationruleimpl/EmailValidationRuleTest.java
URL: http://svn.apache.org/viewcvs/cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/test/java/org/apache/cocoon/forms/datatype/validationruleimpl/EmailValidationRuleTest.java?rev=330548&view=auto
==============================================================================
--- cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/test/java/org/apache/cocoon/forms/datatype/validationruleimpl/EmailValidationRuleTest.java (added)
+++ cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/test/java/org/apache/cocoon/forms/datatype/validationruleimpl/EmailValidationRuleTest.java Thu Nov  3 05:41:06 2005
@@ -0,0 +1,49 @@
+/*
+ * Copyright 1999-2004 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.cocoon.forms.datatype.validationruleimpl;
+
+import junit.framework.TestCase;
+
+
+/**
+ * Description of EmailValidationRuleTest.
+ * 
+ * @version $Id: EmailValidationRuleTest.java 151179 2005-02-03 16:55:16Z tim $
+ */
+public class EmailValidationRuleTest extends TestCase {
+
+    public EmailValidationRuleTest(String name) {
+        super(name);
+    }
+    
+    /**
+     * Test some patterns that should be accepted.
+     */
+    public void testAccept() {
+        EmailValidationRule rule = new EmailValidationRule();
+        assertTrue("dev@cocoon.apache.org", rule.isEmail("dev@cocoon.apache.org"));
+        assertTrue("\"Arc, Joan\"@ird.govt.nz", rule.isEmail("\"Arc, Joan\"@ird.govt.nz"));
+    }
+    
+    /**
+     * Test some patterns that should be rejected.
+     */
+    public void testReject() {
+        EmailValidationRule rule = new EmailValidationRule();
+        assertTrue("x@....", ! rule.isEmail("x@...."));
+        assertTrue("neville.@hotmail.com", ! rule.isEmail("neville.@hotmail.com"));
+    }
+}

Propchange: cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/test/java/org/apache/cocoon/forms/datatype/validationruleimpl/EmailValidationRuleTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/test/java/org/apache/cocoon/forms/formmodel/FieldTestCase.java
URL: http://svn.apache.org/viewcvs/cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/test/java/org/apache/cocoon/forms/formmodel/FieldTestCase.java?rev=330548&view=auto
==============================================================================
--- cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/test/java/org/apache/cocoon/forms/formmodel/FieldTestCase.java (added)
+++ cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/test/java/org/apache/cocoon/forms/formmodel/FieldTestCase.java Thu Nov  3 05:41:06 2005
@@ -0,0 +1,227 @@
+/*
+ * Copyright 1999-2004 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.cocoon.forms.formmodel;
+
+import org.apache.cocoon.core.container.ContainerTestCase;
+import org.apache.cocoon.environment.mock.MockRequest;
+import org.apache.cocoon.forms.FormContext;
+import org.apache.cocoon.forms.event.ValueChangedEvent;
+import org.apache.cocoon.forms.event.ValueChangedListener;
+import org.w3c.dom.Document;
+
+/**
+ * Test case for CForm's Field widget
+ *
+ * @version $Id: FieldTestCase.java 106132 2004-11-21 22:29:26Z sylvain $
+ */
+
+public class FieldTestCase extends ContainerTestCase {
+    
+    public static final String VALUE_PATH = "fi:fragment/fi:field/fi:value";
+    public static final String VALIDATION_PATH = "fi:fragment/fi:field/fi:validation-message";
+    
+    
+    /**
+     * Nominal test where the request data is syntactically correct and validates
+     */
+    public void testValueDoesParseAndValidate() throws Exception {
+        Form form = WidgetTestHelper.loadForm(getManager(), this, "FieldTestCase.model.xml");
+        Field field = (Field)form.getChild("intfield");
+        Action button = (Action)form.getChild("action");
+        MockRequest request;
+        
+        request = new MockRequest();
+        request.addParameter("intfield", "11");
+        request.addParameter("action", "pressed");
+        form.process(new FormContext(request));
+        
+        // No parsing nor validation where performed
+        Document doc = WidgetTestHelper.getWidgetFragment(field, null);
+        WidgetTestHelper.assertXPathEquals("Displayed value", "11", VALUE_PATH, doc);
+        WidgetTestHelper.assertXPathNotExists("Validation error", VALIDATION_PATH, doc);
+        
+        // Now do some parsing.
+        assertEquals("Field value", new Integer(11), field.getValue());
+        // And still no validation error (do not call getValidationError() as it does validate)
+        doc = WidgetTestHelper.getWidgetFragment(field, null);
+        WidgetTestHelper.assertXPathNotExists("Validation error", VALIDATION_PATH, doc);
+        
+        // Now validate
+        assertTrue("Field does validate", field.validate());
+        assertNull("getValidationError() null after validation", field.getValidationError());
+        doc = WidgetTestHelper.getWidgetFragment(field, null);
+        WidgetTestHelper.assertXPathNotExists("Validation error", VALIDATION_PATH, doc);        
+    }
+    
+    /**
+     * Request data is not syntactically correct
+     */
+    public void testValueDoesNotParse() throws Exception {
+        Form form = WidgetTestHelper.loadForm(getManager(), this, "FieldTestCase.model.xml");
+        Field field = (Field)form.getChild("intfield");
+        Action button = (Action)form.getChild("action");
+        MockRequest request;
+        
+        request = new MockRequest();
+        request.addParameter("intfield", "foo");
+        request.addParameter("action", "pressed");
+        form.process(new FormContext(request));
+        
+        // No parsing nor validation where performed
+        Document doc = WidgetTestHelper.getWidgetFragment(field, null);
+        WidgetTestHelper.assertXPathEquals("Displayed velue", "foo", VALUE_PATH, doc);
+        WidgetTestHelper.assertXPathNotExists("Validation error before parse", VALIDATION_PATH, doc);
+        
+        // Now do some parsing. Will return null as it's not parseable
+        assertNull("Field value", field.getValue());
+        // But still no validation error
+        doc = WidgetTestHelper.getWidgetFragment(field, null);
+        WidgetTestHelper.assertXPathEquals("Displayed value", "foo", VALUE_PATH, doc);
+        WidgetTestHelper.assertXPathNotExists("Validation error after parse", VALIDATION_PATH, doc);
+        
+        // Now validate
+        assertFalse("Field validation", field.validate());
+        doc = WidgetTestHelper.getWidgetFragment(field, null);
+        WidgetTestHelper.assertXPathEquals("Displayed velue", "foo", VALUE_PATH, doc);
+        WidgetTestHelper.assertXPathExists("Validation not null after parse", VALIDATION_PATH, doc);
+        assertNotNull("getValidationError() not null after validation", field.getValidationError());
+    }
+    
+    /**
+     * Request data is syntactically correct but doesn't validate
+     */
+    public void testValueDoesNotValidate() throws Exception {
+        Form form = WidgetTestHelper.loadForm(getManager(), this, "FieldTestCase.model.xml");
+        Field field = (Field)form.getChild("intfield");
+        Action button = (Action)form.getChild("action");
+        MockRequest request;
+        
+        request = new MockRequest();
+        request.addParameter("intfield", "1");
+        request.addParameter("action", "pressed");
+        form.process(new FormContext(request));
+        
+        // No parsing nor validation where performed
+        Document doc = WidgetTestHelper.getWidgetFragment(field, null);
+        WidgetTestHelper.assertXPathEquals("Displayed value", "1", VALUE_PATH, doc);
+        WidgetTestHelper.assertXPathNotExists("Validation error before parse", VALIDATION_PATH, doc);
+        
+        // Now do some parsing. Will return null although syntactically correct as it's invalid
+        assertNull("Field value", field.getValue());
+        // But still no validation error
+        doc = WidgetTestHelper.getWidgetFragment(field, null);
+        WidgetTestHelper.assertXPathNotExists("Validation error after parse", VALIDATION_PATH, doc);
+        
+        // Now validate
+        assertFalse("Field validation", field.validate());
+        doc = WidgetTestHelper.getWidgetFragment(field, null);
+        WidgetTestHelper.assertXPathExists("Validation error after validation", VALIDATION_PATH, doc);
+        assertNotNull("getValidationError() not null after validation", field.getValidationError());
+    }
+    
+    /**
+     * Test that a field's value is properly set by a call to setValue("") with an
+     * empty string when the field is in unparsed state (there used to be a bug in
+     * that case)
+     */
+    public void testSetEmptyValueWhenValueChangedOnRequest() throws Exception {
+        Form form = WidgetTestHelper.loadForm(getManager(), this, "FieldTestCase.model.xml");
+        Field field = (Field)form.getChild("stringfield");
+        Action button = (Action)form.getChild("action");
+        MockRequest request;
+        
+        // Set a value in stringfield and submit with an action
+        // (no validation, thus no call to doParse())
+        request = new MockRequest();
+        request.addParameter("stringfield", "bar");
+        request.addParameter("action", "pressed");
+        form.process(new FormContext(request));
+        
+        // Verify submit widget, just to be sure that validation did not occur
+        assertEquals("Form submit widget", button, form.getSubmitWidget());
+        
+        // Set the value to an empty string. In that case, a faulty test made
+        // it actually ignore it when state was VALUE_UNPARSED
+        field.setValue("");
+        
+        // Check value by various means
+        Document doc = WidgetTestHelper.getWidgetFragment(field, null);
+        WidgetTestHelper.assertXPathEquals("Displayed value", "", VALUE_PATH, doc);
+        assertEquals("Datatype string conversion", "", field.getDatatype().convertToString(field.value, null));
+        assertEquals("Field value", "", (String)field.getValue());
+    }
+    
+    /**
+     * Test that the previous field value is correctly passed to event listeners
+     * even if it was not already parsed.
+     */
+    public void testOldValuePresentInEventEvenIfNotParsed() throws Exception {
+        Form form = WidgetTestHelper.loadForm(getManager(), this, "FieldTestCase.model.xml");
+        Field field = (Field)form.getChild("stringfield");
+        Action button = (Action)form.getChild("action");
+        MockRequest request;
+        
+        // Set a value on "stringfield", and submit using an action so that
+        // it stays in unparsed state
+        request = new MockRequest();
+        request.addParameter("stringfield", "foo");
+        request.addParameter("action", "pressed");
+        form.process(new FormContext(request));
+
+        // Now add an event listener that will check old an new value
+        field.addValueChangedListener(new ValueChangedListener (){
+            public void valueChanged(ValueChangedEvent event) {
+                assertEquals("Old value", "foo", (String)event.getOldValue());
+                assertEquals("New value", "bar", (String)event.getNewValue());
+            }
+        });
+        
+        // Change value to "bar", still without explicit validation
+        // That will call the event listener
+        request = new MockRequest();
+        request.addParameter("stringfield", "bar");
+        request.addParameter("button", "pressed");
+        form.process(new FormContext(request));
+    }
+    
+    /**
+     * Request parameters are not read when a field is not in active state
+     */
+    public void testParameterNotReadWhenDisabled() throws Exception {
+        Form form = WidgetTestHelper.loadForm(getManager(), this, "FieldTestCase.model.xml");
+        Field field = (Field)form.getChild("stringfield");
+        MockRequest request;
+
+        // Disable the form
+        form.setState(WidgetState.DISABLED);
+        field.setValue("foo");
+        
+        request = new MockRequest();
+        request.addParameter("stringfield", "bar");
+        form.process(new FormContext(request));
+        
+        // Check that "bar" was not read
+        assertEquals("foo", field.getValue());
+        
+        // Switch back to active and resumbit the same request
+        form.setState(WidgetState.ACTIVE);
+        form.process(new FormContext(request));
+        
+        // Should have changed now
+        assertEquals("bar", field.getValue());
+    }
+}

Propchange: cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/test/java/org/apache/cocoon/forms/formmodel/FieldTestCase.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/test/java/org/apache/cocoon/forms/formmodel/GroupTestCase.java
URL: http://svn.apache.org/viewcvs/cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/test/java/org/apache/cocoon/forms/formmodel/GroupTestCase.java?rev=330548&view=auto
==============================================================================
--- cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/test/java/org/apache/cocoon/forms/formmodel/GroupTestCase.java (added)
+++ cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/test/java/org/apache/cocoon/forms/formmodel/GroupTestCase.java Thu Nov  3 05:41:06 2005
@@ -0,0 +1,49 @@
+/*
+ * Copyright 1999-2004 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.cocoon.forms.formmodel;
+
+import junit.framework.Assert;
+
+import org.apache.cocoon.core.container.ContainerTestCase;
+import org.apache.cocoon.forms.datatype.typeimpl.IntegerType;
+
+/**
+ * Test case for CForm's group widget and inheritance
+ *
+ * @version $Id: GroupTestCase.java 289538 2005-09-16 13:46:22Z sylvain $
+ */
+
+public class GroupTestCase extends ContainerTestCase {
+
+    /**
+     * checks for correct inheritance
+     */
+    public void testInheritance() throws Exception {
+        Form form = WidgetTestHelper.loadForm(getManager(), this, "GroupTestCase.model.xml");
+        Field field1 = (Field)((Group)form.getChild("group2")).getChild("field1");
+        Field field2 = (Field)((Group)form.getChild("group2")).getChild("field2");
+        Field field3 = (Field)((Group)form.getChild("group2")).getChild("field3");
+        Group group2 = (Group)form.getChild("group2");
+        
+        Assert.assertNotNull("Inherited field present", field1 );
+        Assert.assertNotNull("Added field present", field2 );
+        Assert.assertNotNull("Internally inherited field present", field3 );
+        
+        // check datatype
+        Assert.assertTrue("Datatype of internally inherited field", field3.getDatatype() instanceof IntegerType);
+    }
+}

Propchange: cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/test/java/org/apache/cocoon/forms/formmodel/GroupTestCase.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/test/java/org/apache/cocoon/forms/formmodel/WidgetTestHelper.java
URL: http://svn.apache.org/viewcvs/cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/test/java/org/apache/cocoon/forms/formmodel/WidgetTestHelper.java?rev=330548&view=auto
==============================================================================
--- cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/test/java/org/apache/cocoon/forms/formmodel/WidgetTestHelper.java (added)
+++ cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/test/java/org/apache/cocoon/forms/formmodel/WidgetTestHelper.java Thu Nov  3 05:41:06 2005
@@ -0,0 +1,140 @@
+/*
+ * Copyright 1999-2004 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.cocoon.forms.formmodel;
+
+import java.util.Locale;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+
+import junit.framework.Assert;
+
+import org.apache.avalon.framework.service.ServiceManager;
+import org.apache.cocoon.forms.FormsConstants;
+import org.apache.cocoon.forms.FormManager;
+import org.apache.cocoon.xml.AttributesImpl;
+import org.apache.cocoon.xml.dom.DOMBuilder;
+import org.apache.commons.jxpath.JXPathContext;
+import org.apache.commons.jxpath.Pointer;
+import org.w3c.dom.Document;
+import org.xml.sax.SAXException;
+import org.xml.sax.helpers.NamespaceSupport;
+
+/**
+ * Helper class to build Widget test cases.
+ * 
+ * @version $Id: WidgetTestHelper.java 326838 2005-10-20 06:26:53Z sylvain $
+ */
+public class WidgetTestHelper {
+    
+    // Private constructor as we only have static methods
+    private WidgetTestHelper() {}
+
+    /**
+     * Get the result of a widget's generateSaxFragment() method as a Document.
+     * <p>
+     * The widget's fragment is encapsulated in a root &lt;fi:fragment&gt; element,
+     * since there's no guarantee that a widget outputs a single top-level element
+     * (there can be several elements, or even none if the widget is invisible)
+     * 
+     * @param widget the widget of which we want the fragment
+     * @param locale the locale to be used to generate the fragment
+     * @return the document containing the fragment
+     */
+    public static Document getWidgetFragment(Widget widget, Locale locale) throws SAXException {
+        
+        DOMBuilder domBuilder = new DOMBuilder();
+        // Start document and "fi:fragment" root element
+        domBuilder.startDocument();
+        domBuilder.startPrefixMapping(FormsConstants.INSTANCE_PREFIX, FormsConstants.INSTANCE_NS);
+        // FIXME: why simply declaring the prefix isn't enough?
+        AttributesImpl attr = new AttributesImpl();
+        attr.addCDATAAttribute(NamespaceSupport.XMLNS, "fi:", "xmlns:fi", FormsConstants.INSTANCE_NS);
+        domBuilder.startElement(FormsConstants.INSTANCE_NS, "fragment", FormsConstants.INSTANCE_PREFIX_COLON + "fragment", attr);
+        
+        widget.generateSaxFragment(domBuilder, locale);
+        
+        // End "fi:fragment" element and document
+        domBuilder.endElement(FormsConstants.INSTANCE_NS, "fragment", FormsConstants.INSTANCE_PREFIX_COLON + "fragment");
+        domBuilder.endPrefixMapping(FormsConstants.INSTANCE_PREFIX);
+        domBuilder.endDocument();
+        
+        // Return the document
+        return domBuilder.getDocument();
+    }
+    
+    public static void assertXPathEquals(String expected, String xpath, Document doc) {
+        // use xpath as the message
+        assertXPathEquals(xpath, expected, xpath, doc);
+    }
+    
+    public static void assertXPathEquals(String message, String expected, String xpath, Document doc) {
+        JXPathContext ctx = JXPathContext.newContext(doc);
+        ctx.setLenient(true);
+        Assert.assertEquals(message, expected, ctx.getValue(xpath));
+    }
+    
+    public static void assertXPathExists(String xpath, Document doc) {
+        // use xpath as message
+        assertXPathExists(xpath, xpath, doc);
+    }
+    
+    public static void assertXPathExists(String message, String xpath, Document doc) {
+        JXPathContext ctx = JXPathContext.newContext(doc);
+        ctx.setLenient(true);
+        Pointer pointer = ctx.getPointer(xpath);
+        Assert.assertNotNull(message, pointer.getNode());
+    }
+    
+    public static void assertXPathNotExists(String xpath, Document doc) {
+        // use xpath as message
+        assertXPathNotExists(xpath, xpath, doc);
+    }
+    
+    public static void assertXPathNotExists(String message, String xpath, Document doc) {
+        JXPathContext ctx = JXPathContext.newContext(doc);
+        ctx.setLenient(true);
+        Pointer pointer = ctx.getPointer(xpath);
+        Assert.assertNull(message, pointer.getNode());
+    }
+    
+    /**
+     * Load a Form whose definition relative to a given object (typically, the TestCase class).
+     * 
+     * @param manager the ServiceManager that will be used to create the form
+     * @param obj the object relative to which the resource will be read
+     * @param resource the relative resource name for the form definition
+     * @return the Form
+     * @throws Exception
+     */
+    public static Form loadForm(ServiceManager manager, Object obj, String resource) throws Exception {
+        // Load the document
+        DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
+        // Grmbl... why isn't this true by default?
+        factory.setNamespaceAware(true);
+        DocumentBuilder parser = factory.newDocumentBuilder();  
+        Document doc = parser.parse(obj.getClass().getResource(resource).toExternalForm());
+
+        // Create the form
+        FormManager formManager = (FormManager)manager.lookup(FormManager.ROLE);
+        try {
+            return formManager.createForm(doc.getDocumentElement());
+        } finally {
+            manager.release(formManager);
+        }
+    }
+}

Propchange: cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/test/java/org/apache/cocoon/forms/formmodel/WidgetTestHelper.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/test/resources/org/apache/cocoon/forms/datatype/DynamicSelectionListTestCase.dest.xml
URL: http://svn.apache.org/viewcvs/cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/test/resources/org/apache/cocoon/forms/datatype/DynamicSelectionListTestCase.dest.xml?rev=330548&view=auto
==============================================================================
--- cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/test/resources/org/apache/cocoon/forms/datatype/DynamicSelectionListTestCase.dest.xml (added)
+++ cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/test/resources/org/apache/cocoon/forms/datatype/DynamicSelectionListTestCase.dest.xml Thu Nov  3 05:41:06 2005
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Copyright 1999-2004 The Apache Software Foundation
+
+  Licensed under the Apache License, Version 2.0 (the "License");
+  you may not use this file except in compliance with the License.
+  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+<fi:selection-list xmlns:fi="http://apache.org/cocoon/forms/1.0#instance">
+  
+  <fi:item value="10/11/03"><fi:label>10/11/03</fi:label></fi:item>
+  <fi:item value="2/4/63"><fi:label>My birthdate</fi:label></fi:item>
+</fi:selection-list>

Propchange: cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/test/resources/org/apache/cocoon/forms/datatype/DynamicSelectionListTestCase.dest.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/test/resources/org/apache/cocoon/forms/datatype/DynamicSelectionListTestCase.source.xml
URL: http://svn.apache.org/viewcvs/cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/test/resources/org/apache/cocoon/forms/datatype/DynamicSelectionListTestCase.source.xml?rev=330548&view=auto
==============================================================================
--- cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/test/resources/org/apache/cocoon/forms/datatype/DynamicSelectionListTestCase.source.xml (added)
+++ cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/test/resources/org/apache/cocoon/forms/datatype/DynamicSelectionListTestCase.source.xml Thu Nov  3 05:41:06 2005
@@ -0,0 +1,31 @@
+<?xml version="1.0"?>
+<!--
+  Copyright 1999-2004 The Apache Software Foundation
+
+  Licensed under the Apache License, Version 2.0 (the "License");
+  you may not use this file except in compliance with the License.
+  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+
+<!--+
+    |   Source file for DynamicSelectionList test case.
+    |   $Id: DynamicSelectionListTestCase.source.xml 149119 2005-01-30 10:20:07Z sylvain $
+    +-->
+
+<fd:selection-list xmlns:fd="http://apache.org/cocoon/forms/1.0#definition">
+  <fd:convertor type="formatting" base="date">
+    <fd:patterns>
+      <fd:pattern>yyyy-MM-dd</fd:pattern>
+    </fd:patterns>
+  </fd:convertor>
+  <fd:item value="2003-10-11"/>
+  <fd:item value="1963-02-04"><fd:label>My birthdate</fd:label></fd:item>
+</fd:selection-list>

Propchange: cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/test/resources/org/apache/cocoon/forms/datatype/DynamicSelectionListTestCase.source.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/test/resources/org/apache/cocoon/forms/datatype/EnumSelectionListTestCase.dest-no-null.xml
URL: http://svn.apache.org/viewcvs/cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/test/resources/org/apache/cocoon/forms/datatype/EnumSelectionListTestCase.dest-no-null.xml?rev=330548&view=auto
==============================================================================
--- cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/test/resources/org/apache/cocoon/forms/datatype/EnumSelectionListTestCase.dest-no-null.xml (added)
+++ cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/test/resources/org/apache/cocoon/forms/datatype/EnumSelectionListTestCase.dest-no-null.xml Thu Nov  3 05:41:06 2005
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Copyright 1999-2004 The Apache Software Foundation
+
+  Licensed under the Apache License, Version 2.0 (the "License");
+  you may not use this file except in compliance with the License.
+  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+<fi:selection-list
+  xmlns:fi="http://apache.org/cocoon/forms/1.0#instance"
+  xmlns:i18n="http://apache.org/cocoon/i18n/2.1"><fi:item value="org.apache.cocoon.forms.datatype.Sex.MALE"><fi:label><i18n:text>org.apache.cocoon.forms.datatype.Sex.MALE</i18n:text></fi:label></fi:item><fi:item value="org.apache.cocoon.forms.datatype.Sex.FEMALE"><fi:label><i18n:text>org.apache.cocoon.forms.datatype.Sex.FEMALE</i18n:text></fi:label></fi:item></fi:selection-list>

Propchange: cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/test/resources/org/apache/cocoon/forms/datatype/EnumSelectionListTestCase.dest-no-null.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/test/resources/org/apache/cocoon/forms/datatype/EnumSelectionListTestCase.dest.xml
URL: http://svn.apache.org/viewcvs/cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/test/resources/org/apache/cocoon/forms/datatype/EnumSelectionListTestCase.dest.xml?rev=330548&view=auto
==============================================================================
--- cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/test/resources/org/apache/cocoon/forms/datatype/EnumSelectionListTestCase.dest.xml (added)
+++ cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/test/resources/org/apache/cocoon/forms/datatype/EnumSelectionListTestCase.dest.xml Thu Nov  3 05:41:06 2005
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Copyright 1999-2004 The Apache Software Foundation
+
+  Licensed under the Apache License, Version 2.0 (the "License");
+  you may not use this file except in compliance with the License.
+  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+<fi:selection-list
+  xmlns:fi="http://apache.org/cocoon/forms/1.0#instance"
+  xmlns:i18n="http://apache.org/cocoon/i18n/2.1"><fi:item value=""/><fi:item value="org.apache.cocoon.forms.datatype.Sex.MALE"><fi:label><i18n:text>org.apache.cocoon.forms.datatype.Sex.MALE</i18n:text></fi:label></fi:item><fi:item value="org.apache.cocoon.forms.datatype.Sex.FEMALE"><fi:label><i18n:text>org.apache.cocoon.forms.datatype.Sex.FEMALE</i18n:text></fi:label></fi:item></fi:selection-list>

Propchange: cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/test/resources/org/apache/cocoon/forms/datatype/EnumSelectionListTestCase.dest.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/test/resources/org/apache/cocoon/forms/datatype/FlowJXPathSelectionListTestCase.dest.xml
URL: http://svn.apache.org/viewcvs/cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/test/resources/org/apache/cocoon/forms/datatype/FlowJXPathSelectionListTestCase.dest.xml?rev=330548&view=auto
==============================================================================
--- cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/test/resources/org/apache/cocoon/forms/datatype/FlowJXPathSelectionListTestCase.dest.xml (added)
+++ cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/test/resources/org/apache/cocoon/forms/datatype/FlowJXPathSelectionListTestCase.dest.xml Thu Nov  3 05:41:06 2005
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Copyright 1999-2004 The Apache Software Foundation
+
+  Licensed under the Apache License, Version 2.0 (the "License");
+  you may not use this file except in compliance with the License.
+  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+<fi:selection-list xmlns:fi="http://apache.org/cocoon/forms/1.0#instance"><fi:item value="1"><fi:label>One</fi:label></fi:item><fi:item value="2"><fi:label>Two</fi:label></fi:item></fi:selection-list>

Propchange: cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/test/resources/org/apache/cocoon/forms/datatype/FlowJXPathSelectionListTestCase.dest.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/test/resources/org/apache/cocoon/forms/datatype/FlowJXPathSelectionListTestCase.source.xml
URL: http://svn.apache.org/viewcvs/cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/test/resources/org/apache/cocoon/forms/datatype/FlowJXPathSelectionListTestCase.source.xml?rev=330548&view=auto
==============================================================================
--- cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/test/resources/org/apache/cocoon/forms/datatype/FlowJXPathSelectionListTestCase.source.xml (added)
+++ cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/test/resources/org/apache/cocoon/forms/datatype/FlowJXPathSelectionListTestCase.source.xml Thu Nov  3 05:41:06 2005
@@ -0,0 +1,27 @@
+<?xml version="1.0"?>
+<!--
+  Copyright 1999-2004 The Apache Software Foundation
+
+  Licensed under the Apache License, Version 2.0 (the "License");
+  you may not use this file except in compliance with the License.
+  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+
+<!--+
+    |   Source file for FlowModelSelectionList test case.
+    |   $Id: FlowJXPathSelectionListTestCase.source.xml 149119 2005-01-30 10:20:07Z sylvain $
+    +-->
+
+<fd:field xmlns:fd="http://apache.org/cocoon/forms/1.0#definition"
+  id="sample" required="false">
+  <fd:datatype base="string"/>
+  <fd:selection-list model="beans"/>
+</fd:field>

Propchange: cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/test/resources/org/apache/cocoon/forms/datatype/FlowJXPathSelectionListTestCase.source.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/test/resources/org/apache/cocoon/forms/datatype/FlowJXPathSelectionListTestCaseWithNull.dest.xml
URL: http://svn.apache.org/viewcvs/cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/test/resources/org/apache/cocoon/forms/datatype/FlowJXPathSelectionListTestCaseWithNull.dest.xml?rev=330548&view=auto
==============================================================================
--- cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/test/resources/org/apache/cocoon/forms/datatype/FlowJXPathSelectionListTestCaseWithNull.dest.xml (added)
+++ cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/test/resources/org/apache/cocoon/forms/datatype/FlowJXPathSelectionListTestCaseWithNull.dest.xml Thu Nov  3 05:41:06 2005
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Copyright 1999-2004 The Apache Software Foundation
+
+  Licensed under the Apache License, Version 2.0 (the "License");
+  you may not use this file except in compliance with the License.
+  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+<fi:selection-list xmlns:fi="http://apache.org/cocoon/forms/1.0#instance"><fi:item value=""/><fi:item value="1"><fi:label>One</fi:label></fi:item><fi:item value="2"><fi:label>Two</fi:label></fi:item></fi:selection-list>

Propchange: cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/test/resources/org/apache/cocoon/forms/datatype/FlowJXPathSelectionListTestCaseWithNull.dest.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/test/resources/org/apache/cocoon/forms/datatype/convertor/EnumConvertorTestCase.conf.xml
URL: http://svn.apache.org/viewcvs/cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/test/resources/org/apache/cocoon/forms/datatype/convertor/EnumConvertorTestCase.conf.xml?rev=330548&view=auto
==============================================================================
--- cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/test/resources/org/apache/cocoon/forms/datatype/convertor/EnumConvertorTestCase.conf.xml (added)
+++ cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/test/resources/org/apache/cocoon/forms/datatype/convertor/EnumConvertorTestCase.conf.xml Thu Nov  3 05:41:06 2005
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Copyright 1999-2004 The Apache Software Foundation
+
+  Licensed under the Apache License, Version 2.0 (the "License");
+  you may not use this file except in compliance with the License.
+  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+
+<fd:field id="sex" xmlns:fd="http://apache.org/cocoon/forms/1.0#definition">
+  <fd:label>Sex</fd:label>
+  <fd:datatype base="enum">
+  	<fd:convertor type="enum">
+      <fd:enum>org.apache.cocoon.forms.datatype.Sex</fd:enum>
+  	</fd:convertor>
+  </fd:datatype>
+  <fd:selection-list type="enum" class="org.apache.cocoon.forms.datatype.Sex"/>
+</fd:field>

Propchange: cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/test/resources/org/apache/cocoon/forms/datatype/convertor/EnumConvertorTestCase.conf.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/test/resources/org/apache/cocoon/forms/formmodel/FieldTestCase.model.xml
URL: http://svn.apache.org/viewcvs/cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/test/resources/org/apache/cocoon/forms/formmodel/FieldTestCase.model.xml?rev=330548&view=auto
==============================================================================
--- cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/test/resources/org/apache/cocoon/forms/formmodel/FieldTestCase.model.xml (added)
+++ cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/test/resources/org/apache/cocoon/forms/formmodel/FieldTestCase.model.xml Thu Nov  3 05:41:06 2005
@@ -0,0 +1,36 @@
+<?xml version="1.0"?>
+<!--
+  Copyright 2005 The Apache Software Foundation or its licensors,
+  as applicable.
+
+  Licensed under the Apache License, Version 2.0 (the "License");
+  you may not use this file except in compliance with the License.
+  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+<fd:form xmlns:fd="http://apache.org/cocoon/forms/1.0#definition">
+    <fd:widgets>
+        <fd:field id="stringfield">
+            <fd:datatype base="string"/>
+        </fd:field>
+        
+        <fd:field id="intfield">
+            <fd:datatype base="integer">
+                <fd:convertor type="plain"/>
+            </fd:datatype>
+            <fd:validation>
+                <fd:range min="10"/>
+            </fd:validation>
+        </fd:field>
+        
+        <fd:action id="action" action-command="blah"/>
+        
+    </fd:widgets>
+</fd:form>

Propchange: cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/test/resources/org/apache/cocoon/forms/formmodel/FieldTestCase.model.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/test/resources/org/apache/cocoon/forms/formmodel/GroupTestCase.model.xml
URL: http://svn.apache.org/viewcvs/cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/test/resources/org/apache/cocoon/forms/formmodel/GroupTestCase.model.xml?rev=330548&view=auto
==============================================================================
--- cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/test/resources/org/apache/cocoon/forms/formmodel/GroupTestCase.model.xml (added)
+++ cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/test/resources/org/apache/cocoon/forms/formmodel/GroupTestCase.model.xml Thu Nov  3 05:41:06 2005
@@ -0,0 +1,41 @@
+<?xml version="1.0"?>
+<!--
+  Copyright 2005 The Apache Software Foundation or its licensors,
+  as applicable.
+
+  Licensed under the Apache License, Version 2.0 (the "License");
+  you may not use this file except in compliance with the License.
+  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+<fd:form xmlns:fd="http://apache.org/cocoon/forms/1.0#definition">
+    <fd:widgets>
+        
+        <fd:group id="group1">
+            <fd:widgets>
+                <fd:field id="field1">
+                    <fd:label>Field1</fd:label>
+                    <fd:datatype base="integer"/>
+                 </fd:field>
+            </fd:widgets>
+        </fd:group>
+        
+        <fd:group id="group2" extends="group1">
+            <fd:widgets>
+                <fd:field id="field2">
+                    <fd:label>Field2</fd:label>
+                    <fd:datatype base="string"/>
+                </fd:field>
+                <fd:field id="field3" extends="field1"/>
+            </fd:widgets>
+        </fd:group>
+        
+    </fd:widgets>
+</fd:form>

Propchange: cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/test/resources/org/apache/cocoon/forms/formmodel/GroupTestCase.model.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/pom.xml
URL: http://svn.apache.org/viewcvs/cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/pom.xml?rev=330548&view=auto
==============================================================================
--- cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/pom.xml (added)
+++ cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/pom.xml Thu Nov  3 05:41:06 2005
@@ -0,0 +1,83 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Copyright 2005 The Apache Software Foundation
+  
+  Licensed under the Apache License, Version 2.0 (the "License");
+  you may not use this file except in compliance with the License.
+  You may obtain a copy of the License at
+  
+  http://www.apache.org/licenses/LICENSE-2.0
+  
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+<!--+
+  | @version $Id:$
+  |
+  +-->
+<project>
+  <parent>
+    <groupId>apache-cocoon</groupId>
+    <artifactId>cocoon</artifactId>
+    <version>2.2-SNAPSHOT</version>
+  </parent>
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>apache-cocoon</groupId>
+  <artifactId>cocoon-forms-block</artifactId>
+  <version>2.2-SNAPSHOT</version>
+  <name>Forms Block</name>
+  <packaging>pom</packaging>
+  <modules>
+    <module>api</module>
+    <module>impl</module>
+    <module>samples</module>
+  </modules>
+  <dependencies>
+    <dependency>
+      <groupId>apache-cocoon</groupId>
+      <artifactId>cocoon-core</artifactId>
+      <version>2.2-SNAPSHOT</version>
+    </dependency>
+    <!--
+    <dependency>
+      <groupId>apache-cocoon</groupId>
+      <artifactId>cocoon-core</artifactId>
+      <version>2.2-SNAPSHOT</version>
+      <classifier>tests</classifier>
+    </dependency>
+        -->
+    <dependency>
+      <groupId>apache-cocoon</groupId>
+      <artifactId>cocoon-ajax-impl</artifactId>
+      <version>2.2-SNAPSHOT</version>
+    </dependency>
+    <dependency>
+      <groupId>jakarta-oro</groupId>
+      <artifactId>jakarta-oro</artifactId>
+      <version>2.0.8</version>
+    </dependency>
+    <dependency>
+      <groupId>jakarta-regexp</groupId>
+      <artifactId>jakarta-regexp</artifactId>
+      <version>1.4</version>
+    </dependency>
+    <dependency>
+      <groupId>xreporter</groupId>
+      <artifactId>xreporter-expression</artifactId>
+      <version>20040701</version>
+    </dependency>
+    <dependency>
+      <groupId>daisy</groupId>
+      <artifactId>daisy-htmlcleaner</artifactId>
+      <version>1.1</version>
+    </dependency>
+    <dependency>
+      <groupId>icu4j</groupId>
+      <artifactId>icu4j</artifactId>
+      <version>3.0</version>
+    </dependency>
+  </dependencies>
+</project>
\ No newline at end of file

Propchange: cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/samples/pom.xml
URL: http://svn.apache.org/viewcvs/cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/samples/pom.xml?rev=330548&view=auto
==============================================================================
--- cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/samples/pom.xml (added)
+++ cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/samples/pom.xml Thu Nov  3 05:41:06 2005
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Copyright 2005 The Apache Software Foundation
+  
+  Licensed under the Apache License, Version 2.0 (the "License");
+  you may not use this file except in compliance with the License.
+  You may obtain a copy of the License at
+  
+  http://www.apache.org/licenses/LICENSE-2.0
+  
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+<!--+
+  | @version $Id:$
+  |
+  +-->
+<project>
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>apache-cocoon</groupId>
+  <artifactId>cocoon-forms-samples</artifactId>
+  <version>2.2-SNAPSHOT</version>
+  <packaging>jar</packaging>
+  <name>Forms Samples</name>
+  <dependencies>
+    <dependency>
+      <groupId>apache-cocoon</groupId>
+      <artifactId>cocoon-forms-impl</artifactId>
+      <version>2.2-SNAPSHOT</version>
+    </dependency>
+  </dependencies>
+</project>

Propchange: cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/samples/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message