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 2010/07/30 02:33:25 UTC
svn commit: r980615 [1/3] - in /myfaces/tomahawk/trunk/core20: ./
src/test/java/org/apache/myfaces/component/behavior/
src/test/java/org/apache/myfaces/component/html/ext/behavior/
src/test/java/org/apache/myfaces/custom/calendar/ src/test/java/org/apa...
Author: lu4242
Date: Fri Jul 30 00:33:23 2010
New Revision: 980615
URL: http://svn.apache.org/viewvc?rev=980615&view=rev
Log:
TOMAHAWK-1530 Create tests for clientEvent properties
Added:
myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/component/behavior/
myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/component/behavior/AbstractClientBehaviorTestCase.java
myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/component/behavior/HtmlClientEventAttributesUtil.java
myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/component/behavior/HtmlRenderedClientEventAttr.java
myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/component/html/ext/behavior/
myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/component/html/ext/behavior/HtmlCommandButtonClientBehaviorRendererTest.java
myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/component/html/ext/behavior/HtmlCommandLinkClientBehaviorRendererTest.java
myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/component/html/ext/behavior/HtmlDataTableClientBehaviorRendererTest.java
myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/component/html/ext/behavior/HtmlGraphicImageClientBehaviorRendererTest.java
myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/component/html/ext/behavior/HtmlMessageClientBehaviorTest.java
myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/component/html/ext/behavior/HtmlMessagesClientBehaviorTest.java
myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/component/html/ext/behavior/HtmlOutputLabelClientBehaviorRendererTest.java
myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/component/html/ext/behavior/HtmlOutputTextClientBehaviorTest.java
myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/component/html/ext/behavior/HtmlPanelGridClientBehaviorRendererTest.java
myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/component/html/ext/behavior/HtmlPanelGroupDivClientBehaviorTest.java
myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/component/html/ext/behavior/HtmlPanelGroupSpanClientBehaviorTest.java
myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/component/html/ext/behavior/HtmlSecretClientBehaviorRendererTest.java
myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/component/html/ext/behavior/HtmlSelectBooleanCheckboxClientBehaviorRendererTest.java
myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/component/html/ext/behavior/HtmlSelectManyCheckboxClientBehaviorRendererTest.java
myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/component/html/ext/behavior/HtmlSelectManyListboxClientBehaviorRendererTest.java
myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/component/html/ext/behavior/HtmlSelectManyMenuClientBehaviorRendererTest.java
myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/component/html/ext/behavior/HtmlSelectOneListboxClientBehaviorRendererTest.java
myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/component/html/ext/behavior/HtmlSelectOneMenuClientBehaviorRendererTest.java
myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/component/html/ext/behavior/HtmlSelectOneRadioClientBehaviorRendererTest.java
myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/component/html/ext/behavior/HtmlTextClientBehaviorRendererTest.java
myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/component/html/ext/behavior/HtmlTextareaClientBehaviorRendererTest.java
myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/custom/calendar/HtmlCalendarInlineClientBehaviorRendererTest.java
myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/custom/calendar/HtmlCalendarPopupClientBehaviorRendererTest.java
myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/custom/datalist/HtmlDataListGridClientBehaviorRendererTest.java
myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/custom/datalist/HtmlDataListOLClientBehaviorRendererTest.java
myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/custom/datalist/HtmlDataListSimpleClientBehaviorRendererTest.java
myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/custom/datalist/HtmlDataListULClientBehaviorRendererTest.java
myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/custom/date/HtmlDateClientBehaviorRendererTest.java
myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/custom/div/DivClientBehaviorTest.java
myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/custom/document/
myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/custom/document/DocumentBodyClientBehaviorRendererTest.java
myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/custom/fileupload/HtmlFileUploadClientBehaviorRendererTest.java
myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/custom/inputTextHelp/HtmlTextHelpClientBehaviorHelpTextRendererTest.java
myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/custom/inputTextHelp/HtmlTextHelpClientBehaviorRendererTest.java
myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/custom/layout/HtmlLayoutClientBehaviorRendererTest.java
myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/custom/layout/HtmlLayoutNavRightClientBehaviorRendererTest.java
myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/custom/layout/HtmlLayoutUpsideDownClientBehaviorRendererTest.java
myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/custom/navigation/HtmlNavigationClientBehaviorTest.java
myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/custom/navmenu/
myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/custom/navmenu/htmlnavmenu/
myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/custom/navmenu/htmlnavmenu/HtmlNavigationMenuClientBehaviorTest.java
myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/custom/navmenu/htmlnavmenu/HtmlNavigationMenuRendererTest.java
myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/custom/newspaper/HtmlNewspaperTableClientBehaviorRendererTest.java
myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/custom/picklist/HtmlPicklistClientBehaviorRendererTest.java
myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/custom/selectOneCountry/SelectOneCountryClientBehaviorRendererTest.java
myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/custom/selectOneLanguage/SelectOneLanguageClientBehaviorRendererTest.java
myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/custom/selectOneRow/SelectOneRowClientBehaviorRendererTest.java
myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/custom/swapimage/HtmlSwapImageClientBehaviorRendererTest.java
myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/custom/tabbedpane/HtmlTabbedPaneClientBehaviorTest.java
myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/custom/toggle/ToggleGroupClientBehaviorTest.java
myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/custom/toggle/ToggleLinkClientBehaviorRendererTest.java
myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/custom/toggle/TogglePanelClientBehaviorTest.java
Modified:
myfaces/tomahawk/trunk/core20/pom.xml
Modified: myfaces/tomahawk/trunk/core20/pom.xml
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/core20/pom.xml?rev=980615&r1=980614&r2=980615&view=diff
==============================================================================
--- myfaces/tomahawk/trunk/core20/pom.xml (original)
+++ myfaces/tomahawk/trunk/core20/pom.xml Fri Jul 30 00:33:23 2010
@@ -205,6 +205,15 @@
-->
<scope>test</scope>
</dependency>
+ <!--
+ <dependency>
+ <groupId>org.apache.myfaces.core</groupId>
+ <artifactId>myfaces-impl</artifactId>
+ <version>${myfaces-core20-version}</version>
+ <classifier>tests</classifier>
+ <scope>test</scope>
+ </dependency>
+ -->
<dependency>
<groupId>joda-time</groupId>
@@ -249,6 +258,13 @@
</dependency>
<dependency>
+ <groupId>commons-digester</groupId>
+ <artifactId>commons-digester</artifactId>
+ <version>1.8</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
<groupId>jmock</groupId>
<artifactId>jmock</artifactId>
<version>1.0.1</version>
Added: myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/component/behavior/AbstractClientBehaviorTestCase.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/component/behavior/AbstractClientBehaviorTestCase.java?rev=980615&view=auto
==============================================================================
--- myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/component/behavior/AbstractClientBehaviorTestCase.java (added)
+++ myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/component/behavior/AbstractClientBehaviorTestCase.java Fri Jul 30 00:33:23 2010
@@ -0,0 +1,243 @@
+/*
+ * 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.component.behavior;
+
+import javax.faces.component.UIComponent;
+import javax.faces.component.behavior.AjaxBehavior;
+import javax.faces.component.behavior.ClientBehaviorHolder;
+import javax.faces.context.ResponseWriter;
+
+import org.apache.myfaces.shared_tomahawk.config.MyfacesConfig;
+import org.apache.myfaces.shared_tomahawk.renderkit.html.HtmlResponseWriterImpl;
+import org.apache.myfaces.shared_tomahawk.util.FastWriter;
+import org.apache.myfaces.test.base.junit4.AbstractJsfTestCase;
+import org.apache.myfaces.test.config.ConfigParser;
+import org.junit.Assert;
+import org.junit.Test;
+
+public abstract class AbstractClientBehaviorTestCase extends AbstractJsfTestCase
+{
+ protected ResponseWriter writer;
+ protected FastWriter outputWriter;
+ protected ConfigParser parser;
+
+ //protected abstract UIComponent getComponentToTest();
+
+ protected abstract HtmlRenderedClientEventAttr[] getClientBehaviorHtmlRenderedAttributes();
+
+ protected abstract UIComponent createComponentToTest();
+
+ protected void dettachFromView()
+ {
+ }
+
+ @Override
+ protected void setUpServletObjects() throws Exception
+ {
+ super.setUpServletObjects();
+
+ servletContext.setAttribute("org.apache.myfaces.shared_tomahawk.config.MyfacesConfig", new MyfacesConfig());
+ }
+
+ @Override
+ protected void setUpJSFObjects() throws Exception
+ {
+ super.setUpJSFObjects();
+ outputWriter = new FastWriter();
+ writer = new HtmlResponseWriterImpl(outputWriter, null, null);
+ facesContext.setResponseWriter(writer);
+ facesContext.getAttributes().put("org.apache.myfaces.RENDERED_JSF_JS", true);
+ }
+
+ @Override
+ protected void setUpApplication() throws Exception
+ {
+ super.setUpApplication();
+ }
+
+ @Override
+ protected void setUpRenderKit() throws Exception
+ {
+ super.setUpRenderKit();
+ parser = new ConfigParser();
+ parser.parse(parser.getPlatformURLs());
+ parser.parse(this.getClass().getResource("/META-INF/faces-config.xml"));
+ }
+
+ /**
+ * Components that render client behaviors should always render "id" and "name" attribute
+ */
+ @Test
+ public void testClientBehaviorHolderRendersId()
+ {
+ HtmlRenderedClientEventAttr[] attrs = getClientBehaviorHtmlRenderedAttributes();
+
+ for (int i = 0; i < attrs.length; i++)
+ {
+ UIComponent component = createComponentToTest();
+ ClientBehaviorHolder clientBehaviorHolder = (ClientBehaviorHolder) component;
+ clientBehaviorHolder.addClientBehavior(attrs[i].getClientEvent(), new AjaxBehavior());
+ try
+ {
+ component.encodeAll(facesContext);
+ String output = outputWriter.toString();
+ Assert.assertTrue(output.indexOf(" id=\""+component.getClientId(facesContext)+"\"") > -1);
+ outputWriter.reset();
+ }
+ catch (Exception e)
+ {
+ Assert.fail(e.getMessage());
+ }
+ dettachFromView();
+ }
+ }
+
+ /**
+ * Components that render client behaviors should always render "id" and "name" attribute
+ */
+ @Test
+ public void testClientBehaviorHolderRendersName()
+ {
+ HtmlRenderedClientEventAttr[] attrs = getClientBehaviorHtmlRenderedAttributes();
+
+ for (int i = 0; i < attrs.length; i++)
+ {
+ UIComponent component = createComponentToTest();
+ ClientBehaviorHolder clientBehaviorHolder = (ClientBehaviorHolder) component;
+ clientBehaviorHolder.addClientBehavior(attrs[i].getClientEvent(), new AjaxBehavior());
+ try
+ {
+ component.encodeAll(facesContext);
+ String output = outputWriter.toString();
+ Assert.assertTrue(output.indexOf(" name=\""+component.getClientId(facesContext)+"\"") > -1);
+ outputWriter.reset();
+ }
+ catch (Exception e)
+ {
+ Assert.fail(e.getMessage());
+ }
+ dettachFromView();
+ }
+ }
+
+ @Test
+ public void testClientBehaviorRendered()
+ {
+ HtmlRenderedClientEventAttr[] attrs = getClientBehaviorHtmlRenderedAttributes();
+
+ for (int i = 0; i < attrs.length; i++)
+ {
+ UIComponent component = createComponentToTest();
+ ClientBehaviorHolder clientBehaviorHolder = (ClientBehaviorHolder) component;
+ clientBehaviorHolder.addClientBehavior(attrs[i].getClientEvent(), new AjaxBehavior());
+ try
+ {
+ component.encodeAll(facesContext);
+ String output = outputWriter.toString();
+ //jsf.ajax.request('j_id0',event,{'javax.faces.behavior.event':'click'})
+ //Only check if the property starts with jsf.ajax.request( is enough
+ //Assert.assertTrue("output does not match expected output jsf.ajax.request(.... for property "+attrs[i].getName(),
+ // output.matches(".+ "+attrs[i].getName()+"=\"jsf\\.ajax\\.request\\(.+"));
+ int index = checkClientBehaviorRenderedOnClientEventProperty(output, 0, attrs[i]);
+ outputWriter.reset();
+ }
+ catch (Exception e)
+ {
+ Assert.fail(e.getMessage());
+ }
+ dettachFromView();
+ }
+ }
+
+ public int checkClientBehaviorRenderedOnClientEventProperty(String output, int start, HtmlRenderedClientEventAttr attr)
+ {
+ String propStart = " "+attr.getName()+"=\"";
+ int propIndex = output.indexOf(propStart, start);
+ if (propIndex > -1)
+ {
+ int c = '"';
+ int startPropIndex = propIndex + propStart.length();
+ int endPropIndex = output.indexOf('"' , startPropIndex );
+ String propertyValue = output.substring(startPropIndex, endPropIndex);
+ Assert.assertTrue("Property: " + attr.getName()+" Output: "+output, propertyValue.contains("jsf.ajax.request("));
+ Assert.assertTrue("Property: " + attr.getName()+" Output: "+output, propertyValue.contains("javax.faces.behavior.event"));
+ Assert.assertTrue("Property: " + attr.getName()+" Output: "+output, propertyValue.contains(attr.getClientEvent()));
+ return endPropIndex + 1;
+ }
+ else
+ {
+ Assert.fail("Property " + attr.getName() + "not found");
+ return -1;
+ }
+ }
+
+ @Test
+ public void testClientBehaviorRenderedWithHtmlAttribute()
+ {
+ HtmlRenderedClientEventAttr[] attrs = getClientBehaviorHtmlRenderedAttributes();
+
+ for (int i = 0; i < attrs.length; i++)
+ {
+ UIComponent component = createComponentToTest();
+ ClientBehaviorHolder clientBehaviorHolder = (ClientBehaviorHolder) component;
+ clientBehaviorHolder.addClientBehavior(attrs[i].getClientEvent(), new AjaxBehavior());
+ component.getAttributes().put(attrs[i].getName(), "htmlValue");
+ try
+ {
+ component.encodeAll(facesContext);
+ String output = outputWriter.toString();
+ //jsf.ajax.request('j_id0',event,{'javax.faces.behavior.event':'click'})
+ //Only check if the property starts with jsf.ajax.request( is enough
+ //Assert.assertTrue("output does not match expected output jsf.ajax.request(.... for property "+attrs[i].getName(),
+ // output.matches(".+ "+attrs[i].getName()+"=\"jsf\\.ajax\\.request\\(.+"));
+ int index = checkClientBehaviorRenderedOnClientEventPropertyAndHtmlValue(output, 0, attrs[i], "htmlValue");
+ outputWriter.reset();
+ }
+ catch (Exception e)
+ {
+ Assert.fail(e.getMessage());
+ }
+ dettachFromView();
+ }
+ }
+
+ public int checkClientBehaviorRenderedOnClientEventPropertyAndHtmlValue(String output, int start, HtmlRenderedClientEventAttr attr, String value)
+ {
+ String propStart = " "+attr.getName()+"=\"";
+ int propIndex = output.indexOf(propStart, start);
+ if (propIndex > -1)
+ {
+ int c = '"';
+ int startPropIndex = propIndex + propStart.length();
+ int endPropIndex = output.indexOf('"' , startPropIndex );
+ String propertyValue = output.substring(startPropIndex, endPropIndex);
+ Assert.assertTrue("Property: " + attr.getName()+" Output: "+output, propertyValue.startsWith("jsf.util.chain("));
+ Assert.assertTrue("Property: " + attr.getName()+" Output: "+output, propertyValue.contains("jsf.ajax.request("));
+ Assert.assertTrue("Property: " + attr.getName()+" Output: "+output, propertyValue.contains("javax.faces.behavior.event"));
+ Assert.assertTrue("Property: " + attr.getName()+" Output: "+output, propertyValue.contains(attr.getClientEvent()));
+ Assert.assertTrue("Property: " + attr.getName()+" Output: "+output, propertyValue.contains(value));
+ return endPropIndex + 1;
+ }
+ else
+ {
+ Assert.fail("Property " + attr.getName() + "not found"+" Output: "+output);
+ return -1;
+ }
+ }
+}
Added: myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/component/behavior/HtmlClientEventAttributesUtil.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/component/behavior/HtmlClientEventAttributesUtil.java?rev=980615&view=auto
==============================================================================
--- myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/component/behavior/HtmlClientEventAttributesUtil.java (added)
+++ myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/component/behavior/HtmlClientEventAttributesUtil.java Fri Jul 30 00:33:23 2010
@@ -0,0 +1,57 @@
+/*
+ * 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.component.behavior;
+
+import org.apache.myfaces.shared_impl.renderkit.ClientBehaviorEvents;
+import org.apache.myfaces.shared_impl.renderkit.html.HTML;
+
+public class HtmlClientEventAttributesUtil
+{
+ public static HtmlRenderedClientEventAttr[] generateClientBehaviorEventAttrs()
+ {
+ HtmlRenderedClientEventAttr[] attrs = new HtmlRenderedClientEventAttr[]{
+ new HtmlRenderedClientEventAttr(HTML.ONCLICK_ATTR, ClientBehaviorEvents.CLICK),
+ new HtmlRenderedClientEventAttr(HTML.ONDBLCLICK_ATTR, ClientBehaviorEvents.DBLCLICK),
+ new HtmlRenderedClientEventAttr(HTML.ONKEYDOWN_ATTR, ClientBehaviorEvents.KEYDOWN),
+ new HtmlRenderedClientEventAttr(HTML.ONKEYPRESS_ATTR, ClientBehaviorEvents.KEYPRESS),
+ new HtmlRenderedClientEventAttr(HTML.ONKEYUP_ATTR, ClientBehaviorEvents.KEYUP),
+ new HtmlRenderedClientEventAttr(HTML.ONMOUSEDOWN_ATTR, ClientBehaviorEvents.MOUSEDOWN),
+ new HtmlRenderedClientEventAttr(HTML.ONMOUSEMOVE_ATTR, ClientBehaviorEvents.MOUSEMOVE),
+ new HtmlRenderedClientEventAttr(HTML.ONMOUSEOUT_ATTR, ClientBehaviorEvents.MOUSEOUT),
+ new HtmlRenderedClientEventAttr(HTML.ONMOUSEOVER_ATTR, ClientBehaviorEvents.MOUSEOVER),
+ new HtmlRenderedClientEventAttr(HTML.ONMOUSEUP_ATTR, ClientBehaviorEvents.MOUSEUP)
+ };
+
+ return attrs;
+ }
+
+ public static HtmlRenderedClientEventAttr[] generateClientBehaviorInputEventAttrs()
+ {
+ return (HtmlRenderedClientEventAttr[])
+ org.apache.myfaces.shared_impl.util.ArrayUtils.concat(
+ generateClientBehaviorEventAttrs(),
+ new HtmlRenderedClientEventAttr[]{
+ new HtmlRenderedClientEventAttr(HTML.ONBLUR_ATTR, ClientBehaviorEvents.BLUR),
+ new HtmlRenderedClientEventAttr(HTML.ONFOCUS_ATTR, ClientBehaviorEvents.FOCUS),
+ new HtmlRenderedClientEventAttr(HTML.ONSELECT_ATTR, ClientBehaviorEvents.SELECT),
+ new HtmlRenderedClientEventAttr(HTML.ONCHANGE_ATTR, ClientBehaviorEvents.CHANGE),
+ new HtmlRenderedClientEventAttr(HTML.ONCHANGE_ATTR, ClientBehaviorEvents.VALUECHANGE)
+ });
+ }
+}
Added: myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/component/behavior/HtmlRenderedClientEventAttr.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/component/behavior/HtmlRenderedClientEventAttr.java?rev=980615&view=auto
==============================================================================
--- myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/component/behavior/HtmlRenderedClientEventAttr.java (added)
+++ myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/component/behavior/HtmlRenderedClientEventAttr.java Fri Jul 30 00:33:23 2010
@@ -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.component.behavior;
+
+public class HtmlRenderedClientEventAttr
+{
+ private String name;
+ private String clientEvent;
+ private String value;
+
+ public HtmlRenderedClientEventAttr(String name, String clientEvent) {
+ this(name, clientEvent, name);
+ }
+
+ public HtmlRenderedClientEventAttr(String name, String clientEvent, String value) {
+ this.name = name;
+ this.clientEvent = clientEvent;
+ this.value = value;
+ }
+
+ public String getName()
+ {
+ return name;
+ }
+
+ public void setName(String name)
+ {
+ this.name = name;
+ }
+
+ public String getClientEvent()
+ {
+ return clientEvent;
+ }
+
+ public void setClientEvent(String clientEvent)
+ {
+ this.clientEvent = clientEvent;
+ }
+
+ public String getValue()
+ {
+ return value;
+ }
+
+ public void setValue(String value)
+ {
+ this.value = value;
+ }
+}
Added: myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/component/html/ext/behavior/HtmlCommandButtonClientBehaviorRendererTest.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/component/html/ext/behavior/HtmlCommandButtonClientBehaviorRendererTest.java?rev=980615&view=auto
==============================================================================
--- myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/component/html/ext/behavior/HtmlCommandButtonClientBehaviorRendererTest.java (added)
+++ myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/component/html/ext/behavior/HtmlCommandButtonClientBehaviorRendererTest.java Fri Jul 30 00:33:23 2010
@@ -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.component.html.ext.behavior;
+
+import javax.faces.component.UIComponent;
+
+import org.apache.myfaces.application.NavigationHandlerImpl;
+import org.apache.myfaces.component.behavior.AbstractClientBehaviorTestCase;
+import org.apache.myfaces.component.behavior.HtmlClientEventAttributesUtil;
+import org.apache.myfaces.component.behavior.HtmlRenderedClientEventAttr;
+import org.apache.myfaces.component.html.ext.HtmlCommandButton;
+import org.apache.myfaces.shared_impl.renderkit.ClientBehaviorEvents;
+import org.apache.myfaces.shared_impl.renderkit.html.HTML;
+import org.apache.myfaces.shared_impl.util.ArrayUtils;
+
+/**
+ * @author Leonardo Uribe (latest modification by $Author: jankeesvanandel $)
+ * @version $Revision: 799929 $ $Date: 2009-08-01 16:29:33 -0500 (sáb, 01 ago 2009) $
+ */
+public class HtmlCommandButtonClientBehaviorRendererTest extends AbstractClientBehaviorTestCase
+{
+ private HtmlRenderedClientEventAttr[] attrs = null;
+
+ @Override
+ public void setUp() throws Exception
+ {
+ super.setUp();
+ attrs = (HtmlRenderedClientEventAttr[])
+ ArrayUtils.concat(HtmlClientEventAttributesUtil.generateClientBehaviorEventAttrs(),
+ new HtmlRenderedClientEventAttr[]{
+ new HtmlRenderedClientEventAttr(HTML.ONFOCUS_ATTR, ClientBehaviorEvents.FOCUS),
+ new HtmlRenderedClientEventAttr(HTML.ONBLUR_ATTR, ClientBehaviorEvents.BLUR),
+ new HtmlRenderedClientEventAttr(HTML.ONSELECT_ATTR, ClientBehaviorEvents.SELECT),
+ new HtmlRenderedClientEventAttr(HTML.ONCHANGE_ATTR, ClientBehaviorEvents.CHANGE),
+ new HtmlRenderedClientEventAttr(HTML.ONCLICK_ATTR, ClientBehaviorEvents.ACTION)
+ });
+ }
+
+
+
+ @Override
+ protected void setUpApplication() throws Exception
+ {
+ super.setUpApplication();
+ application.setNavigationHandler(new NavigationHandlerImpl());
+ }
+
+ @Override
+ public void tearDown() throws Exception
+ {
+ super.tearDown();
+ attrs = null;
+ }
+
+ @Override
+ protected UIComponent createComponentToTest()
+ {
+ return new HtmlCommandButton();
+ }
+
+ @Override
+ protected HtmlRenderedClientEventAttr[] getClientBehaviorHtmlRenderedAttributes()
+ {
+ return attrs;
+ }
+}
Added: myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/component/html/ext/behavior/HtmlCommandLinkClientBehaviorRendererTest.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/component/html/ext/behavior/HtmlCommandLinkClientBehaviorRendererTest.java?rev=980615&view=auto
==============================================================================
--- myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/component/html/ext/behavior/HtmlCommandLinkClientBehaviorRendererTest.java (added)
+++ myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/component/html/ext/behavior/HtmlCommandLinkClientBehaviorRendererTest.java Fri Jul 30 00:33:23 2010
@@ -0,0 +1,85 @@
+/*
+ * 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.component.html.ext.behavior;
+
+import javax.faces.component.UIComponent;
+import javax.faces.component.html.HtmlForm;
+
+import org.apache.myfaces.application.NavigationHandlerImpl;
+import org.apache.myfaces.component.behavior.AbstractClientBehaviorTestCase;
+import org.apache.myfaces.component.behavior.HtmlClientEventAttributesUtil;
+import org.apache.myfaces.component.behavior.HtmlRenderedClientEventAttr;
+import org.apache.myfaces.component.html.ext.HtmlCommandLink;
+import org.apache.myfaces.shared_impl.renderkit.ClientBehaviorEvents;
+import org.apache.myfaces.shared_impl.renderkit.html.HTML;
+import org.apache.myfaces.shared_impl.util.ArrayUtils;
+
+/**
+ * @author Leonardo Uribe (latest modification by $Author: jankeesvanandel $)
+ * @version $Revision: 799929 $ $Date: 2009-08-01 16:29:33 -0500 (sáb, 01 ago 2009) $
+ */
+public class HtmlCommandLinkClientBehaviorRendererTest extends AbstractClientBehaviorTestCase
+{
+ private HtmlRenderedClientEventAttr[] attrs = null;
+
+ @Override
+ public void setUp() throws Exception
+ {
+ super.setUp();
+ attrs = (HtmlRenderedClientEventAttr[])
+ ArrayUtils.concat(HtmlClientEventAttributesUtil.generateClientBehaviorEventAttrs(),
+ new HtmlRenderedClientEventAttr[]{
+ new HtmlRenderedClientEventAttr(HTML.ONFOCUS_ATTR, ClientBehaviorEvents.FOCUS),
+ new HtmlRenderedClientEventAttr(HTML.ONBLUR_ATTR, ClientBehaviorEvents.BLUR),
+ new HtmlRenderedClientEventAttr(HTML.ONCLICK_ATTR, ClientBehaviorEvents.ACTION)
+ });
+ }
+
+
+
+ @Override
+ protected void setUpApplication() throws Exception
+ {
+ super.setUpApplication();
+ application.setNavigationHandler(new NavigationHandlerImpl());
+ }
+
+ @Override
+ public void tearDown() throws Exception
+ {
+ super.tearDown();
+ attrs = null;
+ }
+
+ @Override
+ protected UIComponent createComponentToTest()
+ {
+ UIComponent component = new HtmlCommandLink();
+ UIComponent form = new HtmlForm();
+ form.getChildren().add(component);
+ facesContext.getViewRoot().getChildren().add(form);
+ return component;
+ }
+
+ @Override
+ protected HtmlRenderedClientEventAttr[] getClientBehaviorHtmlRenderedAttributes()
+ {
+ return attrs;
+ }
+}
Added: myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/component/html/ext/behavior/HtmlDataTableClientBehaviorRendererTest.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/component/html/ext/behavior/HtmlDataTableClientBehaviorRendererTest.java?rev=980615&view=auto
==============================================================================
--- myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/component/html/ext/behavior/HtmlDataTableClientBehaviorRendererTest.java (added)
+++ myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/component/html/ext/behavior/HtmlDataTableClientBehaviorRendererTest.java Fri Jul 30 00:33:23 2010
@@ -0,0 +1,62 @@
+/*
+ * 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.component.html.ext.behavior;
+
+import javax.faces.component.UIComponent;
+
+import org.apache.myfaces.component.behavior.AbstractClientBehaviorTestCase;
+import org.apache.myfaces.component.behavior.HtmlClientEventAttributesUtil;
+import org.apache.myfaces.component.behavior.HtmlRenderedClientEventAttr;
+import org.apache.myfaces.component.html.ext.HtmlDataTable;
+
+/**
+ * @author Leonardo Uribe (latest modification by $Author: jankeesvanandel $)
+ * @version $Revision: 799929 $ $Date: 2009-08-01 16:29:33 -0500 (sáb, 01 ago 2009) $
+ */
+public class HtmlDataTableClientBehaviorRendererTest extends AbstractClientBehaviorTestCase
+{
+ private HtmlRenderedClientEventAttr[] attrs = null;
+
+ @Override
+ public void setUp() throws Exception
+ {
+ super.setUp();
+ attrs = HtmlClientEventAttributesUtil.generateClientBehaviorEventAttrs();
+ }
+
+ @Override
+ public void tearDown() throws Exception
+ {
+ super.tearDown();
+ attrs = null;
+ }
+
+
+ @Override
+ protected UIComponent createComponentToTest()
+ {
+ return new HtmlDataTable();
+ }
+
+ @Override
+ protected HtmlRenderedClientEventAttr[] getClientBehaviorHtmlRenderedAttributes()
+ {
+ return attrs;
+ }
+}
Added: myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/component/html/ext/behavior/HtmlGraphicImageClientBehaviorRendererTest.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/component/html/ext/behavior/HtmlGraphicImageClientBehaviorRendererTest.java?rev=980615&view=auto
==============================================================================
--- myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/component/html/ext/behavior/HtmlGraphicImageClientBehaviorRendererTest.java (added)
+++ myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/component/html/ext/behavior/HtmlGraphicImageClientBehaviorRendererTest.java Fri Jul 30 00:33:23 2010
@@ -0,0 +1,62 @@
+/*
+ * 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.component.html.ext.behavior;
+
+import javax.faces.component.UIComponent;
+
+import org.apache.myfaces.component.behavior.AbstractClientBehaviorTestCase;
+import org.apache.myfaces.component.behavior.HtmlClientEventAttributesUtil;
+import org.apache.myfaces.component.behavior.HtmlRenderedClientEventAttr;
+import org.apache.myfaces.component.html.ext.HtmlGraphicImage;
+
+/**
+ * @author Leonardo Uribe (latest modification by $Author: jankeesvanandel $)
+ * @version $Revision: 799929 $ $Date: 2009-08-01 16:29:33 -0500 (sáb, 01 ago 2009) $
+ */
+public class HtmlGraphicImageClientBehaviorRendererTest extends AbstractClientBehaviorTestCase
+{
+ private HtmlRenderedClientEventAttr[] attrs = null;
+
+ @Override
+ public void setUp() throws Exception
+ {
+ super.setUp();
+ attrs = HtmlClientEventAttributesUtil.generateClientBehaviorEventAttrs();
+ }
+
+ @Override
+ public void tearDown() throws Exception
+ {
+ super.tearDown();
+ attrs = null;
+ }
+
+
+ @Override
+ protected UIComponent createComponentToTest()
+ {
+ return new HtmlGraphicImage();
+ }
+
+ @Override
+ protected HtmlRenderedClientEventAttr[] getClientBehaviorHtmlRenderedAttributes()
+ {
+ return attrs;
+ }
+}
Added: myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/component/html/ext/behavior/HtmlMessageClientBehaviorTest.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/component/html/ext/behavior/HtmlMessageClientBehaviorTest.java?rev=980615&view=auto
==============================================================================
--- myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/component/html/ext/behavior/HtmlMessageClientBehaviorTest.java (added)
+++ myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/component/html/ext/behavior/HtmlMessageClientBehaviorTest.java Fri Jul 30 00:33:23 2010
@@ -0,0 +1,84 @@
+/*
+ * 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.component.html.ext.behavior;
+
+import javax.faces.application.FacesMessage;
+import javax.faces.component.UIComponent;
+
+import org.apache.myfaces.component.behavior.AbstractClientBehaviorTestCase;
+import org.apache.myfaces.component.behavior.HtmlClientEventAttributesUtil;
+import org.apache.myfaces.component.behavior.HtmlRenderedClientEventAttr;
+import org.apache.myfaces.component.html.ext.HtmlInputText;
+import org.apache.myfaces.component.html.ext.HtmlMessage;
+import org.apache.myfaces.component.html.ext.HtmlPanelGroup;
+import org.junit.Ignore;
+import org.junit.Test;
+
+
+public class HtmlMessageClientBehaviorTest extends AbstractClientBehaviorTestCase
+{
+ private HtmlRenderedClientEventAttr[] attrs = null;
+
+ @Override
+ public void setUp() throws Exception
+ {
+ super.setUp();
+ attrs = HtmlClientEventAttributesUtil.generateClientBehaviorEventAttrs();
+ }
+
+ @Override
+ public void tearDown() throws Exception
+ {
+ super.tearDown();
+ attrs = null;
+ }
+
+ @Override
+ protected UIComponent createComponentToTest()
+ {
+ HtmlMessage component = new HtmlMessage();
+ HtmlInputText input = new HtmlInputText();
+ String inputId = "input"+facesContext.getViewRoot().createUniqueId();
+ input.setId(inputId);
+ component.setFor(inputId);
+ HtmlPanelGroup group = new HtmlPanelGroup();
+ group.getChildren().add(input);
+ group.getChildren().add(component);
+ facesContext.getViewRoot().getChildren().add(group);
+ facesContext.addMessage(inputId, new FacesMessage("message1"));
+ return component;
+ }
+
+ @Override
+ protected HtmlRenderedClientEventAttr[] getClientBehaviorHtmlRenderedAttributes()
+ {
+ return attrs;
+ }
+
+ /**
+ * span tag does not have name attribute
+ */
+ @Test
+ @Ignore
+ @Override
+ public void testClientBehaviorHolderRendersName()
+ {
+ super.testClientBehaviorHolderRendersName();
+ }
+}
Added: myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/component/html/ext/behavior/HtmlMessagesClientBehaviorTest.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/component/html/ext/behavior/HtmlMessagesClientBehaviorTest.java?rev=980615&view=auto
==============================================================================
--- myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/component/html/ext/behavior/HtmlMessagesClientBehaviorTest.java (added)
+++ myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/component/html/ext/behavior/HtmlMessagesClientBehaviorTest.java Fri Jul 30 00:33:23 2010
@@ -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.component.html.ext.behavior;
+
+import javax.faces.application.FacesMessage;
+import javax.faces.component.UIComponent;
+
+import org.apache.myfaces.component.behavior.AbstractClientBehaviorTestCase;
+import org.apache.myfaces.component.behavior.HtmlClientEventAttributesUtil;
+import org.apache.myfaces.component.behavior.HtmlRenderedClientEventAttr;
+import org.apache.myfaces.component.html.ext.HtmlInputText;
+import org.apache.myfaces.component.html.ext.HtmlMessages;
+import org.apache.myfaces.component.html.ext.HtmlPanelGroup;
+import org.junit.Ignore;
+import org.junit.Test;
+
+
+public class HtmlMessagesClientBehaviorTest extends AbstractClientBehaviorTestCase
+{
+ private HtmlRenderedClientEventAttr[] attrs = null;
+
+ @Override
+ public void setUp() throws Exception
+ {
+ super.setUp();
+ attrs = HtmlClientEventAttributesUtil.generateClientBehaviorEventAttrs();
+ }
+
+ @Override
+ public void tearDown() throws Exception
+ {
+ super.tearDown();
+ attrs = null;
+ }
+
+ @Override
+ protected UIComponent createComponentToTest()
+ {
+ HtmlMessages component = new HtmlMessages();
+ HtmlInputText input = new HtmlInputText();
+ String inputId = "input"+facesContext.getViewRoot().createUniqueId();
+ input.setId(inputId);
+ HtmlPanelGroup group = new HtmlPanelGroup();
+ group.getChildren().add(input);
+ group.getChildren().add(component);
+ facesContext.getViewRoot().getChildren().add(group);
+ //facesContext.addMessage(inputId, new FacesMessage("message1"));
+ return component;
+ }
+
+ @Override
+ protected HtmlRenderedClientEventAttr[] getClientBehaviorHtmlRenderedAttributes()
+ {
+ return attrs;
+ }
+
+ /**
+ * span tag does not have name attribute
+ */
+ @Test
+ @Ignore
+ @Override
+ public void testClientBehaviorHolderRendersName()
+ {
+ super.testClientBehaviorHolderRendersName();
+ }
+
+ @Override
+ public void testClientBehaviorHolderRendersId()
+ {
+ facesContext.addMessage(null, new FacesMessage("message"));
+ super.testClientBehaviorHolderRendersId();
+ }
+
+ @Override
+ public void testClientBehaviorRendered()
+ {
+ facesContext.addMessage(null, new FacesMessage("message"));
+ super.testClientBehaviorRendered();
+ }
+
+ @Override
+ public void testClientBehaviorRenderedWithHtmlAttribute()
+ {
+ facesContext.addMessage(null, new FacesMessage("message"));
+ super.testClientBehaviorRenderedWithHtmlAttribute();
+ }
+
+
+}
Added: myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/component/html/ext/behavior/HtmlOutputLabelClientBehaviorRendererTest.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/component/html/ext/behavior/HtmlOutputLabelClientBehaviorRendererTest.java?rev=980615&view=auto
==============================================================================
--- myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/component/html/ext/behavior/HtmlOutputLabelClientBehaviorRendererTest.java (added)
+++ myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/component/html/ext/behavior/HtmlOutputLabelClientBehaviorRendererTest.java Fri Jul 30 00:33:23 2010
@@ -0,0 +1,70 @@
+/*
+ * 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.component.html.ext.behavior;
+
+import javax.faces.component.UIComponent;
+
+import org.apache.myfaces.component.behavior.AbstractClientBehaviorTestCase;
+import org.apache.myfaces.component.behavior.HtmlClientEventAttributesUtil;
+import org.apache.myfaces.component.behavior.HtmlRenderedClientEventAttr;
+import org.apache.myfaces.component.html.ext.HtmlOutputLabel;
+import org.apache.myfaces.shared_impl.renderkit.ClientBehaviorEvents;
+import org.apache.myfaces.shared_impl.renderkit.html.HTML;
+import org.apache.myfaces.shared_impl.util.ArrayUtils;
+
+/**
+ * @author Leonardo Uribe (latest modification by $Author: jankeesvanandel $)
+ * @version $Revision: 799929 $ $Date: 2009-08-01 16:29:33 -0500 (sáb, 01 ago 2009) $
+ */
+public class HtmlOutputLabelClientBehaviorRendererTest extends AbstractClientBehaviorTestCase
+{
+ private HtmlRenderedClientEventAttr[] attrs = null;
+
+ @Override
+ public void setUp() throws Exception
+ {
+ super.setUp();
+ attrs = (HtmlRenderedClientEventAttr[])
+ ArrayUtils.concat(HtmlClientEventAttributesUtil.generateClientBehaviorEventAttrs(),
+ new HtmlRenderedClientEventAttr[]{
+ new HtmlRenderedClientEventAttr(HTML.ONFOCUS_ATTR, ClientBehaviorEvents.FOCUS),
+ new HtmlRenderedClientEventAttr(HTML.ONBLUR_ATTR, ClientBehaviorEvents.BLUR)
+ });
+ }
+
+ @Override
+ public void tearDown() throws Exception
+ {
+ super.tearDown();
+ attrs = null;
+ }
+
+
+ @Override
+ protected UIComponent createComponentToTest()
+ {
+ return new HtmlOutputLabel();
+ }
+
+ @Override
+ protected HtmlRenderedClientEventAttr[] getClientBehaviorHtmlRenderedAttributes()
+ {
+ return attrs;
+ }
+}
Added: myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/component/html/ext/behavior/HtmlOutputTextClientBehaviorTest.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/component/html/ext/behavior/HtmlOutputTextClientBehaviorTest.java?rev=980615&view=auto
==============================================================================
--- myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/component/html/ext/behavior/HtmlOutputTextClientBehaviorTest.java (added)
+++ myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/component/html/ext/behavior/HtmlOutputTextClientBehaviorTest.java Fri Jul 30 00:33:23 2010
@@ -0,0 +1,71 @@
+/*
+ * 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.component.html.ext.behavior;
+
+import javax.faces.component.UIComponent;
+
+import org.apache.myfaces.component.behavior.AbstractClientBehaviorTestCase;
+import org.apache.myfaces.component.behavior.HtmlClientEventAttributesUtil;
+import org.apache.myfaces.component.behavior.HtmlRenderedClientEventAttr;
+import org.apache.myfaces.component.html.ext.HtmlOutputText;
+import org.junit.Ignore;
+import org.junit.Test;
+
+
+public class HtmlOutputTextClientBehaviorTest extends AbstractClientBehaviorTestCase
+{
+ private HtmlRenderedClientEventAttr[] attrs = null;
+
+ @Override
+ public void setUp() throws Exception
+ {
+ super.setUp();
+ attrs = HtmlClientEventAttributesUtil.generateClientBehaviorEventAttrs();
+ }
+
+ @Override
+ public void tearDown() throws Exception
+ {
+ super.tearDown();
+ attrs = null;
+ }
+
+ @Override
+ protected UIComponent createComponentToTest()
+ {
+ return new HtmlOutputText();
+ }
+
+ @Override
+ protected HtmlRenderedClientEventAttr[] getClientBehaviorHtmlRenderedAttributes()
+ {
+ return attrs;
+ }
+
+ /**
+ * span tag does not have name attribute
+ */
+ @Test
+ @Ignore
+ @Override
+ public void testClientBehaviorHolderRendersName()
+ {
+ super.testClientBehaviorHolderRendersName();
+ }
+}
Added: myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/component/html/ext/behavior/HtmlPanelGridClientBehaviorRendererTest.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/component/html/ext/behavior/HtmlPanelGridClientBehaviorRendererTest.java?rev=980615&view=auto
==============================================================================
--- myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/component/html/ext/behavior/HtmlPanelGridClientBehaviorRendererTest.java (added)
+++ myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/component/html/ext/behavior/HtmlPanelGridClientBehaviorRendererTest.java Fri Jul 30 00:33:23 2010
@@ -0,0 +1,62 @@
+/*
+ * 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.component.html.ext.behavior;
+
+import javax.faces.component.UIComponent;
+
+import org.apache.myfaces.component.behavior.AbstractClientBehaviorTestCase;
+import org.apache.myfaces.component.behavior.HtmlClientEventAttributesUtil;
+import org.apache.myfaces.component.behavior.HtmlRenderedClientEventAttr;
+import org.apache.myfaces.component.html.ext.HtmlPanelGrid;
+
+/**
+ * @author Leonardo Uribe (latest modification by $Author: jankeesvanandel $)
+ * @version $Revision: 799929 $ $Date: 2009-08-01 16:29:33 -0500 (sáb, 01 ago 2009) $
+ */
+public class HtmlPanelGridClientBehaviorRendererTest extends AbstractClientBehaviorTestCase
+{
+ private HtmlRenderedClientEventAttr[] attrs = null;
+
+ @Override
+ public void setUp() throws Exception
+ {
+ super.setUp();
+ attrs = HtmlClientEventAttributesUtil.generateClientBehaviorEventAttrs();
+ }
+
+ @Override
+ public void tearDown() throws Exception
+ {
+ super.tearDown();
+ attrs = null;
+ }
+
+
+ @Override
+ protected UIComponent createComponentToTest()
+ {
+ return new HtmlPanelGrid();
+ }
+
+ @Override
+ protected HtmlRenderedClientEventAttr[] getClientBehaviorHtmlRenderedAttributes()
+ {
+ return attrs;
+ }
+}
Added: myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/component/html/ext/behavior/HtmlPanelGroupDivClientBehaviorTest.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/component/html/ext/behavior/HtmlPanelGroupDivClientBehaviorTest.java?rev=980615&view=auto
==============================================================================
--- myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/component/html/ext/behavior/HtmlPanelGroupDivClientBehaviorTest.java (added)
+++ myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/component/html/ext/behavior/HtmlPanelGroupDivClientBehaviorTest.java Fri Jul 30 00:33:23 2010
@@ -0,0 +1,71 @@
+/*
+ * 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.component.html.ext.behavior;
+
+import javax.faces.component.UIComponent;
+
+import org.apache.myfaces.component.behavior.AbstractClientBehaviorTestCase;
+import org.apache.myfaces.component.behavior.HtmlClientEventAttributesUtil;
+import org.apache.myfaces.component.behavior.HtmlRenderedClientEventAttr;
+import org.apache.myfaces.component.html.ext.HtmlPanelGroup;
+import org.junit.Ignore;
+import org.junit.Test;
+
+
+public class HtmlPanelGroupDivClientBehaviorTest extends AbstractClientBehaviorTestCase
+{
+ private HtmlRenderedClientEventAttr[] attrs = null;
+
+ @Override
+ public void setUp() throws Exception
+ {
+ super.setUp();
+ attrs = HtmlClientEventAttributesUtil.generateClientBehaviorEventAttrs();
+ }
+
+ @Override
+ public void tearDown() throws Exception
+ {
+ super.tearDown();
+ attrs = null;
+ }
+
+ @Override
+ protected UIComponent createComponentToTest()
+ {
+ return new HtmlPanelGroup();
+ }
+
+ @Override
+ protected HtmlRenderedClientEventAttr[] getClientBehaviorHtmlRenderedAttributes()
+ {
+ return attrs;
+ }
+
+ /**
+ * div tag does not have name attribute
+ */
+ @Test
+ @Ignore
+ @Override
+ public void testClientBehaviorHolderRendersName()
+ {
+ super.testClientBehaviorHolderRendersName();
+ }
+}
Added: myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/component/html/ext/behavior/HtmlPanelGroupSpanClientBehaviorTest.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/component/html/ext/behavior/HtmlPanelGroupSpanClientBehaviorTest.java?rev=980615&view=auto
==============================================================================
--- myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/component/html/ext/behavior/HtmlPanelGroupSpanClientBehaviorTest.java (added)
+++ myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/component/html/ext/behavior/HtmlPanelGroupSpanClientBehaviorTest.java Fri Jul 30 00:33:23 2010
@@ -0,0 +1,73 @@
+/*
+ * 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.component.html.ext.behavior;
+
+import javax.faces.component.UIComponent;
+
+import org.apache.myfaces.component.behavior.AbstractClientBehaviorTestCase;
+import org.apache.myfaces.component.behavior.HtmlClientEventAttributesUtil;
+import org.apache.myfaces.component.behavior.HtmlRenderedClientEventAttr;
+import org.apache.myfaces.component.html.ext.HtmlPanelGroup;
+import org.junit.Ignore;
+import org.junit.Test;
+
+
+public class HtmlPanelGroupSpanClientBehaviorTest extends AbstractClientBehaviorTestCase
+{
+ private HtmlRenderedClientEventAttr[] attrs = null;
+
+ @Override
+ public void setUp() throws Exception
+ {
+ super.setUp();
+ attrs = HtmlClientEventAttributesUtil.generateClientBehaviorEventAttrs();
+ }
+
+ @Override
+ public void tearDown() throws Exception
+ {
+ super.tearDown();
+ attrs = null;
+ }
+
+ @Override
+ protected UIComponent createComponentToTest()
+ {
+ HtmlPanelGroup component = new HtmlPanelGroup();
+ component.setLayout("span");
+ return component;
+ }
+
+ @Override
+ protected HtmlRenderedClientEventAttr[] getClientBehaviorHtmlRenderedAttributes()
+ {
+ return attrs;
+ }
+
+ /**
+ * div tag does not have name attribute
+ */
+ @Test
+ @Ignore
+ @Override
+ public void testClientBehaviorHolderRendersName()
+ {
+ super.testClientBehaviorHolderRendersName();
+ }
+}
Added: myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/component/html/ext/behavior/HtmlSecretClientBehaviorRendererTest.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/component/html/ext/behavior/HtmlSecretClientBehaviorRendererTest.java?rev=980615&view=auto
==============================================================================
--- myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/component/html/ext/behavior/HtmlSecretClientBehaviorRendererTest.java (added)
+++ myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/component/html/ext/behavior/HtmlSecretClientBehaviorRendererTest.java Fri Jul 30 00:33:23 2010
@@ -0,0 +1,62 @@
+/*
+ * 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.component.html.ext.behavior;
+
+import javax.faces.component.UIComponent;
+
+import org.apache.myfaces.component.behavior.AbstractClientBehaviorTestCase;
+import org.apache.myfaces.component.behavior.HtmlClientEventAttributesUtil;
+import org.apache.myfaces.component.behavior.HtmlRenderedClientEventAttr;
+import org.apache.myfaces.component.html.ext.HtmlInputSecret;
+
+/**
+ * @author Leonardo Uribe (latest modification by $Author: jankeesvanandel $)
+ * @version $Revision: 799929 $ $Date: 2009-08-01 16:29:33 -0500 (sáb, 01 ago 2009) $
+ */
+public class HtmlSecretClientBehaviorRendererTest extends AbstractClientBehaviorTestCase
+{
+ private HtmlRenderedClientEventAttr[] attrs = null;
+
+ @Override
+ public void setUp() throws Exception
+ {
+ super.setUp();
+ attrs = HtmlClientEventAttributesUtil.generateClientBehaviorInputEventAttrs();
+ }
+
+ @Override
+ public void tearDown() throws Exception
+ {
+ super.tearDown();
+ attrs = null;
+ }
+
+
+ @Override
+ protected UIComponent createComponentToTest()
+ {
+ return new HtmlInputSecret();
+ }
+
+ @Override
+ protected HtmlRenderedClientEventAttr[] getClientBehaviorHtmlRenderedAttributes()
+ {
+ return attrs;
+ }
+}
Added: myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/component/html/ext/behavior/HtmlSelectBooleanCheckboxClientBehaviorRendererTest.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/component/html/ext/behavior/HtmlSelectBooleanCheckboxClientBehaviorRendererTest.java?rev=980615&view=auto
==============================================================================
--- myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/component/html/ext/behavior/HtmlSelectBooleanCheckboxClientBehaviorRendererTest.java (added)
+++ myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/component/html/ext/behavior/HtmlSelectBooleanCheckboxClientBehaviorRendererTest.java Fri Jul 30 00:33:23 2010
@@ -0,0 +1,62 @@
+/*
+ * 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.component.html.ext.behavior;
+
+import javax.faces.component.UIComponent;
+
+import org.apache.myfaces.component.behavior.AbstractClientBehaviorTestCase;
+import org.apache.myfaces.component.behavior.HtmlClientEventAttributesUtil;
+import org.apache.myfaces.component.behavior.HtmlRenderedClientEventAttr;
+import org.apache.myfaces.component.html.ext.HtmlSelectBooleanCheckbox;
+
+/**
+ * @author Leonardo Uribe (latest modification by $Author: jankeesvanandel $)
+ * @version $Revision: 799929 $ $Date: 2009-08-01 16:29:33 -0500 (sáb, 01 ago 2009) $
+ */
+public class HtmlSelectBooleanCheckboxClientBehaviorRendererTest extends AbstractClientBehaviorTestCase
+{
+ private HtmlRenderedClientEventAttr[] attrs = null;
+
+ @Override
+ public void setUp() throws Exception
+ {
+ super.setUp();
+ attrs = HtmlClientEventAttributesUtil.generateClientBehaviorInputEventAttrs();
+ }
+
+ @Override
+ public void tearDown() throws Exception
+ {
+ super.tearDown();
+ attrs = null;
+ }
+
+
+ @Override
+ protected UIComponent createComponentToTest()
+ {
+ return new HtmlSelectBooleanCheckbox();
+ }
+
+ @Override
+ protected HtmlRenderedClientEventAttr[] getClientBehaviorHtmlRenderedAttributes()
+ {
+ return attrs;
+ }
+}
Added: myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/component/html/ext/behavior/HtmlSelectManyCheckboxClientBehaviorRendererTest.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/component/html/ext/behavior/HtmlSelectManyCheckboxClientBehaviorRendererTest.java?rev=980615&view=auto
==============================================================================
--- myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/component/html/ext/behavior/HtmlSelectManyCheckboxClientBehaviorRendererTest.java (added)
+++ myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/component/html/ext/behavior/HtmlSelectManyCheckboxClientBehaviorRendererTest.java Fri Jul 30 00:33:23 2010
@@ -0,0 +1,118 @@
+/*
+ * 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.component.html.ext.behavior;
+
+import javax.faces.component.UIComponent;
+import javax.faces.component.UISelectItem;
+import javax.faces.component.behavior.AjaxBehavior;
+import javax.faces.component.behavior.ClientBehaviorHolder;
+
+import org.apache.myfaces.component.behavior.AbstractClientBehaviorTestCase;
+import org.apache.myfaces.component.behavior.HtmlClientEventAttributesUtil;
+import org.apache.myfaces.component.behavior.HtmlRenderedClientEventAttr;
+import org.apache.myfaces.component.html.ext.HtmlSelectManyCheckbox;
+import org.junit.Assert;
+
+/**
+ * @author Leonardo Uribe (latest modification by $Author: jankeesvanandel $)
+ * @version $Revision: 799929 $ $Date: 2009-08-01 16:29:33 -0500 (sáb, 01 ago 2009) $
+ */
+public class HtmlSelectManyCheckboxClientBehaviorRendererTest extends AbstractClientBehaviorTestCase
+{
+ private HtmlRenderedClientEventAttr[] attrs = null;
+
+ @Override
+ public void setUp() throws Exception
+ {
+ super.setUp();
+ attrs = HtmlClientEventAttributesUtil.generateClientBehaviorInputEventAttrs();
+ }
+
+ @Override
+ public void tearDown() throws Exception
+ {
+ super.tearDown();
+ attrs = null;
+ }
+
+
+ @Override
+ protected UIComponent createComponentToTest()
+ {
+ UIComponent component = new HtmlSelectManyCheckbox();
+ UISelectItem item = new UISelectItem();
+ item.setItemValue("value1");
+ component.getChildren().add(item);
+ return component;
+ }
+
+ @Override
+ protected HtmlRenderedClientEventAttr[] getClientBehaviorHtmlRenderedAttributes()
+ {
+ return attrs;
+ }
+
+ @Override
+ public void testClientBehaviorHolderRendersId()
+ {
+ HtmlRenderedClientEventAttr[] attrs = getClientBehaviorHtmlRenderedAttributes();
+
+ for (int i = 0; i < attrs.length; i++)
+ {
+ UIComponent component = createComponentToTest();
+ ClientBehaviorHolder clientBehaviorHolder = (ClientBehaviorHolder) component;
+ clientBehaviorHolder.addClientBehavior(attrs[i].getClientEvent(), new AjaxBehavior());
+ try
+ {
+ component.encodeAll(facesContext);
+ String output = outputWriter.toString();
+ Assert.assertTrue(output.matches(".+ id=\".+\".+"));
+ outputWriter.reset();
+ }
+ catch (Exception e)
+ {
+ Assert.fail(e.getMessage());
+ }
+ }
+ }
+
+ @Override
+ public void testClientBehaviorHolderRendersName()
+ {
+ HtmlRenderedClientEventAttr[] attrs = getClientBehaviorHtmlRenderedAttributes();
+
+ for (int i = 0; i < attrs.length; i++)
+ {
+ UIComponent component = createComponentToTest();
+ ClientBehaviorHolder clientBehaviorHolder = (ClientBehaviorHolder) component;
+ clientBehaviorHolder.addClientBehavior(attrs[i].getClientEvent(), new AjaxBehavior());
+ try
+ {
+ component.encodeAll(facesContext);
+ String output = outputWriter.toString();
+ Assert.assertTrue(output.matches(".+ name=\".+\".+"));
+ outputWriter.reset();
+ }
+ catch (Exception e)
+ {
+ Assert.fail(e.getMessage());
+ }
+ }
+ }
+}
Added: myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/component/html/ext/behavior/HtmlSelectManyListboxClientBehaviorRendererTest.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/component/html/ext/behavior/HtmlSelectManyListboxClientBehaviorRendererTest.java?rev=980615&view=auto
==============================================================================
--- myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/component/html/ext/behavior/HtmlSelectManyListboxClientBehaviorRendererTest.java (added)
+++ myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/component/html/ext/behavior/HtmlSelectManyListboxClientBehaviorRendererTest.java Fri Jul 30 00:33:23 2010
@@ -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.component.html.ext.behavior;
+
+import javax.faces.component.UIComponent;
+import javax.faces.component.UISelectItem;
+
+import org.apache.myfaces.component.behavior.AbstractClientBehaviorTestCase;
+import org.apache.myfaces.component.behavior.HtmlClientEventAttributesUtil;
+import org.apache.myfaces.component.behavior.HtmlRenderedClientEventAttr;
+import org.apache.myfaces.component.html.ext.HtmlSelectManyListbox;
+
+/**
+ * @author Leonardo Uribe (latest modification by $Author: jankeesvanandel $)
+ * @version $Revision: 799929 $ $Date: 2009-08-01 16:29:33 -0500 (sáb, 01 ago 2009) $
+ */
+public class HtmlSelectManyListboxClientBehaviorRendererTest extends AbstractClientBehaviorTestCase
+{
+ private HtmlRenderedClientEventAttr[] attrs = null;
+
+ @Override
+ public void setUp() throws Exception
+ {
+ super.setUp();
+ attrs = HtmlClientEventAttributesUtil.generateClientBehaviorInputEventAttrs();
+ }
+
+ @Override
+ public void tearDown() throws Exception
+ {
+ super.tearDown();
+ attrs = null;
+ }
+
+
+ @Override
+ protected UIComponent createComponentToTest()
+ {
+ UIComponent component = new HtmlSelectManyListbox();
+ UISelectItem item = new UISelectItem();
+ item.setItemValue("value1");
+ component.getChildren().add(item);
+ return component;
+ }
+
+ @Override
+ protected HtmlRenderedClientEventAttr[] getClientBehaviorHtmlRenderedAttributes()
+ {
+ return attrs;
+ }
+}
Added: myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/component/html/ext/behavior/HtmlSelectManyMenuClientBehaviorRendererTest.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/component/html/ext/behavior/HtmlSelectManyMenuClientBehaviorRendererTest.java?rev=980615&view=auto
==============================================================================
--- myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/component/html/ext/behavior/HtmlSelectManyMenuClientBehaviorRendererTest.java (added)
+++ myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/component/html/ext/behavior/HtmlSelectManyMenuClientBehaviorRendererTest.java Fri Jul 30 00:33:23 2010
@@ -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.component.html.ext.behavior;
+
+import javax.faces.component.UIComponent;
+import javax.faces.component.UISelectItem;
+
+import org.apache.myfaces.component.behavior.AbstractClientBehaviorTestCase;
+import org.apache.myfaces.component.behavior.HtmlClientEventAttributesUtil;
+import org.apache.myfaces.component.behavior.HtmlRenderedClientEventAttr;
+import org.apache.myfaces.component.html.ext.HtmlSelectManyMenu;
+
+/**
+ * @author Leonardo Uribe (latest modification by $Author: jankeesvanandel $)
+ * @version $Revision: 799929 $ $Date: 2009-08-01 16:29:33 -0500 (sáb, 01 ago 2009) $
+ */
+public class HtmlSelectManyMenuClientBehaviorRendererTest extends AbstractClientBehaviorTestCase
+{
+ private HtmlRenderedClientEventAttr[] attrs = null;
+
+ @Override
+ public void setUp() throws Exception
+ {
+ super.setUp();
+ attrs = HtmlClientEventAttributesUtil.generateClientBehaviorInputEventAttrs();
+ }
+
+ @Override
+ public void tearDown() throws Exception
+ {
+ super.tearDown();
+ attrs = null;
+ }
+
+
+ @Override
+ protected UIComponent createComponentToTest()
+ {
+ UIComponent component = new HtmlSelectManyMenu();
+ UISelectItem item = new UISelectItem();
+ item.setItemValue("value1");
+ component.getChildren().add(item);
+ return component;
+ }
+
+ @Override
+ protected HtmlRenderedClientEventAttr[] getClientBehaviorHtmlRenderedAttributes()
+ {
+ return attrs;
+ }
+}
Added: myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/component/html/ext/behavior/HtmlSelectOneListboxClientBehaviorRendererTest.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/component/html/ext/behavior/HtmlSelectOneListboxClientBehaviorRendererTest.java?rev=980615&view=auto
==============================================================================
--- myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/component/html/ext/behavior/HtmlSelectOneListboxClientBehaviorRendererTest.java (added)
+++ myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/component/html/ext/behavior/HtmlSelectOneListboxClientBehaviorRendererTest.java Fri Jul 30 00:33:23 2010
@@ -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.component.html.ext.behavior;
+
+import javax.faces.component.UIComponent;
+import javax.faces.component.UISelectItem;
+
+import org.apache.myfaces.component.behavior.AbstractClientBehaviorTestCase;
+import org.apache.myfaces.component.behavior.HtmlClientEventAttributesUtil;
+import org.apache.myfaces.component.behavior.HtmlRenderedClientEventAttr;
+import org.apache.myfaces.component.html.ext.HtmlSelectOneListbox;
+
+/**
+ * @author Leonardo Uribe (latest modification by $Author: jankeesvanandel $)
+ * @version $Revision: 799929 $ $Date: 2009-08-01 16:29:33 -0500 (sáb, 01 ago 2009) $
+ */
+public class HtmlSelectOneListboxClientBehaviorRendererTest extends AbstractClientBehaviorTestCase
+{
+ private HtmlRenderedClientEventAttr[] attrs = null;
+
+ @Override
+ public void setUp() throws Exception
+ {
+ super.setUp();
+ attrs = HtmlClientEventAttributesUtil.generateClientBehaviorInputEventAttrs();
+ }
+
+ @Override
+ public void tearDown() throws Exception
+ {
+ super.tearDown();
+ attrs = null;
+ }
+
+
+ @Override
+ protected UIComponent createComponentToTest()
+ {
+ UIComponent component = new HtmlSelectOneListbox();
+ UISelectItem item = new UISelectItem();
+ item.setItemValue("value1");
+ component.getChildren().add(item);
+ return component;
+ }
+
+ @Override
+ protected HtmlRenderedClientEventAttr[] getClientBehaviorHtmlRenderedAttributes()
+ {
+ return attrs;
+ }
+}
Added: myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/component/html/ext/behavior/HtmlSelectOneMenuClientBehaviorRendererTest.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/component/html/ext/behavior/HtmlSelectOneMenuClientBehaviorRendererTest.java?rev=980615&view=auto
==============================================================================
--- myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/component/html/ext/behavior/HtmlSelectOneMenuClientBehaviorRendererTest.java (added)
+++ myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/component/html/ext/behavior/HtmlSelectOneMenuClientBehaviorRendererTest.java Fri Jul 30 00:33:23 2010
@@ -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.component.html.ext.behavior;
+
+import javax.faces.component.UIComponent;
+import javax.faces.component.UISelectItem;
+
+import org.apache.myfaces.component.behavior.AbstractClientBehaviorTestCase;
+import org.apache.myfaces.component.behavior.HtmlClientEventAttributesUtil;
+import org.apache.myfaces.component.behavior.HtmlRenderedClientEventAttr;
+import org.apache.myfaces.component.html.ext.HtmlSelectOneMenu;
+
+/**
+ * @author Leonardo Uribe (latest modification by $Author: jankeesvanandel $)
+ * @version $Revision: 799929 $ $Date: 2009-08-01 16:29:33 -0500 (sáb, 01 ago 2009) $
+ */
+public class HtmlSelectOneMenuClientBehaviorRendererTest extends AbstractClientBehaviorTestCase
+{
+ private HtmlRenderedClientEventAttr[] attrs = null;
+
+ @Override
+ public void setUp() throws Exception
+ {
+ super.setUp();
+ attrs = HtmlClientEventAttributesUtil.generateClientBehaviorInputEventAttrs();
+ }
+
+ @Override
+ public void tearDown() throws Exception
+ {
+ super.tearDown();
+ attrs = null;
+ }
+
+
+ @Override
+ protected UIComponent createComponentToTest()
+ {
+ UIComponent component = new HtmlSelectOneMenu();
+ UISelectItem item = new UISelectItem();
+ item.setItemValue("value1");
+ component.getChildren().add(item);
+ return component;
+ }
+
+ @Override
+ protected HtmlRenderedClientEventAttr[] getClientBehaviorHtmlRenderedAttributes()
+ {
+ return attrs;
+ }
+}