You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by lu...@apache.org on 2008/10/01 01:11:09 UTC
svn commit: r700627 [6/9] - in /myfaces/tomahawk/trunk:
core/src/main/java/org/apache/myfaces/custom/calendar/
core/src/main/java/org/apache/myfaces/custom/inputTextHelp/
core/src/test/java/org/apache/myfaces/custom/calendar/
core/src/test/java/org/apa...
Propchange: myfaces/tomahawk/trunk/sandbox/core/src/test/java/org/apache/myfaces/custom/graphicimagedynamic/GraphicImageDynamicRendererTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: myfaces/tomahawk/trunk/sandbox/core/src/test/java/org/apache/myfaces/custom/graphicimagedynamic/GraphicImageDynamicRendererTest.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Added: myfaces/tomahawk/trunk/sandbox/core/src/test/java/org/apache/myfaces/custom/inputAjax/HtmlCommandButtonAjaxRendererTest.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/sandbox/core/src/test/java/org/apache/myfaces/custom/inputAjax/HtmlCommandButtonAjaxRendererTest.java?rev=700627&view=auto
==============================================================================
--- myfaces/tomahawk/trunk/sandbox/core/src/test/java/org/apache/myfaces/custom/inputAjax/HtmlCommandButtonAjaxRendererTest.java (added)
+++ myfaces/tomahawk/trunk/sandbox/core/src/test/java/org/apache/myfaces/custom/inputAjax/HtmlCommandButtonAjaxRendererTest.java Tue Sep 30 16:11:04 2008
@@ -0,0 +1,65 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.myfaces.custom.inputAjax;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+import org.apache.myfaces.test.AbstractTomahawkViewControllerTestCase;
+import org.apache.myfaces.test.utils.HtmlCheckAttributesUtil;
+import org.apache.myfaces.test.utils.HtmlRenderedAttr;
+import org.apache.shale.test.mock.MockResponseWriter;
+
+public class HtmlCommandButtonAjaxRendererTest extends AbstractTomahawkViewControllerTestCase
+{
+ private MockResponseWriter writer;
+ private HtmlCommandButtonAjax button;
+
+ public HtmlCommandButtonAjaxRendererTest(String name)
+ {
+ super(name);
+ }
+
+ public static Test suite() {
+ return new TestSuite(HtmlCommandButtonAjaxRendererTest.class);
+ }
+
+ public void setUp() throws Exception {
+ super.setUp();
+ writer = (MockResponseWriter)facesContext.getResponseWriter();
+ button = new HtmlCommandButtonAjax();
+ }
+
+ public void tearDown() {
+ writer = null;
+ button = null;
+ }
+
+ public void testHtmlPropertyPassTru() throws Exception
+ {
+ HtmlRenderedAttr[] attrs = HtmlCheckAttributesUtil.generateBasicAttrs();
+
+ HtmlCheckAttributesUtil.checkRenderedAttributes(
+ button, facesContext, writer, attrs);
+ if(HtmlCheckAttributesUtil.hasFailedAttrRender(attrs))
+ {
+ fail(HtmlCheckAttributesUtil.constructErrorMessage(attrs, writer.getWriter().toString()));
+ }
+ }
+}
Propchange: myfaces/tomahawk/trunk/sandbox/core/src/test/java/org/apache/myfaces/custom/inputAjax/HtmlCommandButtonAjaxRendererTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: myfaces/tomahawk/trunk/sandbox/core/src/test/java/org/apache/myfaces/custom/inputAjax/HtmlCommandButtonAjaxRendererTest.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Added: myfaces/tomahawk/trunk/sandbox/core/src/test/java/org/apache/myfaces/custom/inputAjax/HtmlInputTextAjaxRendererTest.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/sandbox/core/src/test/java/org/apache/myfaces/custom/inputAjax/HtmlInputTextAjaxRendererTest.java?rev=700627&view=auto
==============================================================================
--- myfaces/tomahawk/trunk/sandbox/core/src/test/java/org/apache/myfaces/custom/inputAjax/HtmlInputTextAjaxRendererTest.java (added)
+++ myfaces/tomahawk/trunk/sandbox/core/src/test/java/org/apache/myfaces/custom/inputAjax/HtmlInputTextAjaxRendererTest.java Tue Sep 30 16:11:04 2008
@@ -0,0 +1,94 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.myfaces.custom.inputAjax;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+import org.apache.myfaces.test.AbstractTomahawkViewControllerTestCase;
+import org.apache.myfaces.test.utils.HtmlCheckAttributesUtil;
+import org.apache.myfaces.test.utils.HtmlRenderedAttr;
+import org.apache.shale.test.mock.MockResponseWriter;
+
+public class HtmlInputTextAjaxRendererTest extends AbstractTomahawkViewControllerTestCase
+{
+ private MockResponseWriter writer;
+ private HtmlInputTextAjax inputText;
+
+ public HtmlInputTextAjaxRendererTest(String name)
+ {
+ super(name);
+ }
+
+ public static Test suite() {
+ return new TestSuite(HtmlInputTextAjaxRendererTest.class);
+ }
+
+ public void setUp() throws Exception {
+ super.setUp();
+ writer = (MockResponseWriter)facesContext.getResponseWriter();
+ inputText = new HtmlInputTextAjax();
+ }
+
+ public void tearDown() {
+ writer = null;
+ inputText = null;
+ }
+
+ public void testHtmlPropertyPassTru() throws Exception
+ {
+ HtmlRenderedAttr[] attrs = {
+ //_AccesskeyProperty
+ new HtmlRenderedAttr("accesskey"),
+ //_UniversalProperties
+ new HtmlRenderedAttr("dir"),
+ new HtmlRenderedAttr("lang"),
+ new HtmlRenderedAttr("title"),
+ //_FocusBlurProperties
+ new HtmlRenderedAttr("onfocus"),
+ new HtmlRenderedAttr("onblur"),
+ //_ChangeSelectProperties
+ new HtmlRenderedAttr("onchange", "onchange", "onchange=\"_MyFaces_inputAjax_ajaxSubmit1('_id0');onchange;\""),
+ new HtmlRenderedAttr("onselect"),
+ //_EventProperties
+ new HtmlRenderedAttr("onclick"),
+ new HtmlRenderedAttr("ondblclick"),
+ new HtmlRenderedAttr("onkeydown"),
+ new HtmlRenderedAttr("onkeypress"),
+ new HtmlRenderedAttr("onkeyup"),
+ new HtmlRenderedAttr("onmousedown"),
+ new HtmlRenderedAttr("onmousemove"),
+ new HtmlRenderedAttr("onmouseout"),
+ new HtmlRenderedAttr("onmouseover"),
+ new HtmlRenderedAttr("onmouseup"),
+ //_StyleProperties
+ new HtmlRenderedAttr("style"),
+ new HtmlRenderedAttr("styleClass", "styleClass", "class=\"myFacesInputSuggestAjax styleClass\""),
+ //_TabindexProperty
+ new HtmlRenderedAttr("tabindex")
+ };
+
+ HtmlCheckAttributesUtil.checkRenderedAttributes(
+ inputText, facesContext, writer, attrs);
+ if(HtmlCheckAttributesUtil.hasFailedAttrRender(attrs))
+ {
+ fail(HtmlCheckAttributesUtil.constructErrorMessage(attrs, writer.getWriter().toString()));
+ }
+ }
+}
Propchange: myfaces/tomahawk/trunk/sandbox/core/src/test/java/org/apache/myfaces/custom/inputAjax/HtmlInputTextAjaxRendererTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: myfaces/tomahawk/trunk/sandbox/core/src/test/java/org/apache/myfaces/custom/inputAjax/HtmlInputTextAjaxRendererTest.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Added: myfaces/tomahawk/trunk/sandbox/core/src/test/java/org/apache/myfaces/custom/inputAjax/HtmlMessageRendererTest.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/sandbox/core/src/test/java/org/apache/myfaces/custom/inputAjax/HtmlMessageRendererTest.java?rev=700627&view=auto
==============================================================================
--- myfaces/tomahawk/trunk/sandbox/core/src/test/java/org/apache/myfaces/custom/inputAjax/HtmlMessageRendererTest.java (added)
+++ myfaces/tomahawk/trunk/sandbox/core/src/test/java/org/apache/myfaces/custom/inputAjax/HtmlMessageRendererTest.java Tue Sep 30 16:11:04 2008
@@ -0,0 +1,129 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.myfaces.custom.inputAjax;
+
+import javax.faces.application.FacesMessage;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+import org.apache.myfaces.component.html.ext.HtmlInputText;
+import org.apache.myfaces.custom.form.HtmlForm;
+import org.apache.myfaces.test.AbstractTomahawkViewControllerTestCase;
+import org.apache.myfaces.test.utils.HtmlCheckAttributesUtil;
+import org.apache.myfaces.test.utils.HtmlRenderedAttr;
+import org.apache.shale.test.mock.MockResponseWriter;
+
+public class HtmlMessageRendererTest extends AbstractTomahawkViewControllerTestCase
+{
+ private static final String ERROR_CLASS = "errorClass";
+ private static final String WARN_CLASS = "warnClass";
+ private static final String INFO_CLASS = "infoClass";
+
+ private HtmlMessage message;
+ private HtmlForm form;
+ private HtmlInputText inputText;
+
+ public HtmlMessageRendererTest(String name)
+ {
+ super(name);
+ }
+
+ public static Test suite() {
+ return new TestSuite(HtmlMessageRendererTest.class);
+ }
+
+ public void setUp() throws Exception
+ {
+ super.setUp();
+
+ form = new HtmlForm();
+ inputText = new HtmlInputText();
+ inputText.setParent(form);
+ inputText.setId("myInputId");
+
+ message = new HtmlMessage();
+ message.setErrorClass(ERROR_CLASS);
+ message.setWarnClass(WARN_CLASS);
+ message.setInfoClass(INFO_CLASS);
+ message.setParent(form);
+
+ form.getChildren().add(inputText);
+ form.getChildren().add(message);
+
+ facesContext.addMessage(inputText.getClientId(facesContext),
+ new FacesMessage("Validation message here."));
+ }
+
+ public void tearDown() throws Exception
+ {
+ super.tearDown();
+ }
+
+ public void testHtmlPropertyPassTru() throws Exception
+ {
+ HtmlRenderedAttr[] attrs = {
+ //_UniversalProperties
+ new HtmlRenderedAttr("dir"),
+ new HtmlRenderedAttr("lang"),
+ new HtmlRenderedAttr("title"),
+ //_EventProperties
+ new HtmlRenderedAttr("onclick"),
+ new HtmlRenderedAttr("ondblclick"),
+ new HtmlRenderedAttr("onkeydown"),
+ new HtmlRenderedAttr("onkeypress"),
+ new HtmlRenderedAttr("onkeyup"),
+ new HtmlRenderedAttr("onmousedown"),
+ new HtmlRenderedAttr("onmousemove"),
+ new HtmlRenderedAttr("onmouseout"),
+ new HtmlRenderedAttr("onmouseover"),
+ new HtmlRenderedAttr("onmouseup"),
+ //_StyleProperties
+ new HtmlRenderedAttr("style"),
+ new HtmlRenderedAttr("styleClass", "styleClass", "class=\"infoClass\""),
+ };
+
+ facesContext.addMessage("test1", new FacesMessage(FacesMessage.SEVERITY_WARN, "warnSumary", "detailWarnSummary"));
+ message.setStyle("left: 48px; top: 432px; position: absolute");
+ message.setFor("myInputId");
+
+ MockResponseWriter writer = (MockResponseWriter)facesContext.getResponseWriter();
+ HtmlCheckAttributesUtil.checkRenderedAttributes(
+ message, facesContext, writer, attrs);
+ if(HtmlCheckAttributesUtil.hasFailedAttrRender(attrs)) {
+ fail(HtmlCheckAttributesUtil.constructErrorMessage(attrs, writer.getWriter().toString()));
+ }
+ }
+
+ public void testHtmlPropertyPassTruNotRendered() throws Exception
+ {
+ HtmlRenderedAttr[] attrs = HtmlCheckAttributesUtil.generateAttrsNotRenderedForReadOnly();
+
+ facesContext.addMessage("test1", new FacesMessage(FacesMessage.SEVERITY_WARN, "warnSumary", "detailWarnSummary"));
+ message.setStyle("left: 48px; top: 432px; position: absolute");
+ message.setFor("myInputId");
+
+ MockResponseWriter writer = (MockResponseWriter)facesContext.getResponseWriter();
+ HtmlCheckAttributesUtil.checkRenderedAttributes(
+ message, facesContext, writer, attrs);
+ if(HtmlCheckAttributesUtil.hasFailedAttrRender(attrs)) {
+ fail(HtmlCheckAttributesUtil.constructErrorMessage(attrs, writer.getWriter().toString()));
+ }
+ }
+}
Propchange: myfaces/tomahawk/trunk/sandbox/core/src/test/java/org/apache/myfaces/custom/inputAjax/HtmlMessageRendererTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: myfaces/tomahawk/trunk/sandbox/core/src/test/java/org/apache/myfaces/custom/inputAjax/HtmlMessageRendererTest.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Added: myfaces/tomahawk/trunk/sandbox/core/src/test/java/org/apache/myfaces/custom/inputAjax/HtmlSelectBooleanCheckboxAjaxRendererTest.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/sandbox/core/src/test/java/org/apache/myfaces/custom/inputAjax/HtmlSelectBooleanCheckboxAjaxRendererTest.java?rev=700627&view=auto
==============================================================================
--- myfaces/tomahawk/trunk/sandbox/core/src/test/java/org/apache/myfaces/custom/inputAjax/HtmlSelectBooleanCheckboxAjaxRendererTest.java (added)
+++ myfaces/tomahawk/trunk/sandbox/core/src/test/java/org/apache/myfaces/custom/inputAjax/HtmlSelectBooleanCheckboxAjaxRendererTest.java Tue Sep 30 16:11:04 2008
@@ -0,0 +1,102 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.myfaces.custom.inputAjax;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+
+import org.apache.myfaces.test.AbstractTomahawkViewControllerTestCase;
+import org.apache.myfaces.test.utils.HtmlCheckAttributesUtil;
+import org.apache.myfaces.test.utils.HtmlRenderedAttr;
+import org.apache.shale.test.mock.MockResponseWriter;
+
+public class HtmlSelectBooleanCheckboxAjaxRendererTest extends AbstractTomahawkViewControllerTestCase
+{
+ private MockResponseWriter writer ;
+ private HtmlSelectBooleanCheckboxAjax selectBooleanCheckbox;
+
+ public HtmlSelectBooleanCheckboxAjaxRendererTest(String name)
+ {
+ super(name);
+ }
+
+ public static Test suite() {
+ return new TestSuite(HtmlSelectBooleanCheckboxAjaxRendererTest.class);
+ }
+
+ public void setUp() throws Exception
+ {
+ super.setUp();
+
+ selectBooleanCheckbox = new HtmlSelectBooleanCheckboxAjax();
+
+ writer = (MockResponseWriter)facesContext.getResponseWriter();
+ }
+
+ public void tearDown() throws Exception
+ {
+ super.tearDown();
+ selectBooleanCheckbox = null;
+ writer = null;
+ }
+
+ public void testSelectBooleanHtmlPropertyPasstru() throws Exception
+ {
+ HtmlRenderedAttr[] attrs = {
+ //_AccesskeyProperty
+ new HtmlRenderedAttr("accesskey"),
+ //_UniversalProperties
+ new HtmlRenderedAttr("dir"),
+ new HtmlRenderedAttr("lang"),
+ new HtmlRenderedAttr("title"),
+ //_FocusBlurProperties
+ new HtmlRenderedAttr("onfocus"),
+ new HtmlRenderedAttr("onblur"),
+ //_ChangeSelectProperties
+ new HtmlRenderedAttr("onchange"),
+ new HtmlRenderedAttr("onselect"),
+ //_EventProperties
+ new HtmlRenderedAttr("onclick", "onclick", "onclick=\""),
+ new HtmlRenderedAttr("ondblclick"),
+ new HtmlRenderedAttr("onkeydown"),
+ new HtmlRenderedAttr("onkeypress"),
+ new HtmlRenderedAttr("onkeyup"),
+ new HtmlRenderedAttr("onmousedown"),
+ new HtmlRenderedAttr("onmousemove"),
+ new HtmlRenderedAttr("onmouseout"),
+ new HtmlRenderedAttr("onmouseover"),
+ new HtmlRenderedAttr("onmouseup"),
+ //_StyleProperties
+ new HtmlRenderedAttr("style"),
+ new HtmlRenderedAttr("styleClass", "styleClass", "class=\"styleClass\""),
+ //_TabindexProperty
+ new HtmlRenderedAttr("tabindex")
+ };
+
+ selectBooleanCheckbox.setSelected(true);
+
+ HtmlCheckAttributesUtil.checkRenderedAttributes(
+ selectBooleanCheckbox, facesContext, writer, attrs);
+ if(HtmlCheckAttributesUtil.hasFailedAttrRender(attrs)) {
+ fail(HtmlCheckAttributesUtil.constructErrorMessage(attrs, writer.getWriter().toString()));
+ }
+
+ }
+}
Propchange: myfaces/tomahawk/trunk/sandbox/core/src/test/java/org/apache/myfaces/custom/inputAjax/HtmlSelectBooleanCheckboxAjaxRendererTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: myfaces/tomahawk/trunk/sandbox/core/src/test/java/org/apache/myfaces/custom/inputAjax/HtmlSelectBooleanCheckboxAjaxRendererTest.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Added: myfaces/tomahawk/trunk/sandbox/core/src/test/java/org/apache/myfaces/custom/inputAjax/HtmlSelectManyCheckboxAjaxRendererTest.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/sandbox/core/src/test/java/org/apache/myfaces/custom/inputAjax/HtmlSelectManyCheckboxAjaxRendererTest.java?rev=700627&view=auto
==============================================================================
--- myfaces/tomahawk/trunk/sandbox/core/src/test/java/org/apache/myfaces/custom/inputAjax/HtmlSelectManyCheckboxAjaxRendererTest.java (added)
+++ myfaces/tomahawk/trunk/sandbox/core/src/test/java/org/apache/myfaces/custom/inputAjax/HtmlSelectManyCheckboxAjaxRendererTest.java Tue Sep 30 16:11:04 2008
@@ -0,0 +1,106 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.myfaces.custom.inputAjax;
+
+import javax.faces.component.UISelectItem;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+import org.apache.myfaces.test.AbstractTomahawkViewControllerTestCase;
+import org.apache.myfaces.test.utils.HtmlCheckAttributesUtil;
+import org.apache.myfaces.test.utils.HtmlRenderedAttr;
+import org.apache.shale.test.mock.MockResponseWriter;
+
+public class HtmlSelectManyCheckboxAjaxRendererTest extends AbstractTomahawkViewControllerTestCase
+{
+ private MockResponseWriter writer ;
+ private HtmlSelectManyCheckboxAjax selectManyCheckbox;
+
+ public HtmlSelectManyCheckboxAjaxRendererTest(String name)
+ {
+ super(name);
+ }
+
+ public static Test suite() {
+ return new TestSuite(HtmlSelectManyCheckboxAjaxRendererTest.class);
+ }
+
+ public void setUp() throws Exception
+ {
+ super.setUp();
+
+ selectManyCheckbox = new HtmlSelectManyCheckboxAjax();
+
+ writer = (MockResponseWriter)facesContext.getResponseWriter();
+ }
+
+ public void tearDown() throws Exception
+ {
+ super.tearDown();
+ selectManyCheckbox = null;
+ writer = null;
+ }
+
+ public void testSelectManyHtmlPropertyPassTru() throws Exception
+ {
+ HtmlRenderedAttr[] attrs = {
+ //_AccesskeyProperty
+ new HtmlRenderedAttr("accesskey"),
+ //_UniversalProperties
+ new HtmlRenderedAttr("dir"),
+ new HtmlRenderedAttr("lang"),
+ new HtmlRenderedAttr("title"),
+ //_FocusBlurProperties
+ new HtmlRenderedAttr("onfocus"),
+ new HtmlRenderedAttr("onblur"),
+ //_ChangeSelectProperties
+ new HtmlRenderedAttr("onchange"),
+ new HtmlRenderedAttr("onselect"),
+ //_EventProperties
+ new HtmlRenderedAttr("onclick", "onclick", "onclick=\""),
+ new HtmlRenderedAttr("ondblclick"),
+ new HtmlRenderedAttr("onkeydown"),
+ new HtmlRenderedAttr("onkeypress"),
+ new HtmlRenderedAttr("onkeyup"),
+ new HtmlRenderedAttr("onmousedown"),
+ new HtmlRenderedAttr("onmousemove"),
+ new HtmlRenderedAttr("onmouseout"),
+ new HtmlRenderedAttr("onmouseover"),
+ new HtmlRenderedAttr("onmouseup"),
+ //_StyleProperties
+ new HtmlRenderedAttr("style", 2),
+ new HtmlRenderedAttr("styleClass", "styleClass", "class=\"styleClass\"", 2),
+ //_TabindexProperty
+ new HtmlRenderedAttr("tabindex")
+ };
+
+ UISelectItem item = new UISelectItem();
+ item.setItemLabel("mars");
+ item.setItemValue("mars");
+ selectManyCheckbox.getChildren().add(item);
+
+ HtmlCheckAttributesUtil.checkRenderedAttributes(
+ selectManyCheckbox, facesContext, writer, attrs);
+ if(HtmlCheckAttributesUtil.hasFailedAttrRender(attrs))
+ {
+ fail(HtmlCheckAttributesUtil.constructErrorMessage(attrs, writer.getWriter().toString()));
+ }
+ }
+}
Propchange: myfaces/tomahawk/trunk/sandbox/core/src/test/java/org/apache/myfaces/custom/inputAjax/HtmlSelectManyCheckboxAjaxRendererTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: myfaces/tomahawk/trunk/sandbox/core/src/test/java/org/apache/myfaces/custom/inputAjax/HtmlSelectManyCheckboxAjaxRendererTest.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Added: myfaces/tomahawk/trunk/sandbox/core/src/test/java/org/apache/myfaces/custom/inputAjax/HtmlSelectOneRadioAjaxRendererTest.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/sandbox/core/src/test/java/org/apache/myfaces/custom/inputAjax/HtmlSelectOneRadioAjaxRendererTest.java?rev=700627&view=auto
==============================================================================
--- myfaces/tomahawk/trunk/sandbox/core/src/test/java/org/apache/myfaces/custom/inputAjax/HtmlSelectOneRadioAjaxRendererTest.java (added)
+++ myfaces/tomahawk/trunk/sandbox/core/src/test/java/org/apache/myfaces/custom/inputAjax/HtmlSelectOneRadioAjaxRendererTest.java Tue Sep 30 16:11:04 2008
@@ -0,0 +1,108 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.myfaces.custom.inputAjax;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.faces.component.UISelectItems;
+import javax.faces.model.SelectItem;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+import org.apache.myfaces.test.AbstractTomahawkViewControllerTestCase;
+import org.apache.myfaces.test.utils.HtmlCheckAttributesUtil;
+import org.apache.myfaces.test.utils.HtmlRenderedAttr;
+import org.apache.shale.test.mock.MockResponseWriter;
+
+public class HtmlSelectOneRadioAjaxRendererTest extends AbstractTomahawkViewControllerTestCase
+{
+ private HtmlSelectOneRadioAjax selectOneRadio;
+
+ public HtmlSelectOneRadioAjaxRendererTest(String name)
+ {
+ super(name);
+ }
+
+ public static Test suite() {
+ return new TestSuite(HtmlSelectOneRadioAjaxRendererTest.class);
+ }
+
+ public void setUp() throws Exception
+ {
+ super.setUp();
+ selectOneRadio = new HtmlSelectOneRadioAjax();
+ }
+
+ public void tearDown() throws Exception
+ {
+ super.tearDown();
+ selectOneRadio = null;
+ }
+
+ public void testHtmlPropertyPassTru() throws Exception
+ {
+ HtmlRenderedAttr[] attrs = {
+ //_AccesskeyProperty
+ new HtmlRenderedAttr("accesskey"),
+ //_UniversalProperties
+ new HtmlRenderedAttr("dir"),
+ new HtmlRenderedAttr("lang"),
+ new HtmlRenderedAttr("title"),
+ //_FocusBlurProperties
+ new HtmlRenderedAttr("onfocus"),
+ new HtmlRenderedAttr("onblur"),
+ //_ChangeSelectProperties
+ new HtmlRenderedAttr("onchange"),
+ new HtmlRenderedAttr("onselect"),
+ //_EventProperties
+ new HtmlRenderedAttr("onclick", "onclick", "onclick=\""),
+ new HtmlRenderedAttr("ondblclick"),
+ new HtmlRenderedAttr("onkeydown"),
+ new HtmlRenderedAttr("onkeypress"),
+ new HtmlRenderedAttr("onkeyup"),
+ new HtmlRenderedAttr("onmousedown"),
+ new HtmlRenderedAttr("onmousemove"),
+ new HtmlRenderedAttr("onmouseout"),
+ new HtmlRenderedAttr("onmouseover"),
+ new HtmlRenderedAttr("onmouseup"),
+ //_StyleProperties
+ new HtmlRenderedAttr("style", 2),
+ new HtmlRenderedAttr("styleClass", "styleClass", "class=\"styleClass\"", 2),
+ //_TabindexProperty
+ new HtmlRenderedAttr("tabindex")
+ };
+
+ List items = new ArrayList();
+ items.add(new SelectItem("mars"));
+
+ UISelectItems selectItems = new UISelectItems();
+ selectItems.setValue(items);
+
+ selectOneRadio.getChildren().add(selectItems);
+
+ MockResponseWriter writer = (MockResponseWriter)facesContext.getResponseWriter();
+ HtmlCheckAttributesUtil.checkRenderedAttributes(
+ selectOneRadio, facesContext, writer, attrs);
+ if(HtmlCheckAttributesUtil.hasFailedAttrRender(attrs)) {
+ fail(HtmlCheckAttributesUtil.constructErrorMessage(attrs, writer.getWriter().toString()));
+ }
+ }
+}
Propchange: myfaces/tomahawk/trunk/sandbox/core/src/test/java/org/apache/myfaces/custom/inputAjax/HtmlSelectOneRadioAjaxRendererTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: myfaces/tomahawk/trunk/sandbox/core/src/test/java/org/apache/myfaces/custom/inputAjax/HtmlSelectOneRadioAjaxRendererTest.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Added: myfaces/tomahawk/trunk/sandbox/core/src/test/java/org/apache/myfaces/custom/outputlinkdynamic/OutputLinkDynamicRendererTest.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/sandbox/core/src/test/java/org/apache/myfaces/custom/outputlinkdynamic/OutputLinkDynamicRendererTest.java?rev=700627&view=auto
==============================================================================
--- myfaces/tomahawk/trunk/sandbox/core/src/test/java/org/apache/myfaces/custom/outputlinkdynamic/OutputLinkDynamicRendererTest.java (added)
+++ myfaces/tomahawk/trunk/sandbox/core/src/test/java/org/apache/myfaces/custom/outputlinkdynamic/OutputLinkDynamicRendererTest.java Tue Sep 30 16:11:04 2008
@@ -0,0 +1,67 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.myfaces.custom.outputlinkdynamic;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+import org.apache.myfaces.test.AbstractTomahawkViewControllerTestCase;
+import org.apache.myfaces.test.utils.HtmlCheckAttributesUtil;
+import org.apache.myfaces.test.utils.HtmlRenderedAttr;
+import org.apache.shale.test.mock.MockResponseWriter;
+
+public class OutputLinkDynamicRendererTest extends AbstractTomahawkViewControllerTestCase
+{
+ private MockResponseWriter writer;
+ private OutputLinkDynamic outputLink;
+
+ public OutputLinkDynamicRendererTest(String name)
+ {
+ super(name);
+ }
+
+ public static Test suite() {
+ return new TestSuite(OutputLinkDynamicRendererTest.class);
+ }
+
+ public void setUp() throws Exception {
+ super.setUp();
+ writer = (MockResponseWriter)facesContext.getResponseWriter();
+ outputLink = new OutputLinkDynamic();
+ }
+
+ public void tearDown() {
+ writer = null;
+ outputLink = null;
+ }
+
+ public void testHtmlPropertyPassTru() throws Exception
+ {
+ HtmlRenderedAttr[] attrs = HtmlCheckAttributesUtil.generateBasicAttrs();
+
+ outputLink.setImageRendererClass(TestResourceRenderer.class);
+
+ HtmlCheckAttributesUtil.checkRenderedAttributes(
+ outputLink, facesContext, writer, attrs);
+ if(HtmlCheckAttributesUtil.hasFailedAttrRender(attrs))
+ {
+ fail(HtmlCheckAttributesUtil.constructErrorMessage(attrs, writer.getWriter().toString()));
+ }
+ }
+}
Propchange: myfaces/tomahawk/trunk/sandbox/core/src/test/java/org/apache/myfaces/custom/outputlinkdynamic/OutputLinkDynamicRendererTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: myfaces/tomahawk/trunk/sandbox/core/src/test/java/org/apache/myfaces/custom/outputlinkdynamic/OutputLinkDynamicRendererTest.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Added: myfaces/tomahawk/trunk/sandbox/core/src/test/java/org/apache/myfaces/custom/outputlinkdynamic/TestResourceRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/sandbox/core/src/test/java/org/apache/myfaces/custom/outputlinkdynamic/TestResourceRenderer.java?rev=700627&view=auto
==============================================================================
--- myfaces/tomahawk/trunk/sandbox/core/src/test/java/org/apache/myfaces/custom/outputlinkdynamic/TestResourceRenderer.java (added)
+++ myfaces/tomahawk/trunk/sandbox/core/src/test/java/org/apache/myfaces/custom/outputlinkdynamic/TestResourceRenderer.java Tue Sep 30 16:11:04 2008
@@ -0,0 +1,49 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.myfaces.custom.outputlinkdynamic;
+
+import javax.faces.context.FacesContext;
+import javax.faces.context.ResponseStream;
+
+import org.apache.myfaces.custom.dynamicResources.ResourceContext;
+import org.apache.myfaces.custom.dynamicResources.ResourceRenderer;
+
+public class TestResourceRenderer implements ResourceRenderer
+{
+ public void renderResource(ResponseStream stream)
+ {
+ //do nothing
+ }
+
+ public int getContentLength()
+ {
+ return 0;
+ }
+
+ public String getContentType()
+ {
+ return null;
+ }
+
+ public void setContext(FacesContext facesContext,
+ ResourceContext resourceContext) throws Exception
+ {
+ //do nothing
+ }
+}
Propchange: myfaces/tomahawk/trunk/sandbox/core/src/test/java/org/apache/myfaces/custom/outputlinkdynamic/TestResourceRenderer.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: myfaces/tomahawk/trunk/sandbox/core/src/test/java/org/apache/myfaces/custom/outputlinkdynamic/TestResourceRenderer.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Added: myfaces/tomahawk/trunk/sandbox/core/src/test/java/org/apache/myfaces/custom/passwordStrength/PasswordStrengthRendererTest.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/sandbox/core/src/test/java/org/apache/myfaces/custom/passwordStrength/PasswordStrengthRendererTest.java?rev=700627&view=auto
==============================================================================
--- myfaces/tomahawk/trunk/sandbox/core/src/test/java/org/apache/myfaces/custom/passwordStrength/PasswordStrengthRendererTest.java (added)
+++ myfaces/tomahawk/trunk/sandbox/core/src/test/java/org/apache/myfaces/custom/passwordStrength/PasswordStrengthRendererTest.java Tue Sep 30 16:11:04 2008
@@ -0,0 +1,91 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.myfaces.custom.passwordStrength;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+import org.apache.myfaces.test.AbstractTomahawkViewControllerTestCase;
+import org.apache.myfaces.test.utils.HtmlCheckAttributesUtil;
+import org.apache.myfaces.test.utils.HtmlRenderedAttr;
+import org.apache.shale.test.mock.MockResponseWriter;
+
+public class PasswordStrengthRendererTest extends AbstractTomahawkViewControllerTestCase
+{
+ private MockResponseWriter writer;
+ private PasswordStrengthComponent passwordStrength;
+
+ public PasswordStrengthRendererTest(String name)
+ {
+ super(name);
+ }
+
+ public static Test suite() {
+ return new TestSuite(PasswordStrengthRendererTest.class);
+ }
+
+ public void setUp() throws Exception {
+ super.setUp();
+ writer = (MockResponseWriter)facesContext.getResponseWriter();
+ passwordStrength = new PasswordStrengthComponent();
+ }
+
+ public void tearDown() {
+ writer = null;
+ passwordStrength = null;
+ }
+
+ public void testHtmlPropertyPassTru() throws Exception
+ {
+ HtmlRenderedAttr[] attrs = {
+ //_AccesskeyProperty
+ new HtmlRenderedAttr("accesskey"),
+ //_UniversalProperties
+ new HtmlRenderedAttr("dir"),
+ new HtmlRenderedAttr("lang"),
+ new HtmlRenderedAttr("title"),
+ //_FocusBlurProperties
+ new HtmlRenderedAttr("onfocus"),
+ new HtmlRenderedAttr("onblur", "onblur", "onblur=\""),
+ //_EventProperties
+ new HtmlRenderedAttr("onclick"),
+ new HtmlRenderedAttr("ondblclick"),
+ new HtmlRenderedAttr("onkeydown"),
+ new HtmlRenderedAttr("onkeypress"),
+ new HtmlRenderedAttr("onkeyup", "onkeyup", "onkeyup=\""),
+ new HtmlRenderedAttr("onmousedown"),
+ new HtmlRenderedAttr("onmousemove"),
+ new HtmlRenderedAttr("onmouseout"),
+ new HtmlRenderedAttr("onmouseover"),
+ new HtmlRenderedAttr("onmouseup"),
+ //_StyleProperties
+ new HtmlRenderedAttr("style"),
+ new HtmlRenderedAttr("styleClass", "styleClass", "class=\"styleClass\""),
+ //_TabindexProperty
+ new HtmlRenderedAttr("tabindex")
+ };
+
+ HtmlCheckAttributesUtil.checkRenderedAttributes(
+ passwordStrength, facesContext, writer, attrs);
+ if(HtmlCheckAttributesUtil.hasFailedAttrRender(attrs))
+ {
+ fail(HtmlCheckAttributesUtil.constructErrorMessage(attrs, writer.getWriter().toString()));
+ }
+ }
+}
Propchange: myfaces/tomahawk/trunk/sandbox/core/src/test/java/org/apache/myfaces/custom/passwordStrength/PasswordStrengthRendererTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: myfaces/tomahawk/trunk/sandbox/core/src/test/java/org/apache/myfaces/custom/passwordStrength/PasswordStrengthRendererTest.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Added: myfaces/tomahawk/trunk/sandbox/core/src/test/java/org/apache/myfaces/custom/ppr/PPRPanelGroupRendererTest.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/sandbox/core/src/test/java/org/apache/myfaces/custom/ppr/PPRPanelGroupRendererTest.java?rev=700627&view=auto
==============================================================================
--- myfaces/tomahawk/trunk/sandbox/core/src/test/java/org/apache/myfaces/custom/ppr/PPRPanelGroupRendererTest.java (added)
+++ myfaces/tomahawk/trunk/sandbox/core/src/test/java/org/apache/myfaces/custom/ppr/PPRPanelGroupRendererTest.java Tue Sep 30 16:11:04 2008
@@ -0,0 +1,92 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.myfaces.custom.ppr;
+
+import javax.faces.component.html.HtmlCommandButton;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+import org.apache.myfaces.component.html.ext.HtmlPanelGroup;
+import org.apache.myfaces.custom.form.HtmlForm;
+import org.apache.myfaces.test.AbstractTomahawkViewControllerTestCase;
+import org.apache.myfaces.test.utils.HtmlCheckAttributesUtil;
+import org.apache.myfaces.test.utils.HtmlRenderedAttr;
+import org.apache.shale.test.mock.MockResponseWriter;
+
+public class PPRPanelGroupRendererTest extends AbstractTomahawkViewControllerTestCase
+{
+ private MockResponseWriter writer;
+ private PPRPanelGroup panelGroup;
+
+ public PPRPanelGroupRendererTest(String name)
+ {
+ super(name);
+ }
+
+ public static Test suite() {
+ return new TestSuite(PPRPanelGroupRendererTest.class);
+ }
+
+ public void setUp() throws Exception {
+ super.setUp();
+ writer = (MockResponseWriter)facesContext.getResponseWriter();
+ panelGroup = new PPRPanelGroup();
+
+ HtmlForm form = new HtmlForm();
+ HtmlPanelGroup pg = new HtmlPanelGroup();
+ HtmlCommandButton btn = new HtmlCommandButton();
+ form.getChildren().add(pg);
+ pg.getChildren().add(panelGroup);
+ pg.getChildren().add(btn);
+
+ btn.setId("triggerButton");
+ panelGroup.setId("pprPanel");
+ panelGroup.setPartialTriggerPattern("triggerButton");
+ }
+
+ public void tearDown() {
+ writer = null;
+ panelGroup = null;
+ }
+
+ public void testHtmlPropertyPassTru() throws Exception
+ {
+ HtmlRenderedAttr[] attrs = HtmlCheckAttributesUtil.generateBasicReadOnlyAttrs();
+
+ HtmlCheckAttributesUtil.checkRenderedAttributes(
+ panelGroup, facesContext, writer, attrs);
+ if(HtmlCheckAttributesUtil.hasFailedAttrRender(attrs))
+ {
+ fail(HtmlCheckAttributesUtil.constructErrorMessage(attrs, writer.getWriter().toString()));
+ }
+ }
+
+ public void testHtmlPropertyPassTruNotRendered() throws Exception
+ {
+ HtmlRenderedAttr[] attrs = HtmlCheckAttributesUtil.generateAttrsNotRenderedForReadOnly();
+
+ HtmlCheckAttributesUtil.checkRenderedAttributes(
+ panelGroup, facesContext, writer, attrs);
+ if(HtmlCheckAttributesUtil.hasFailedAttrRender(attrs))
+ {
+ fail(HtmlCheckAttributesUtil.constructErrorMessage(attrs, writer.getWriter().toString()));
+ }
+ }
+}
Propchange: myfaces/tomahawk/trunk/sandbox/core/src/test/java/org/apache/myfaces/custom/ppr/PPRPanelGroupRendererTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: myfaces/tomahawk/trunk/sandbox/core/src/test/java/org/apache/myfaces/custom/ppr/PPRPanelGroupRendererTest.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Added: myfaces/tomahawk/trunk/sandbox/core/src/test/java/org/apache/myfaces/custom/roundeddiv/HtmlRoundedDivRendererTest.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/sandbox/core/src/test/java/org/apache/myfaces/custom/roundeddiv/HtmlRoundedDivRendererTest.java?rev=700627&view=auto
==============================================================================
--- myfaces/tomahawk/trunk/sandbox/core/src/test/java/org/apache/myfaces/custom/roundeddiv/HtmlRoundedDivRendererTest.java (added)
+++ myfaces/tomahawk/trunk/sandbox/core/src/test/java/org/apache/myfaces/custom/roundeddiv/HtmlRoundedDivRendererTest.java Tue Sep 30 16:11:04 2008
@@ -0,0 +1,108 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.myfaces.custom.roundeddiv;
+
+import javax.servlet.ServletContext;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+import org.apache.myfaces.shared_tomahawk.config.MyfacesConfig;
+import org.apache.myfaces.test.AbstractTomahawkViewControllerTestCase;
+import org.apache.myfaces.test.utils.HtmlCheckAttributesUtil;
+import org.apache.myfaces.test.utils.HtmlRenderedAttr;
+import org.apache.myfaces.test.utils.MockTestExternalContext;
+import org.apache.myfaces.test.utils.MockTestViewHandler;
+import org.apache.shale.test.mock.MockHttpServletRequest;
+import org.apache.shale.test.mock.MockHttpServletResponse;
+import org.apache.shale.test.mock.MockResponseWriter;
+import org.apache.shale.test.mock.MockServletContext;
+
+public class HtmlRoundedDivRendererTest extends AbstractTomahawkViewControllerTestCase
+{
+ private MockResponseWriter writer;
+ private HtmlRoundedDiv roundedDiv;
+
+ public HtmlRoundedDivRendererTest(String name)
+ {
+ super(name);
+ }
+
+ public static Test suite() {
+ return new TestSuite(HtmlRoundedDivRendererTest.class);
+ }
+
+ public void setUp() throws Exception {
+ super.setUp();
+ application.setViewHandler(new MockTestViewHandler());
+ writer = (MockResponseWriter)facesContext.getResponseWriter();
+ roundedDiv = new HtmlRoundedDiv();
+
+ MockTestExternalContext extCtx =
+ new MockTestExternalContext(
+ (ServletContext)new MockServletContext(),
+ (HttpServletRequest)new MockHttpServletRequest(),
+ (HttpServletResponse)new MockHttpServletResponse());
+ extCtx.getApplicationMap().put(
+ MyfacesConfig.class.getName(), new MyfacesConfig());
+ facesContext.setExternalContext(extCtx);
+ }
+
+ public void tearDown() {
+ writer = null;
+ roundedDiv = null;
+ }
+
+ public void testHtmlPropertyPassTru() throws Exception
+ {
+ HtmlRenderedAttr[] attrs = {
+ //_UniversalProperties
+ new HtmlRenderedAttr("dir"),
+ new HtmlRenderedAttr("lang"),
+ new HtmlRenderedAttr("title"),
+ //_EventProperties
+ new HtmlRenderedAttr("onclick"),
+ new HtmlRenderedAttr("ondblclick"),
+ new HtmlRenderedAttr("onkeydown"),
+ new HtmlRenderedAttr("onkeypress"),
+ new HtmlRenderedAttr("onkeyup"),
+ new HtmlRenderedAttr("onmousedown"),
+ new HtmlRenderedAttr("onmousemove"),
+ new HtmlRenderedAttr("onmouseout"),
+ new HtmlRenderedAttr("onmouseover"),
+ new HtmlRenderedAttr("onmouseup"),
+ //_StyleProperties
+ new HtmlRenderedAttr("style", "style", "style=\"style;position: relative;\""),
+ new HtmlRenderedAttr("styleClass", "styleClass", "class=\"styleClass\""),
+ };
+
+ try {
+ HtmlCheckAttributesUtil.checkRenderedAttributes(
+ roundedDiv, facesContext, writer, attrs);
+ if(HtmlCheckAttributesUtil.hasFailedAttrRender(attrs))
+ {
+ fail(HtmlCheckAttributesUtil.constructErrorMessage(attrs, writer.getWriter().toString()));
+ }
+ } catch(Exception e) {
+ e.printStackTrace();
+ }
+ }
+}
Propchange: myfaces/tomahawk/trunk/sandbox/core/src/test/java/org/apache/myfaces/custom/roundeddiv/HtmlRoundedDivRendererTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: myfaces/tomahawk/trunk/sandbox/core/src/test/java/org/apache/myfaces/custom/roundeddiv/HtmlRoundedDivRendererTest.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Added: myfaces/tomahawk/trunk/sandbox/core/src/test/java/org/apache/myfaces/custom/suggest/InputSuggestRendererTest.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/sandbox/core/src/test/java/org/apache/myfaces/custom/suggest/InputSuggestRendererTest.java?rev=700627&view=auto
==============================================================================
--- myfaces/tomahawk/trunk/sandbox/core/src/test/java/org/apache/myfaces/custom/suggest/InputSuggestRendererTest.java (added)
+++ myfaces/tomahawk/trunk/sandbox/core/src/test/java/org/apache/myfaces/custom/suggest/InputSuggestRendererTest.java Tue Sep 30 16:11:04 2008
@@ -0,0 +1,79 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.myfaces.custom.suggest;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.faces.component.UISelectItems;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+import org.apache.myfaces.test.AbstractTomahawkViewControllerTestCase;
+import org.apache.myfaces.test.utils.HtmlCheckAttributesUtil;
+import org.apache.myfaces.test.utils.HtmlRenderedAttr;
+import org.apache.shale.test.mock.MockResponseWriter;
+
+public class InputSuggestRendererTest extends AbstractTomahawkViewControllerTestCase
+{
+ private MockResponseWriter writer;
+ private InputSuggest inputSuggest;
+
+ public InputSuggestRendererTest(String name)
+ {
+ super(name);
+ }
+
+ public static Test suite() {
+ return new TestSuite(InputSuggestRendererTest.class);
+ }
+
+ public void setUp() throws Exception {
+ super.setUp();
+ writer = (MockResponseWriter)facesContext.getResponseWriter();
+ inputSuggest = new InputSuggest();
+
+ UISelectItems items = new UISelectItems();
+
+ Map choices = new HashMap();
+ choices.put("mars", "mars");
+
+ items.setValue(choices);
+ inputSuggest.getChildren().add(items);
+ }
+
+ public void tearDown() {
+ writer = null;
+ inputSuggest = null;
+ }
+
+ public void testHtmlPropertyPassTru() throws Exception
+ {
+ HtmlRenderedAttr[] attrs = HtmlCheckAttributesUtil.generateBasicAttrs();
+
+
+ HtmlCheckAttributesUtil.checkRenderedAttributes(
+ inputSuggest, facesContext, writer, attrs);
+ if(HtmlCheckAttributesUtil.hasFailedAttrRender(attrs))
+ {
+ fail(HtmlCheckAttributesUtil.constructErrorMessage(attrs, writer.getWriter().toString()));
+ }
+ }
+}
Propchange: myfaces/tomahawk/trunk/sandbox/core/src/test/java/org/apache/myfaces/custom/suggest/InputSuggestRendererTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: myfaces/tomahawk/trunk/sandbox/core/src/test/java/org/apache/myfaces/custom/suggest/InputSuggestRendererTest.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Added: myfaces/tomahawk/trunk/sandbox/core/src/test/java/org/apache/myfaces/custom/suggestajax/SuggestAjaxRendererTest.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/sandbox/core/src/test/java/org/apache/myfaces/custom/suggestajax/SuggestAjaxRendererTest.java?rev=700627&view=auto
==============================================================================
--- myfaces/tomahawk/trunk/sandbox/core/src/test/java/org/apache/myfaces/custom/suggestajax/SuggestAjaxRendererTest.java (added)
+++ myfaces/tomahawk/trunk/sandbox/core/src/test/java/org/apache/myfaces/custom/suggestajax/SuggestAjaxRendererTest.java Tue Sep 30 16:11:04 2008
@@ -0,0 +1,66 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.myfaces.custom.suggestajax;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+import org.apache.myfaces.custom.suggestajax.inputsuggestajax.InputSuggestAjax;
+import org.apache.myfaces.test.AbstractTomahawkViewControllerTestCase;
+import org.apache.myfaces.test.utils.HtmlCheckAttributesUtil;
+import org.apache.myfaces.test.utils.HtmlRenderedAttr;
+import org.apache.shale.test.mock.MockResponseWriter;
+
+public class SuggestAjaxRendererTest extends AbstractTomahawkViewControllerTestCase
+{
+ private MockResponseWriter writer;
+ private InputSuggestAjax suggestAjax;
+
+ public SuggestAjaxRendererTest(String name)
+ {
+ super(name);
+ }
+
+ public static Test suite() {
+ return new TestSuite(SuggestAjaxRendererTest.class);
+ }
+
+ public void setUp() throws Exception {
+ super.setUp();
+ writer = (MockResponseWriter)facesContext.getResponseWriter();
+ suggestAjax = new InputSuggestAjax();
+ }
+
+ public void tearDown() {
+ writer = null;
+ suggestAjax = null;
+ }
+
+ public void testHtmlPropertyPassTru() throws Exception
+ {
+ HtmlRenderedAttr[] attrs = HtmlCheckAttributesUtil.generateBasicAttrs();
+
+ HtmlCheckAttributesUtil.checkRenderedAttributes(
+ suggestAjax, facesContext, writer, attrs);
+ if(HtmlCheckAttributesUtil.hasFailedAttrRender(attrs))
+ {
+ fail(HtmlCheckAttributesUtil.constructErrorMessage(attrs, writer.getWriter().toString()));
+ }
+ }
+}
Propchange: myfaces/tomahawk/trunk/sandbox/core/src/test/java/org/apache/myfaces/custom/suggestajax/SuggestAjaxRendererTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: myfaces/tomahawk/trunk/sandbox/core/src/test/java/org/apache/myfaces/custom/suggestajax/SuggestAjaxRendererTest.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Added: myfaces/tomahawk/trunk/sandbox/core/src/test/java/org/apache/myfaces/custom/toggle/ToggleGroupRendererTest.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/sandbox/core/src/test/java/org/apache/myfaces/custom/toggle/ToggleGroupRendererTest.java?rev=700627&view=auto
==============================================================================
--- myfaces/tomahawk/trunk/sandbox/core/src/test/java/org/apache/myfaces/custom/toggle/ToggleGroupRendererTest.java (added)
+++ myfaces/tomahawk/trunk/sandbox/core/src/test/java/org/apache/myfaces/custom/toggle/ToggleGroupRendererTest.java Tue Sep 30 16:11:04 2008
@@ -0,0 +1,96 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.myfaces.custom.toggle;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+import org.apache.myfaces.test.AbstractTomahawkViewControllerTestCase;
+import org.apache.myfaces.test.utils.HtmlCheckAttributesUtil;
+import org.apache.myfaces.test.utils.HtmlRenderedAttr;
+import org.apache.shale.test.mock.MockResponseWriter;
+
+public class ToggleGroupRendererTest extends AbstractTomahawkViewControllerTestCase
+{
+ private MockResponseWriter writer;
+ private ToggleGroup toggleGroup;
+
+ public ToggleGroupRendererTest(String name)
+ {
+ super(name);
+ }
+
+ public static Test suite() {
+ return new TestSuite(ToggleGroupRendererTest.class);
+ }
+
+ public void setUp() throws Exception {
+ super.setUp();
+ writer = (MockResponseWriter)facesContext.getResponseWriter();
+ toggleGroup = new ToggleGroup();
+ }
+
+ public void tearDown() {
+ writer = null;
+ toggleGroup = null;
+ }
+
+ public void testHtmlPropertyPassTru() throws Exception
+ {
+ HtmlRenderedAttr[] attrs = {
+ //_UniversalProperties
+ new HtmlRenderedAttr("dir"),
+ new HtmlRenderedAttr("lang"),
+ new HtmlRenderedAttr("title"),
+ //_EventProperties
+ new HtmlRenderedAttr("onclick"),
+ new HtmlRenderedAttr("ondblclick"),
+ new HtmlRenderedAttr("onkeydown"),
+ new HtmlRenderedAttr("onkeypress"),
+ new HtmlRenderedAttr("onkeyup"),
+ new HtmlRenderedAttr("onmousedown"),
+ new HtmlRenderedAttr("onmousemove"),
+ new HtmlRenderedAttr("onmouseout"),
+ new HtmlRenderedAttr("onmouseover"),
+ new HtmlRenderedAttr("onmouseup"),
+ //_StyleProperties
+ new HtmlRenderedAttr("style", "style", "style=\"style;display:none;\""),
+ new HtmlRenderedAttr("styleClass", "styleClass", "class=\"styleClass\""),
+ };
+
+ HtmlCheckAttributesUtil.checkRenderedAttributes(
+ toggleGroup, facesContext, writer, attrs);
+ if(HtmlCheckAttributesUtil.hasFailedAttrRender(attrs))
+ {
+ fail(HtmlCheckAttributesUtil.constructErrorMessage(attrs, writer.getWriter().toString()));
+ }
+ }
+
+ public void testHtmlPropertyPassTruNotRendered() throws Exception
+ {
+ HtmlRenderedAttr[] attrs = HtmlCheckAttributesUtil.generateAttrsNotRenderedForReadOnly();
+
+ HtmlCheckAttributesUtil.checkRenderedAttributes(
+ toggleGroup, facesContext, writer, attrs);
+ if(HtmlCheckAttributesUtil.hasFailedAttrRender(attrs))
+ {
+ fail(HtmlCheckAttributesUtil.constructErrorMessage(attrs, writer.getWriter().toString()));
+ }
+ }
+}
Propchange: myfaces/tomahawk/trunk/sandbox/core/src/test/java/org/apache/myfaces/custom/toggle/ToggleGroupRendererTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: myfaces/tomahawk/trunk/sandbox/core/src/test/java/org/apache/myfaces/custom/toggle/ToggleGroupRendererTest.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Added: myfaces/tomahawk/trunk/sandbox/core/src/test/java/org/apache/myfaces/custom/toggle/ToggleLinkRendererTest.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/sandbox/core/src/test/java/org/apache/myfaces/custom/toggle/ToggleLinkRendererTest.java?rev=700627&view=auto
==============================================================================
--- myfaces/tomahawk/trunk/sandbox/core/src/test/java/org/apache/myfaces/custom/toggle/ToggleLinkRendererTest.java (added)
+++ myfaces/tomahawk/trunk/sandbox/core/src/test/java/org/apache/myfaces/custom/toggle/ToggleLinkRendererTest.java Tue Sep 30 16:11:04 2008
@@ -0,0 +1,101 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.myfaces.custom.toggle;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+import org.apache.myfaces.component.html.ext.HtmlInputText;
+import org.apache.myfaces.test.AbstractTomahawkViewControllerTestCase;
+import org.apache.myfaces.test.utils.HtmlCheckAttributesUtil;
+import org.apache.myfaces.test.utils.HtmlRenderedAttr;
+import org.apache.shale.test.mock.MockResponseWriter;
+
+public class ToggleLinkRendererTest extends AbstractTomahawkViewControllerTestCase
+{
+ private MockResponseWriter writer;
+ private ToggleLink link;
+ private TogglePanel panel;
+
+ public ToggleLinkRendererTest(String name)
+ {
+ super(name);
+ }
+
+ public static Test suite() {
+ return new TestSuite(ToggleLinkRendererTest.class);
+ }
+
+ public void setUp() throws Exception {
+ super.setUp();
+ writer = (MockResponseWriter)facesContext.getResponseWriter();
+ link = new ToggleLink();
+ panel = new TogglePanel();
+
+ HtmlInputText inputText = new HtmlInputText();
+ inputText.setId("comp1");
+
+ panel.getChildren().add(link);
+ panel.getChildren().add(inputText);
+ link.setFor("comp1");
+ }
+
+ public void tearDown() {
+ writer = null;
+ link = null;
+ }
+
+ public void testHtmlPropertyPassTru() throws Exception
+ {
+ HtmlRenderedAttr[] attrs = {
+ //_AccesskeyProperty
+ new HtmlRenderedAttr("accesskey"),
+ //_UniversalProperties
+ new HtmlRenderedAttr("dir"),
+ new HtmlRenderedAttr("lang"),
+ new HtmlRenderedAttr("title"),
+ //_FocusBlurProperties
+ new HtmlRenderedAttr("onfocus"),
+ new HtmlRenderedAttr("onblur"),
+ //_EventProperties
+ new HtmlRenderedAttr("onclick", "onclick", "onclick=\""),
+ new HtmlRenderedAttr("ondblclick"),
+ new HtmlRenderedAttr("onkeydown"),
+ new HtmlRenderedAttr("onkeypress"),
+ new HtmlRenderedAttr("onkeyup"),
+ new HtmlRenderedAttr("onmousedown"),
+ new HtmlRenderedAttr("onmousemove"),
+ new HtmlRenderedAttr("onmouseout"),
+ new HtmlRenderedAttr("onmouseover"),
+ new HtmlRenderedAttr("onmouseup"),
+ //_StyleProperties
+ new HtmlRenderedAttr("style"),
+ new HtmlRenderedAttr("styleClass", "styleClass", "class=\"styleClass\""),
+ //_TabindexProperty
+ new HtmlRenderedAttr("tabindex")
+ };
+
+ HtmlCheckAttributesUtil.checkRenderedAttributes(
+ link, facesContext, writer, attrs);
+ if(HtmlCheckAttributesUtil.hasFailedAttrRender(attrs))
+ {
+ fail(HtmlCheckAttributesUtil.constructErrorMessage(attrs, writer.getWriter().toString()));
+ }
+ }
+}
Propchange: myfaces/tomahawk/trunk/sandbox/core/src/test/java/org/apache/myfaces/custom/toggle/ToggleLinkRendererTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: myfaces/tomahawk/trunk/sandbox/core/src/test/java/org/apache/myfaces/custom/toggle/ToggleLinkRendererTest.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Added: myfaces/tomahawk/trunk/sandbox/core/src/test/java/org/apache/myfaces/custom/toggle/TogglePanelRendererTest.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/sandbox/core/src/test/java/org/apache/myfaces/custom/toggle/TogglePanelRendererTest.java?rev=700627&view=auto
==============================================================================
--- myfaces/tomahawk/trunk/sandbox/core/src/test/java/org/apache/myfaces/custom/toggle/TogglePanelRendererTest.java (added)
+++ myfaces/tomahawk/trunk/sandbox/core/src/test/java/org/apache/myfaces/custom/toggle/TogglePanelRendererTest.java Tue Sep 30 16:11:04 2008
@@ -0,0 +1,78 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.myfaces.custom.toggle;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+import org.apache.myfaces.test.AbstractTomahawkViewControllerTestCase;
+import org.apache.myfaces.test.utils.HtmlCheckAttributesUtil;
+import org.apache.myfaces.test.utils.HtmlRenderedAttr;
+import org.apache.shale.test.mock.MockResponseWriter;
+
+public class TogglePanelRendererTest extends AbstractTomahawkViewControllerTestCase
+{
+ private MockResponseWriter writer;
+ private TogglePanel panel;
+
+ public TogglePanelRendererTest(String name)
+ {
+ super(name);
+ }
+
+ public static Test suite() {
+ return new TestSuite(TogglePanelRendererTest.class);
+ }
+
+ public void setUp() throws Exception {
+ super.setUp();
+ writer = (MockResponseWriter)facesContext.getResponseWriter();
+ panel = new TogglePanel();
+ }
+
+ public void tearDown() {
+ writer = null;
+ panel = null;
+ }
+
+ public void testHtmlPropertyPassTru() throws Exception
+ {
+ HtmlRenderedAttr[] attrs = HtmlCheckAttributesUtil.generateBasicReadOnlyAttrs();
+
+ HtmlCheckAttributesUtil.checkRenderedAttributes(
+ panel, facesContext, writer, attrs);
+ if(HtmlCheckAttributesUtil.hasFailedAttrRender(attrs))
+ {
+ fail(HtmlCheckAttributesUtil.constructErrorMessage(attrs, writer.getWriter().toString()));
+ }
+ }
+
+
+ public void testHtmlPropertyPassTruNotRendered() throws Exception
+ {
+ HtmlRenderedAttr[] attrs = HtmlCheckAttributesUtil.generateAttrsNotRenderedForReadOnly();
+
+ HtmlCheckAttributesUtil.checkRenderedAttributes(
+ panel, facesContext, writer, attrs);
+ if(HtmlCheckAttributesUtil.hasFailedAttrRender(attrs))
+ {
+ fail(HtmlCheckAttributesUtil.constructErrorMessage(attrs, writer.getWriter().toString()));
+ }
+ }
+}
Propchange: myfaces/tomahawk/trunk/sandbox/core/src/test/java/org/apache/myfaces/custom/toggle/TogglePanelRendererTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: myfaces/tomahawk/trunk/sandbox/core/src/test/java/org/apache/myfaces/custom/toggle/TogglePanelRendererTest.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Added: myfaces/tomahawk/trunk/sandbox/core/src/test/java/org/apache/myfaces/renderkit/html/ext/HtmlButtonExRendererTest.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/sandbox/core/src/test/java/org/apache/myfaces/renderkit/html/ext/HtmlButtonExRendererTest.java?rev=700627&view=auto
==============================================================================
--- myfaces/tomahawk/trunk/sandbox/core/src/test/java/org/apache/myfaces/renderkit/html/ext/HtmlButtonExRendererTest.java (added)
+++ myfaces/tomahawk/trunk/sandbox/core/src/test/java/org/apache/myfaces/renderkit/html/ext/HtmlButtonExRendererTest.java Tue Sep 30 16:11:04 2008
@@ -0,0 +1,127 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.myfaces.renderkit.html.ext;
+
+import javax.faces.component.html.HtmlForm;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+import org.apache.myfaces.component.html.ext.HtmlCommandButton;
+import org.apache.myfaces.shared_impl.config.MyfacesConfig;
+import org.apache.myfaces.test.AbstractTomahawkViewControllerTestCase;
+import org.apache.myfaces.test.utils.HtmlCheckAttributesUtil;
+import org.apache.myfaces.test.utils.HtmlRenderedAttr;
+import org.apache.shale.test.mock.MockExternalContext;
+import org.apache.shale.test.mock.MockHttpServletRequest;
+import org.apache.shale.test.mock.MockHttpServletResponse;
+import org.apache.shale.test.mock.MockResponseWriter;
+import org.apache.shale.test.mock.MockServletContext;
+
+public class HtmlButtonExRendererTest extends AbstractTomahawkViewControllerTestCase {
+
+ private MockResponseWriter writer;
+ private HtmlCommandButton commandButton;
+ private HtmlForm form;
+
+
+ public HtmlButtonExRendererTest(String name) {
+ super(name);
+ }
+
+ public static Test suite() {
+ return new TestSuite(HtmlButtonExRendererTest.class);
+ }
+
+ public void setUp() throws Exception {
+ super.setUp();
+ writer = (MockResponseWriter)facesContext.getResponseWriter();
+ commandButton = new HtmlCommandButton();
+ form = new HtmlForm();
+ commandButton.setParent(form);
+ }
+
+ public void tearDown() throws Exception {
+ super.tearDown();
+ writer = null;
+ form = null;
+ commandButton = null;
+ }
+
+ public void testJSAllowedHtmlPropertyPassTru() throws Exception
+ {
+ HtmlRenderedAttr[] attrs = {
+ //_AccesskeyProperty
+ new HtmlRenderedAttr("accesskey"),
+ //_UniversalProperties
+ new HtmlRenderedAttr("dir"),
+ new HtmlRenderedAttr("lang"),
+ new HtmlRenderedAttr("title"),
+ //_FocusBlurProperties
+ new HtmlRenderedAttr("onfocus"),
+ new HtmlRenderedAttr("onblur"),
+ //_ChangeSelectProperties
+ new HtmlRenderedAttr("onchange"),
+ new HtmlRenderedAttr("onselect"),
+ //_EventProperties
+ new HtmlRenderedAttr("onclick", "onclick", "onclick=\""),
+ new HtmlRenderedAttr("ondblclick"),
+ new HtmlRenderedAttr("onkeydown"),
+ new HtmlRenderedAttr("onkeypress"),
+ new HtmlRenderedAttr("onkeyup"),
+ new HtmlRenderedAttr("onmousedown"),
+ new HtmlRenderedAttr("onmousemove"),
+ new HtmlRenderedAttr("onmouseout"),
+ new HtmlRenderedAttr("onmouseover"),
+ new HtmlRenderedAttr("onmouseup"),
+ //_StyleProperties
+ new HtmlRenderedAttr("style"),
+ new HtmlRenderedAttr("styleClass", "styleClass", "class=\"styleClass\""),
+ //_TabindexProperty
+ new HtmlRenderedAttr("tabindex")
+ };
+
+ MockServletContext servletContext = new MockServletContext();
+ servletContext.addInitParameter("org.apache.myfaces.ALLOW_JAVASCRIPT", "true");
+ MockExternalContext mockExtCtx = new MockExternalContext(servletContext,
+ new MockHttpServletRequest(), new MockHttpServletResponse());
+ MyfacesConfig config = MyfacesConfig.getCurrentInstance(mockExtCtx);
+ facesContext.setExternalContext(mockExtCtx);
+
+ HtmlCheckAttributesUtil.checkRenderedAttributes(
+ commandButton, facesContext, writer, attrs);
+ if(HtmlCheckAttributesUtil.hasFailedAttrRender(attrs))
+ {
+ fail(HtmlCheckAttributesUtil.constructErrorMessage(attrs, writer.getWriter().toString()));
+ }
+ }
+
+ public void testJSNotAllowedHtmlPropertyPassTru() throws Exception
+ {
+ HtmlRenderedAttr[] attrs = HtmlCheckAttributesUtil.generateBasicAttrs();
+
+ HtmlCheckAttributesUtil.checkRenderedAttributes(
+ commandButton, facesContext, writer, attrs);
+ if(HtmlCheckAttributesUtil.hasFailedAttrRender(attrs))
+ {
+ fail(HtmlCheckAttributesUtil.constructErrorMessage(attrs, writer.getWriter().toString()));
+ }
+
+ }
+}
Propchange: myfaces/tomahawk/trunk/sandbox/core/src/test/java/org/apache/myfaces/renderkit/html/ext/HtmlButtonExRendererTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: myfaces/tomahawk/trunk/sandbox/core/src/test/java/org/apache/myfaces/renderkit/html/ext/HtmlButtonExRendererTest.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Added: myfaces/tomahawk/trunk/sandbox/core/src/test/java/org/apache/myfaces/renderkit/html/ext/HtmlFormRendererTest.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/sandbox/core/src/test/java/org/apache/myfaces/renderkit/html/ext/HtmlFormRendererTest.java?rev=700627&view=auto
==============================================================================
--- myfaces/tomahawk/trunk/sandbox/core/src/test/java/org/apache/myfaces/renderkit/html/ext/HtmlFormRendererTest.java (added)
+++ myfaces/tomahawk/trunk/sandbox/core/src/test/java/org/apache/myfaces/renderkit/html/ext/HtmlFormRendererTest.java Tue Sep 30 16:11:04 2008
@@ -0,0 +1,82 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.myfaces.renderkit.html.ext;
+
+
+
+import javax.faces.component.html.HtmlForm;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+import org.apache.myfaces.test.AbstractTomahawkViewControllerTestCase;
+import org.apache.myfaces.test.utils.HtmlCheckAttributesUtil;
+import org.apache.myfaces.test.utils.HtmlRenderedAttr;
+import org.apache.myfaces.test.utils.MockTestViewHandler;
+import org.apache.shale.test.mock.MockResponseWriter;
+
+public class HtmlFormRendererTest extends AbstractTomahawkViewControllerTestCase
+{
+ private MockResponseWriter writer;
+ private HtmlForm form;
+
+ public HtmlFormRendererTest(String name)
+ {
+ super(name);
+ }
+
+ public static Test suite() {
+ return new TestSuite(HtmlFormRendererTest.class);
+ }
+
+ public void setUp() throws Exception {
+ super.setUp();
+ writer = (MockResponseWriter)facesContext.getResponseWriter();
+ application.setViewHandler(new MockTestViewHandler());
+
+ form = new HtmlForm();
+ }
+
+ public void tearDown() {
+ writer = null;
+ form = null;
+ }
+
+ public void testHtmlPropertyPassTru() throws Exception
+ {
+ HtmlRenderedAttr[] attrs = HtmlCheckAttributesUtil.generateBasicReadOnlyAttrs();
+ HtmlCheckAttributesUtil.checkRenderedAttributes(
+ form, facesContext, writer, attrs);
+
+ if(HtmlCheckAttributesUtil.hasFailedAttrRender(attrs)) {
+ fail(HtmlCheckAttributesUtil.constructErrorMessage(attrs, writer.getWriter().toString()));
+ }
+ }
+
+ public void testHtmlPropertyPassTruNotRendered() throws Exception
+ {
+ HtmlRenderedAttr[] attrs = HtmlCheckAttributesUtil.generateAttrsNotRenderedForReadOnly();
+
+ HtmlCheckAttributesUtil.checkRenderedAttributes(
+ form, facesContext, writer, attrs);
+ if(HtmlCheckAttributesUtil.hasFailedAttrRender(attrs)) {
+ fail(HtmlCheckAttributesUtil.constructErrorMessage(attrs, writer.getWriter().toString()));
+ }
+ }
+}
Propchange: myfaces/tomahawk/trunk/sandbox/core/src/test/java/org/apache/myfaces/renderkit/html/ext/HtmlFormRendererTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: myfaces/tomahawk/trunk/sandbox/core/src/test/java/org/apache/myfaces/renderkit/html/ext/HtmlFormRendererTest.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Added: myfaces/tomahawk/trunk/sandbox/core/src/test/java/org/apache/myfaces/test/AbstractTomahawkViewControllerTestCase.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/sandbox/core/src/test/java/org/apache/myfaces/test/AbstractTomahawkViewControllerTestCase.java?rev=700627&view=auto
==============================================================================
--- myfaces/tomahawk/trunk/sandbox/core/src/test/java/org/apache/myfaces/test/AbstractTomahawkViewControllerTestCase.java (added)
+++ myfaces/tomahawk/trunk/sandbox/core/src/test/java/org/apache/myfaces/test/AbstractTomahawkViewControllerTestCase.java Tue Sep 30 16:11:04 2008
@@ -0,0 +1,96 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.myfaces.test;
+
+import java.io.StringWriter;
+
+import org.apache.myfaces.shared_tomahawk.config.MyfacesConfig;
+import org.apache.myfaces.test.utils.TestUtils;
+import org.apache.shale.test.base.AbstractViewControllerTestCase;
+import org.apache.shale.test.mock.MockResponseWriter;
+
+/**
+ * Abstract Shale Test base class, which sets up the JSF environment. If the test
+ * overrides <code>setUp()</code> and/or <code>tearDown()</code>, then those
+ * methods but call the overwitten method to insure a valid test environment.
+ */
+public class AbstractTomahawkViewControllerTestCase extends AbstractViewControllerTestCase
+{
+ /** Response Writer */
+ private MockResponseWriter writer;
+
+ /**
+ * Construct a new instance of the test.
+ *
+ * @param name Name of the test.
+ */
+ public AbstractTomahawkViewControllerTestCase(String name)
+ {
+ super(name);
+ }
+
+ /**
+ * Setup the test environment, including the following:
+ * <ul>
+ * <li>Set the Application Map.</li>
+ * <li>Set a response writer</li>
+ * <li>Add Tomahawk's renderers to the faces context.</li>
+ * </ul>
+ */
+ protected void setUp() throws Exception
+ {
+ super.setUp();
+ // additional setup not provided automatically by the shale mock stuff
+ facesContext.getExternalContext().getApplicationMap().put(
+ MyfacesConfig.class.getName(), new MyfacesConfig());
+ writer = new MockResponseWriter(new StringWriter(), null, null);
+ facesContext.setResponseWriter(writer);
+
+ TestUtils.addDefaultRenderers(facesContext);
+ }
+
+ /**
+ * Tear down the test environment.
+ */
+ protected void tearDown() throws Exception
+ {
+ super.tearDown();
+ }
+
+ /**
+ * Verify the following:
+ * <ul>
+ * <li>id is not null</li>
+ * <li>Response is complete</li>
+ * <li>Responce contains the id</li>
+ * </ul>
+ *
+ * @param id ID to verify
+ */
+ protected void assertIdExists(String id)
+ {
+ assertNotNull("ID is not null", id);
+ assertTrue("Response Complete", facesContext.getResponseComplete());
+ String output = writer.getWriter().toString();
+// System.out.println("Output = '" + output + "'");
+ assertNotNull("Has output", output);
+ assertTrue("Contains id '" + id + "'", output.indexOf(id) != -1);
+ }
+
+}
Propchange: myfaces/tomahawk/trunk/sandbox/core/src/test/java/org/apache/myfaces/test/AbstractTomahawkViewControllerTestCase.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: myfaces/tomahawk/trunk/sandbox/core/src/test/java/org/apache/myfaces/test/AbstractTomahawkViewControllerTestCase.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL