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 2009/02/11 16:02:43 UTC
svn commit: r743355 [2/2] - in /myfaces/core/branches/2_0_0: ./ api/
api/src/main/java/javax/faces/component/
api/src/main/javascript/META-INF/resources/javax/faces/_util/
api/src/main/javascript/META-INF/resources/javax/faces/_util/_trinidad/
assembly...
Modified: myfaces/core/branches/2_0_0/impl/src/test/java/org/apache/myfaces/renderkit/html/HtmlListboxRendererTest.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2_0_0/impl/src/test/java/org/apache/myfaces/renderkit/html/HtmlListboxRendererTest.java?rev=743355&r1=743354&r2=743355&view=diff
==============================================================================
--- myfaces/core/branches/2_0_0/impl/src/test/java/org/apache/myfaces/renderkit/html/HtmlListboxRendererTest.java (original)
+++ myfaces/core/branches/2_0_0/impl/src/test/java/org/apache/myfaces/renderkit/html/HtmlListboxRendererTest.java Wed Feb 11 15:02:41 2009
@@ -1,30 +1,40 @@
/*
- * Copyright 2006 The Apache Software Foundation.
+ * 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
*
- * 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
*
- * 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.
+ * 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;
-import org.apache.shale.test.base.AbstractJsfTestCase;
-import org.apache.shale.test.mock.MockRenderKitFactory;
-import org.apache.shale.test.mock.MockResponseWriter;
+import java.io.StringWriter;
+import java.util.ArrayList;
+import java.util.List;
import javax.faces.component.UISelectItems;
+import javax.faces.component.html.HtmlSelectManyListbox;
import javax.faces.component.html.HtmlSelectOneListbox;
import javax.faces.model.SelectItem;
-import java.io.StringWriter;
-import java.util.ArrayList;
-import java.util.List;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+import org.apache.myfaces.test.utils.HtmlCheckAttributesUtil;
+import org.apache.myfaces.test.utils.HtmlRenderedAttr;
+import org.apache.shale.test.base.AbstractJsfTestCase;
+import org.apache.shale.test.mock.MockRenderKitFactory;
+import org.apache.shale.test.mock.MockResponseWriter;
/**
* @author Bruno Aranda (latest modification by $Author$)
@@ -34,17 +44,23 @@
{
private MockResponseWriter writer ;
private HtmlSelectOneListbox selectOneListbox;
+ private HtmlSelectManyListbox selectManyListbox;
public HtmlListboxRendererTest(String name)
{
super(name);
}
+
+ public static Test suite() {
+ return new TestSuite(HtmlListboxRendererTest.class);
+ }
- protected void setUp() throws Exception
+ public void setUp() throws Exception
{
super.setUp();
selectOneListbox = new HtmlSelectOneListbox();
+ selectManyListbox = new HtmlSelectManyListbox();
writer = new MockResponseWriter(new StringWriter(), null, null);
facesContext.setResponseWriter(writer);
@@ -54,55 +70,54 @@
selectOneListbox.getFamily(),
selectOneListbox.getRendererType(),
new HtmlListboxRenderer());
-
+ facesContext.getRenderKit().addRenderer(
+ selectManyListbox.getFamily(),
+ selectManyListbox.getRendererType(),
+ new HtmlListboxRenderer());
}
- protected void tearDown() throws Exception
+ public void tearDown() throws Exception
{
super.tearDown();
selectOneListbox = null;
writer = null;
}
- public void testRenderDefault() throws Exception
+ public void testSelectOneHtmlPropertyPassTru() throws Exception
{
- List<SelectItem> items = new ArrayList<SelectItem>();
+ HtmlRenderedAttr[] attrs = HtmlCheckAttributesUtil.generateBasicAttrs();
+
+ List items = new ArrayList();
items.add(new SelectItem("mars"));
- items.add(new SelectItem("jupiter"));
UISelectItems selectItems = new UISelectItems();
selectItems.setValue(items);
selectOneListbox.getChildren().add(selectItems);
- selectOneListbox.encodeAll(facesContext);
- facesContext.renderResponse();
-
- String output = writer.getWriter().toString();
- assertEquals("<select name=\"j_id0\" size=\"2\">" +
- "\t<option value=\"mars\">mars</option>" +
- "\t<option value=\"jupiter\">jupiter</option></select>", output);
+ HtmlCheckAttributesUtil.checkRenderedAttributes(
+ selectOneListbox, facesContext, writer, attrs);
+ if(HtmlCheckAttributesUtil.hasFailedAttrRender(attrs)) {
+ fail(HtmlCheckAttributesUtil.constructErrorMessage(attrs, writer.getWriter().toString()));
+ }
}
-
- public void testRenderSizeSet() throws Exception
+
+ public void testSelectManyHtmlPropertyPassTru() throws Exception
{
- List<SelectItem> items = new ArrayList<SelectItem>();
+ HtmlRenderedAttr[] attrs = HtmlCheckAttributesUtil.generateBasicAttrs();
+
+ List items = new ArrayList();
items.add(new SelectItem("mars"));
- items.add(new SelectItem("jupiter"));
UISelectItems selectItems = new UISelectItems();
selectItems.setValue(items);
- selectOneListbox.getChildren().add(selectItems);
- selectOneListbox.setSize(1);
-
- selectOneListbox.encodeAll(facesContext);
- facesContext.renderResponse();
-
- String output = writer.getWriter().toString();
- assertEquals("<select name=\"j_id0\" size=\"1\">" +
- "\t<option value=\"mars\">mars</option>" +
- "\t<option value=\"jupiter\">jupiter</option></select>", output);
+ selectManyListbox.getChildren().add(selectItems);
+
+ HtmlCheckAttributesUtil.checkRenderedAttributes(
+ selectManyListbox, facesContext, writer, attrs);
+ if(HtmlCheckAttributesUtil.hasFailedAttrRender(attrs)) {
+ fail(HtmlCheckAttributesUtil.constructErrorMessage(attrs, writer.getWriter().toString()));
+ }
}
-
-}
\ No newline at end of file
+}
Modified: myfaces/core/branches/2_0_0/impl/src/test/java/org/apache/myfaces/renderkit/html/HtmlMenuRendererTest.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2_0_0/impl/src/test/java/org/apache/myfaces/renderkit/html/HtmlMenuRendererTest.java?rev=743355&r1=743354&r2=743355&view=diff
==============================================================================
--- myfaces/core/branches/2_0_0/impl/src/test/java/org/apache/myfaces/renderkit/html/HtmlMenuRendererTest.java (original)
+++ myfaces/core/branches/2_0_0/impl/src/test/java/org/apache/myfaces/renderkit/html/HtmlMenuRendererTest.java Wed Feb 11 15:02:41 2009
@@ -1,30 +1,40 @@
/*
- * Copyright 2006 The Apache Software Foundation.
+ * 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
*
- * 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
*
- * 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.
+ * 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;
-import org.apache.shale.test.base.AbstractJsfTestCase;
-import org.apache.shale.test.mock.MockRenderKitFactory;
-import org.apache.shale.test.mock.MockResponseWriter;
+import java.io.StringWriter;
+import java.util.ArrayList;
+import java.util.List;
import javax.faces.component.UISelectItems;
+import javax.faces.component.html.HtmlSelectManyMenu;
import javax.faces.component.html.HtmlSelectOneMenu;
import javax.faces.model.SelectItem;
-import java.io.StringWriter;
-import java.util.ArrayList;
-import java.util.List;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+import org.apache.myfaces.test.utils.HtmlCheckAttributesUtil;
+import org.apache.myfaces.test.utils.HtmlRenderedAttr;
+import org.apache.shale.test.base.AbstractJsfTestCase;
+import org.apache.shale.test.mock.MockRenderKitFactory;
+import org.apache.shale.test.mock.MockResponseWriter;
/**
* @author Bruno Aranda (latest modification by $Author$)
@@ -34,17 +44,23 @@
{
private MockResponseWriter writer ;
private HtmlSelectOneMenu selectOneMenu;
+ private HtmlSelectManyMenu selectManyMenu;
public HtmlMenuRendererTest(String name)
{
super(name);
}
+
+ public static Test suite() {
+ return new TestSuite(HtmlMenuRendererTest.class);
+ }
- protected void setUp() throws Exception
+ public void setUp() throws Exception
{
super.setUp();
selectOneMenu = new HtmlSelectOneMenu();
+ selectManyMenu = new HtmlSelectManyMenu();
writer = new MockResponseWriter(new StringWriter(), null, null);
facesContext.setResponseWriter(writer);
@@ -54,57 +70,56 @@
selectOneMenu.getFamily(),
selectOneMenu.getRendererType(),
new HtmlMenuRenderer());
+ facesContext.getRenderKit().addRenderer(
+ selectManyMenu.getFamily(),
+ selectManyMenu.getRendererType(),
+ new HtmlMenuRenderer());
}
- protected void tearDown() throws Exception
+ public void tearDown() throws Exception
{
super.tearDown();
selectOneMenu = null;
+ selectManyMenu = null;
writer = null;
}
- public void testRenderDefault() throws Exception
+ public void testSelectOneHtmlPropertyPassTru() throws Exception
{
- List<SelectItem> items = new ArrayList<SelectItem>();
+ HtmlRenderedAttr[] attrs = HtmlCheckAttributesUtil.generateBasicAttrs();
+
+ List items = new ArrayList();
items.add(new SelectItem("mars"));
- items.add(new SelectItem("jupiter"));
UISelectItems selectItems = new UISelectItems();
selectItems.setValue(items);
selectOneMenu.getChildren().add(selectItems);
-
- selectOneMenu.encodeAll(facesContext);
- facesContext.renderResponse();
-
- String output = writer.getWriter().toString();
- assertEquals("<select name=\"j_id0\" size=\"1\">" +
- "\t<option value=\"mars\">mars</option>" +
- "\t<option value=\"jupiter\">jupiter</option></select>", output);
+
+ HtmlCheckAttributesUtil.checkRenderedAttributes(
+ selectOneMenu, facesContext, writer, attrs);
+ if(HtmlCheckAttributesUtil.hasFailedAttrRender(attrs)) {
+ fail(HtmlCheckAttributesUtil.constructErrorMessage(attrs, writer.getWriter().toString()));
+ }
}
-
- public void testRenderReadonly() throws Exception
+
+ public void testSelectManyHtmlPropertyPassTru() throws Exception
{
- List<SelectItem> items = new ArrayList<SelectItem>();
+ HtmlRenderedAttr[] attrs = HtmlCheckAttributesUtil.generateBasicAttrs();
+
+ List items = new ArrayList();
items.add(new SelectItem("mars"));
- items.add(new SelectItem("jupiter"));
UISelectItems selectItems = new UISelectItems();
selectItems.setValue(items);
- selectOneMenu.getChildren().add(selectItems);
-
- selectOneMenu.setReadonly(true);
-
- selectOneMenu.encodeAll(facesContext);
- facesContext.renderResponse();
-
- String output = writer.getWriter().toString();
- assertEquals("<select name=\"j_id0\" size=\"1\" readonly=\"readonly\">" +
- "\t<option value=\"mars\">mars</option>" +
- "\t<option value=\"jupiter\">jupiter</option></select>", output);
+ selectManyMenu.getChildren().add(selectItems);
+
+ HtmlCheckAttributesUtil.checkRenderedAttributes(
+ selectManyMenu, facesContext, writer, attrs);
+ if(HtmlCheckAttributesUtil.hasFailedAttrRender(attrs)) {
+ fail(HtmlCheckAttributesUtil.constructErrorMessage(attrs, writer.getWriter().toString()));
+ }
}
-
-
-}
\ No newline at end of file
+}
Modified: myfaces/core/branches/2_0_0/impl/src/test/java/org/apache/myfaces/renderkit/html/HtmlMessagesRendererTest.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2_0_0/impl/src/test/java/org/apache/myfaces/renderkit/html/HtmlMessagesRendererTest.java?rev=743355&r1=743354&r2=743355&view=diff
==============================================================================
--- myfaces/core/branches/2_0_0/impl/src/test/java/org/apache/myfaces/renderkit/html/HtmlMessagesRendererTest.java (original)
+++ myfaces/core/branches/2_0_0/impl/src/test/java/org/apache/myfaces/renderkit/html/HtmlMessagesRendererTest.java Wed Feb 11 15:02:41 2009
@@ -1,17 +1,20 @@
/*
- * Copyright 2006 The Apache Software Foundation.
+ * 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
*
- * 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
*
- * 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.
+ * 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;
@@ -20,6 +23,11 @@
import javax.faces.application.FacesMessage;
import javax.faces.component.html.HtmlMessages;
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+import org.apache.myfaces.test.utils.HtmlCheckAttributesUtil;
+import org.apache.myfaces.test.utils.HtmlRenderedAttr;
import org.apache.shale.test.base.AbstractJsfTestCase;
import org.apache.shale.test.mock.MockRenderKitFactory;
import org.apache.shale.test.mock.MockResponseWriter;
@@ -34,22 +42,22 @@
private static final String WARN_CLASS = "warnClass";
private static final String INFO_CLASS = "infoClass";
- private MockResponseWriter writer;
private HtmlMessages messages;
+ private MockResponseWriter writer;
public HtmlMessagesRendererTest(String name)
{
super(name);
}
+
+ public static Test suite() {
+ return new TestSuite(HtmlMessagesRendererTest.class);
+ }
- protected void setUp() throws Exception
+ public void setUp() throws Exception
{
super.setUp();
-
messages = new HtmlMessages();
- messages.setErrorClass(ERROR_CLASS);
- messages.setWarnClass(WARN_CLASS);
- messages.setInfoClass(INFO_CLASS);
writer = new MockResponseWriter(new StringWriter(), null, null);
facesContext.setResponseWriter(writer);
@@ -59,32 +67,64 @@
messages.getFamily(),
messages.getRendererType(),
new HtmlMessagesRenderer());
-
+
+ messages.setErrorClass(ERROR_CLASS);
+ messages.setWarnClass(WARN_CLASS);
+ messages.setInfoClass(INFO_CLASS);
}
- protected void tearDown() throws Exception
+ public void tearDown() throws Exception
{
super.tearDown();
+ messages = null;
writer = null;
}
-
- public void testLayoutTable_Style() throws Exception
+
+ public void testHtmlPropertyPassTru() throws Exception
{
+ HtmlRenderedAttr[] attrs = {
+ //_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("styleClass", "styleClass", "class=\"warnClass\""),
+ };
+
facesContext.addMessage("test1", new FacesMessage(FacesMessage.SEVERITY_WARN, "warnSumary", "detailWarnSummary"));
- facesContext.addMessage("test2", new FacesMessage(FacesMessage.SEVERITY_ERROR, "errorSumary", "detailErrorSummary"));
messages.setLayout("table");
messages.setStyle("left: 48px; top: 432px; position: absolute");
+
+ MockResponseWriter writer = (MockResponseWriter)facesContext.getResponseWriter();
+ HtmlCheckAttributesUtil.checkRenderedAttributes(
+ messages, 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"));
- HtmlMessagesRenderer renderer = new HtmlMessagesRenderer();
- renderer.encodeEnd(facesContext, messages);
-
- facesContext.renderResponse();
-
- //String output = writer.getWriter().toString();
-
- // TODO: test don't work on different jvms (messages are in different order)
- // assertEquals("<table style=\"left: 48px; top: 432px; position: absolute\"><tr><td><span class=\"warnClass\">warnSumary</span></td></tr>" +
- // "<tr><td><span class=\"errorClass\">errorSumary</span></td></tr></table>", output);
+ messages.setLayout("table");
+ messages.setStyle("left: 48px; top: 432px; position: absolute");
+
+ MockResponseWriter writer = (MockResponseWriter)facesContext.getResponseWriter();
+ HtmlCheckAttributesUtil.checkRenderedAttributes(
+ messages, facesContext, writer, attrs);
+ if(HtmlCheckAttributesUtil.hasFailedAttrRender(attrs)) {
+ fail(HtmlCheckAttributesUtil.constructErrorMessage(attrs, writer.getWriter().toString()));
+ }
}
}
Modified: myfaces/core/branches/2_0_0/impl/src/test/java/org/apache/myfaces/renderkit/html/HtmlRadioRendererTest.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2_0_0/impl/src/test/java/org/apache/myfaces/renderkit/html/HtmlRadioRendererTest.java?rev=743355&r1=743354&r2=743355&view=diff
==============================================================================
--- myfaces/core/branches/2_0_0/impl/src/test/java/org/apache/myfaces/renderkit/html/HtmlRadioRendererTest.java (original)
+++ myfaces/core/branches/2_0_0/impl/src/test/java/org/apache/myfaces/renderkit/html/HtmlRadioRendererTest.java Wed Feb 11 15:02:41 2009
@@ -1,30 +1,39 @@
/*
- * Copyright 2006 The Apache Software Foundation.
+ * 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
*
- * 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
*
- * 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.
+ * 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;
-import org.apache.shale.test.base.AbstractJsfTestCase;
-import org.apache.shale.test.mock.MockRenderKitFactory;
-import org.apache.shale.test.mock.MockResponseWriter;
+import java.io.StringWriter;
+import java.util.ArrayList;
+import java.util.List;
import javax.faces.component.UISelectItems;
import javax.faces.component.html.HtmlSelectOneRadio;
import javax.faces.model.SelectItem;
-import java.io.StringWriter;
-import java.util.ArrayList;
-import java.util.List;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+import org.apache.myfaces.test.utils.HtmlCheckAttributesUtil;
+import org.apache.myfaces.test.utils.HtmlRenderedAttr;
+import org.apache.shale.test.base.AbstractJsfTestCase;
+import org.apache.shale.test.mock.MockRenderKitFactory;
+import org.apache.shale.test.mock.MockResponseWriter;
/**
* @author Bruno Aranda (latest modification by $Author$)
@@ -39,8 +48,12 @@
{
super(name);
}
+
+ public static Test suite() {
+ return new TestSuite(HtmlRadioRendererTest.class);
+ }
- protected void setUp() throws Exception
+ public void setUp() throws Exception
{
super.setUp();
@@ -57,55 +70,59 @@
}
- protected void tearDown() throws Exception
+ public void tearDown() throws Exception
{
super.tearDown();
selectOneRadio = null;
writer = null;
}
-
- public void testDefault() throws Exception
- {
- List<SelectItem> items = new ArrayList<SelectItem>();
- items.add(new SelectItem("mars"));
- items.add(new SelectItem("jupiter"));
-
- UISelectItems selectItems = new UISelectItems();
- selectItems.setValue(items);
-
- selectOneRadio.getChildren().add(selectItems);
-
- selectOneRadio.encodeEnd(facesContext);
- facesContext.renderResponse();
-
- String output = writer.getWriter().toString();
-
- assertEquals("<table><tr>\t\t" +
- "<td><input id=\"j_id0:0\" type=\"radio\" name=\"j_id0\" value=\"mars\"/><label for=\"j_id0:0\"> mars</label></td>\t\t" +
- "<td><input id=\"j_id0:1\" type=\"radio\" name=\"j_id0\" value=\"jupiter\"/><label for=\"j_id0:1\"> jupiter</label></td>" +
- "</tr></table>", output);
- }
-
- public void testDefaultStylePassthru() throws Exception
+
+ 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"),
+ 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", 1),
+ new HtmlRenderedAttr("styleClass", "styleClass", "class=\"styleClass\"", 1),
+
+ //_TabindexProperty
+ new HtmlRenderedAttr("tabindex")
+ };
+
List<SelectItem> items = new ArrayList<SelectItem>();
items.add(new SelectItem("mars"));
- items.add(new SelectItem("jupiter"));
UISelectItems selectItems = new UISelectItems();
selectItems.setValue(items);
selectOneRadio.getChildren().add(selectItems);
- selectOneRadio.setStyle("color: red;");
-
- selectOneRadio.encodeEnd(facesContext);
- facesContext.renderResponse();
-
- String output = writer.getWriter().toString();
- assertEquals("<table style=\"color: red;\"><tr>\t\t" +
- "<td><input id=\"j_id0:0\" type=\"radio\" name=\"j_id0\" value=\"mars\"/><label for=\"j_id0:0\"> mars</label></td>\t\t" +
- "<td><input id=\"j_id0:1\" type=\"radio\" name=\"j_id0\" value=\"jupiter\"/><label for=\"j_id0:1\"> jupiter</label></td>" +
- "</tr></table>", output);
+ HtmlCheckAttributesUtil.checkRenderedAttributes(
+ selectOneRadio, facesContext, writer, attrs);
+ if(HtmlCheckAttributesUtil.hasFailedAttrRender(attrs)) {
+ fail(HtmlCheckAttributesUtil.constructErrorMessage(attrs, writer.getWriter().toString()));
+ }
}
}
Modified: myfaces/core/branches/2_0_0/impl/src/test/java/org/apache/myfaces/renderkit/html/HtmlSecretRendererTest.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2_0_0/impl/src/test/java/org/apache/myfaces/renderkit/html/HtmlSecretRendererTest.java?rev=743355&r1=743354&r2=743355&view=diff
==============================================================================
--- myfaces/core/branches/2_0_0/impl/src/test/java/org/apache/myfaces/renderkit/html/HtmlSecretRendererTest.java (original)
+++ myfaces/core/branches/2_0_0/impl/src/test/java/org/apache/myfaces/renderkit/html/HtmlSecretRendererTest.java Wed Feb 11 15:02:41 2009
@@ -1,12 +1,36 @@
+/*
+ * 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;
+import java.io.StringWriter;
+
+import javax.faces.component.html.HtmlInputSecret;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+import org.apache.myfaces.test.utils.HtmlCheckAttributesUtil;
+import org.apache.myfaces.test.utils.HtmlRenderedAttr;
import org.apache.shale.test.base.AbstractJsfTestCase;
import org.apache.shale.test.mock.MockRenderKitFactory;
import org.apache.shale.test.mock.MockResponseWriter;
-import javax.faces.component.html.HtmlInputSecret;
-import java.io.StringWriter;
-
/**
* @author Bruno Aranda (latest modification by $Author: baranda $)
* @version $Revision: 451814 $ $Date: 2006-10-01 22:28:42 +0100 (dom, 01 oct 2006) $
@@ -20,8 +44,12 @@
{
super(name);
}
+
+ public static Test suite() {
+ return new TestSuite(HtmlSecretRendererTest.class);
+ }
- protected void setUp() throws Exception
+ public void setUp() throws Exception
{
super.setUp();
@@ -38,7 +66,7 @@
}
- protected void tearDown() throws Exception
+ public void tearDown() throws Exception
{
super.tearDown();
inputText = null;
@@ -54,25 +82,14 @@
assertEquals("<input type=\"password\" name=\"j_id0\"/>", output);
}
- public void testInputTextAutocompleteOn() throws Exception
- {
- inputText.setAutocomplete("on");
- inputText.encodeEnd(facesContext);
- facesContext.renderResponse();
-
- String output = writer.getWriter().toString();
-
- assertEquals("<input type=\"password\" name=\"j_id0\"/>", output);
- }
-
- public void testInputTextAutocompleteOff() throws Exception
+ public void testHtmlPropertyPassTru() throws Exception
{
- inputText.setAutocomplete("off");
- inputText.encodeEnd(facesContext);
- facesContext.renderResponse();
-
- String output = writer.getWriter().toString();
- assertEquals("<input type=\"password\" name=\"j_id0\" autocomplete=\"off\"/>", output);
+ HtmlRenderedAttr[] attrs = HtmlCheckAttributesUtil.generateBasicAttrs();
+
+ HtmlCheckAttributesUtil.checkRenderedAttributes(
+ inputText, facesContext, writer, attrs);
+ if(HtmlCheckAttributesUtil.hasFailedAttrRender(attrs)) {
+ fail(HtmlCheckAttributesUtil.constructErrorMessage(attrs, writer.getWriter().toString()));
+ }
}
-
-}
\ No newline at end of file
+}
Modified: myfaces/core/branches/2_0_0/impl/src/test/java/org/apache/myfaces/renderkit/html/HtmlTableRendererTest.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2_0_0/impl/src/test/java/org/apache/myfaces/renderkit/html/HtmlTableRendererTest.java?rev=743355&r1=743354&r2=743355&view=diff
==============================================================================
--- myfaces/core/branches/2_0_0/impl/src/test/java/org/apache/myfaces/renderkit/html/HtmlTableRendererTest.java (original)
+++ myfaces/core/branches/2_0_0/impl/src/test/java/org/apache/myfaces/renderkit/html/HtmlTableRendererTest.java Wed Feb 11 15:02:41 2009
@@ -1,39 +1,59 @@
+/*
+ * 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;
+import java.io.StringWriter;
+
+import javax.faces.component.html.HtmlDataTable;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+import org.apache.myfaces.test.utils.HtmlCheckAttributesUtil;
+import org.apache.myfaces.test.utils.HtmlRenderedAttr;
import org.apache.shale.test.base.AbstractJsfTestCase;
import org.apache.shale.test.mock.MockRenderKitFactory;
import org.apache.shale.test.mock.MockResponseWriter;
-import javax.el.ValueExpression;
-import javax.faces.component.UIColumn;
-import javax.faces.component.html.HtmlDataTable;
-import javax.faces.component.html.HtmlOutputText;
-import java.io.StringWriter;
-
/**
* @author Bruno Aranda (latest modification by $Author: baranda $)
* @version $Revision: 451814 $ $Date: 2006-10-01 22:28:42 +0100 (dom, 01 oct 2006) $
*/
public class HtmlTableRendererTest extends AbstractJsfTestCase
{
- private static final String LINE_SEPARATOR = System.getProperty(
- "line.separator", "\r\n");
-
private MockResponseWriter writer ;
private HtmlDataTable dataTable;
- private HtmlOutputText colText;
public HtmlTableRendererTest(String name)
{
super(name);
}
+
+ public static Test suite() {
+ return new TestSuite(HtmlTableRendererTest.class);
+ }
- protected void setUp() throws Exception
+ public void setUp() throws Exception
{
super.setUp();
dataTable = new HtmlDataTable();
- colText = new HtmlOutputText();
writer = new MockResponseWriter(new StringWriter(), null, null);
facesContext.setResponseWriter(writer);
@@ -43,114 +63,35 @@
dataTable.getFamily(),
dataTable.getRendererType(),
new HtmlTableRenderer());
- facesContext.getRenderKit().addRenderer(
- colText.getFamily(),
- colText.getRendererType(),
- new HtmlTextRenderer());
}
- protected void tearDown() throws Exception
+ public void tearDown() throws Exception
{
super.tearDown();
dataTable = null;
writer = null;
}
- public void testRenderTable() throws Exception
- {
- dataTable.setValue(new Integer[] {1,2,3});
- dataTable.setVar("var");
-
- UIColumn col = new UIColumn();
-
- ValueExpression varValueExpression = facesContext.getApplication().getExpressionFactory()
- .createValueExpression(facesContext.getELContext(), "#{var}", Integer.class);
- colText.setValueExpression("value", varValueExpression);
-
- col.getChildren().add(colText);
- dataTable.getChildren().add(col);
-
-
-
- dataTable.encodeAll(facesContext);
- facesContext.renderResponse();
-
- String output = writer.getWriter().toString();
-
- assertEquals(LINE_SEPARATOR +
- "<table>" + LINE_SEPARATOR +
- "<tbody id=\"j_id0:tbody_element\">" + LINE_SEPARATOR +
- "<tr><td>1</td></tr>" + LINE_SEPARATOR +
- "<tr><td>2</td></tr>" + LINE_SEPARATOR +
- "<tr><td>3</td></tr></tbody></table>"+LINE_SEPARATOR, output);
- }
-
- public void testRenderTableWithColumnHeader() throws Exception
+ public void testHtmlPropertyPassTru() throws Exception
{
- dataTable.setValue(new String[] {"One","Two","Three"});
- dataTable.setVar("var");
-
- UIColumn col = new UIColumn();
- HtmlOutputText headerTest = new HtmlOutputText();
- headerTest.setValue("colHeader");
- col.getFacets().put("header", headerTest);
-
- ValueExpression varValueExpression = facesContext.getApplication().getExpressionFactory()
- .createValueExpression(facesContext.getELContext(), "#{var}", String.class);
- colText.setValueExpression("value", varValueExpression);
-
- col.getChildren().add(colText);
- dataTable.getChildren().add(col);
-
-
-
- dataTable.encodeAll(facesContext);
- facesContext.renderResponse();
-
- String output = writer.getWriter().toString();
-
- assertEquals(LINE_SEPARATOR +
- "<table>" + LINE_SEPARATOR +
- "<thead>" + LINE_SEPARATOR +
- "<tr><th scope=\"col\">colHeader</th></tr></thead>" + LINE_SEPARATOR +
- "<tbody id=\"j_id0:tbody_element\">" + LINE_SEPARATOR +
- "<tr><td>One</td></tr>" + LINE_SEPARATOR +
- "<tr><td>Two</td></tr>" + LINE_SEPARATOR +
- "<tr><td>Three</td></tr></tbody></table>"+LINE_SEPARATOR, output);
+ HtmlRenderedAttr[] attrs = HtmlCheckAttributesUtil.generateBasicReadOnlyAttrs();
+
+ HtmlCheckAttributesUtil.checkRenderedAttributes(
+ dataTable, 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(
+ dataTable, facesContext, writer, attrs);
+ if(HtmlCheckAttributesUtil.hasFailedAttrRender(attrs)) {
+ fail(HtmlCheckAttributesUtil.constructErrorMessage(attrs, writer.getWriter().toString()));
+ }
}
-
-
- public void testRenderTableWithHeader() throws Exception
- {
- dataTable.setValue(new String[] {"One","Two","Three"});
- dataTable.setVar("var");
-
- HtmlOutputText headerTest = new HtmlOutputText();
- headerTest.setValue("colHeader");
- dataTable.getFacets().put("header", headerTest);
-
- UIColumn col = new UIColumn();
-
- ValueExpression varValueExpression = facesContext.getApplication().getExpressionFactory()
- .createValueExpression(facesContext.getELContext(), "#{var}", String.class);
- colText.setValueExpression("value", varValueExpression);
-
- col.getChildren().add(colText);
- dataTable.getChildren().add(col);
-
- dataTable.encodeAll(facesContext);
- facesContext.renderResponse();
-
- String output = writer.getWriter().toString();
- assertEquals(LINE_SEPARATOR +
- "<table>" + LINE_SEPARATOR +
- "<thead>" + LINE_SEPARATOR +
- "<tr><th scope=\"colgroup\" colspan=\"1\">colHeader</th></tr></thead>" + LINE_SEPARATOR +
- "<tbody id=\"j_id0:tbody_element\">" + LINE_SEPARATOR +
- "<tr><td>One</td></tr>" + LINE_SEPARATOR +
- "<tr><td>Two</td></tr>" + LINE_SEPARATOR +
- "<tr><td>Three</td></tr></tbody></table>"+LINE_SEPARATOR, output);
- }
-
-}
\ No newline at end of file
+}
Modified: myfaces/core/branches/2_0_0/impl/src/test/java/org/apache/myfaces/renderkit/html/HtmlTextRendererTest.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2_0_0/impl/src/test/java/org/apache/myfaces/renderkit/html/HtmlTextRendererTest.java?rev=743355&r1=743354&r2=743355&view=diff
==============================================================================
--- myfaces/core/branches/2_0_0/impl/src/test/java/org/apache/myfaces/renderkit/html/HtmlTextRendererTest.java (original)
+++ myfaces/core/branches/2_0_0/impl/src/test/java/org/apache/myfaces/renderkit/html/HtmlTextRendererTest.java Wed Feb 11 15:02:41 2009
@@ -1,19 +1,52 @@
+/*
+ * 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;
+import java.io.IOException;
+import java.io.StringWriter;
+
+import javax.faces.component.html.HtmlInputText;
+import javax.faces.component.html.HtmlOutputText;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+import org.apache.myfaces.test.utils.HtmlCheckAttributesUtil;
+import org.apache.myfaces.test.utils.HtmlRenderedAttr;
import org.apache.shale.test.base.AbstractJsfTestCase;
import org.apache.shale.test.mock.MockRenderKitFactory;
import org.apache.shale.test.mock.MockResponseWriter;
-import javax.faces.component.html.HtmlInputText;
-import java.io.StringWriter;
-
/**
- * @author Bruno Aranda (latest modification by $Author: baranda $)
- * @version $Revision: 451814 $ $Date: 2006-10-01 22:28:42 +0100 (dom, 01 oct 2006) $
+ * @author Bruno Aranda (latest modification by $Author: grantsmith $)
+ * @version $Revision: 472618 $ $Date: 2006-11-09 04:06:54 +0800 (Thu, 09 Nov 2006) $
*/
public class HtmlTextRendererTest extends AbstractJsfTestCase
{
+
+ public static Test suite()
+ {
+ return new TestSuite(HtmlTextRendererTest.class); // needed in maven
+ }
+
private MockResponseWriter writer ;
+ private HtmlOutputText outputText;
private HtmlInputText inputText;
public HtmlTextRendererTest(String name)
@@ -21,59 +54,58 @@
super(name);
}
- protected void setUp() throws Exception
+ public void setUp() throws Exception
{
super.setUp();
+ outputText = new HtmlOutputText();
inputText = new HtmlInputText();
writer = new MockResponseWriter(new StringWriter(), null, null);
facesContext.setResponseWriter(writer);
-
+ // TODO remove these two lines once shale-test goes alpha, see MYFACES-1155
facesContext.getViewRoot().setRenderKitId(MockRenderKitFactory.HTML_BASIC_RENDER_KIT);
facesContext.getRenderKit().addRenderer(
+ outputText.getFamily(),
+ outputText.getRendererType(),
+ new HtmlTextRenderer());
+ facesContext.getRenderKit().addRenderer(
inputText.getFamily(),
inputText.getRendererType(),
new HtmlTextRenderer());
-
}
- protected void tearDown() throws Exception
+ public void tearDown() throws Exception
{
super.tearDown();
+ outputText = null;
inputText = null;
writer = null;
}
- public void testInputTextDefault() throws Exception
+ public void testStyleClassAttr() throws IOException
{
- inputText.encodeEnd(facesContext);
+ outputText.setValue("Output");
+ outputText.setStyleClass("myStyleClass");
+
+ outputText.encodeEnd(facesContext);
facesContext.renderResponse();
String output = writer.getWriter().toString();
- assertEquals("<input id=\"j_id0\" name=\"j_id0\" type=\"text\" value=\"\"/>", output);
+ assertEquals("<span class=\"myStyleClass\">Output</span>", output);
+ assertNotSame("Output", output);
}
- public void testInputTextAutocompleteOn() throws Exception
+ public void testHtmlPropertyPassTru() throws Exception
{
- inputText.setAutocomplete("on");
- inputText.encodeEnd(facesContext);
- facesContext.renderResponse();
-
- String output = writer.getWriter().toString();
+ HtmlRenderedAttr[] attrs = HtmlCheckAttributesUtil.generateBasicAttrs();
- assertEquals("<input id=\"j_id0\" name=\"j_id0\" type=\"text\" value=\"\"/>", output);
- }
-
- public void testInputTextAutocompleteOff() throws Exception
- {
- inputText.setAutocomplete("off");
- inputText.encodeEnd(facesContext);
- facesContext.renderResponse();
- String output = writer.getWriter().toString();
- assertEquals("<input id=\"j_id0\" name=\"j_id0\" type=\"text\" value=\"\" autocomplete=\"off\"/>", output);
+ HtmlCheckAttributesUtil.checkRenderedAttributes(
+ inputText, facesContext, writer, attrs);
+ if(HtmlCheckAttributesUtil.hasFailedAttrRender(attrs)) {
+ fail(HtmlCheckAttributesUtil.constructErrorMessage(attrs, writer.getWriter().toString()));
+ }
}
-
}
Modified: myfaces/core/branches/2_0_0/impl/src/test/java/org/apache/myfaces/renderkit/html/HtmlTextareaRendererTest.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2_0_0/impl/src/test/java/org/apache/myfaces/renderkit/html/HtmlTextareaRendererTest.java?rev=743355&r1=743354&r2=743355&view=diff
==============================================================================
--- myfaces/core/branches/2_0_0/impl/src/test/java/org/apache/myfaces/renderkit/html/HtmlTextareaRendererTest.java (original)
+++ myfaces/core/branches/2_0_0/impl/src/test/java/org/apache/myfaces/renderkit/html/HtmlTextareaRendererTest.java Wed Feb 11 15:02:41 2009
@@ -1,12 +1,36 @@
+/*
+ * 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;
+import java.io.StringWriter;
+
+import javax.faces.component.html.HtmlInputTextarea;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+import org.apache.myfaces.test.utils.HtmlCheckAttributesUtil;
+import org.apache.myfaces.test.utils.HtmlRenderedAttr;
import org.apache.shale.test.base.AbstractJsfTestCase;
import org.apache.shale.test.mock.MockRenderKitFactory;
import org.apache.shale.test.mock.MockResponseWriter;
-import javax.faces.component.html.HtmlInputTextarea;
-import java.io.StringWriter;
-
/**
* @author Bruno Aranda (latest modification by $Author: baranda $)
* @version $Revision: 451814 $ $Date: 2006-10-01 22:28:42 +0100 (dom, 01 oct 2006) $
@@ -20,8 +44,12 @@
{
super(name);
}
+
+ public static Test suite() {
+ return new TestSuite(HtmlTextareaRendererTest.class);
+ }
- protected void setUp() throws Exception
+ public void setUp() throws Exception
{
super.setUp();
@@ -38,7 +66,7 @@
}
- protected void tearDown() throws Exception
+ public void tearDown() throws Exception
{
super.tearDown();
inputTextarea = null;
@@ -64,4 +92,15 @@
String output = writer.getWriter().toString();
assertEquals("<textarea name=\"j_id0\" cols=\"5\" rows=\"10\"></textarea>", output);
}
-}
\ No newline at end of file
+
+ public void testHtmlPropertyPassTru() throws Exception
+ {
+ HtmlRenderedAttr[] attrs = HtmlCheckAttributesUtil.generateBasicAttrs();
+
+ HtmlCheckAttributesUtil.checkRenderedAttributes(
+ inputTextarea, facesContext, writer, attrs);
+ if(HtmlCheckAttributesUtil.hasFailedAttrRender(attrs)) {
+ fail(HtmlCheckAttributesUtil.constructErrorMessage(attrs, writer.getWriter().toString()));
+ }
+ }
+}
Modified: myfaces/core/branches/2_0_0/pom.xml
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2_0_0/pom.xml?rev=743355&r1=743354&r2=743355&view=diff
==============================================================================
--- myfaces/core/branches/2_0_0/pom.xml (original)
+++ myfaces/core/branches/2_0_0/pom.xml Wed Feb 11 15:02:41 2009
@@ -1,8 +1,4 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project
- xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<parent>
<groupId>org.apache.myfaces</groupId>
@@ -125,7 +121,7 @@
<artifactId>maven-pmd-plugin</artifactId>
<version>2.2</version>
<reportSets>
- <reportSet/>
+ <reportSet />
</reportSets>
</plugin>
</plugins>