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/14 00:57:42 UTC

svn commit: r963899 [3/7] - in /myfaces/tomahawk/trunk/core20: ./ src/test/java/org/apache/myfaces/component/ src/test/java/org/apache/myfaces/component/html/ src/test/java/org/apache/myfaces/component/html/ext/ src/test/java/org/apache/myfaces/convert...

Added: myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/custom/newspaper/HtmlNewspaperTableRendererTest.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/custom/newspaper/HtmlNewspaperTableRendererTest.java?rev=963899&view=auto
==============================================================================
--- myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/custom/newspaper/HtmlNewspaperTableRendererTest.java (added)
+++ myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/custom/newspaper/HtmlNewspaperTableRendererTest.java Tue Jul 13 22:57:38 2010
@@ -0,0 +1,77 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.myfaces.custom.newspaper;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+import org.apache.myfaces.test.AbstractTomahawkViewControllerTestCase;
+import org.apache.myfaces.test.mock.MockResponseWriter;
+import org.apache.myfaces.test.utils.HtmlCheckAttributesUtil;
+import org.apache.myfaces.test.utils.HtmlRenderedAttr;
+
+public class HtmlNewspaperTableRendererTest extends AbstractTomahawkViewControllerTestCase
+{    
+    private HtmlNewspaperTable newspaper;
+
+    public HtmlNewspaperTableRendererTest(String name)
+    {
+        super(name);
+    }
+
+    public static Test suite() {
+        return new TestSuite(HtmlNewspaperTableRendererTest.class);
+    }
+    
+    public void setUp() throws Exception
+    {
+        super.setUp();
+        newspaper = new HtmlNewspaperTable();        
+    }
+    
+    public void tearDown() throws Exception 
+    {
+        super.tearDown();
+        newspaper = null;
+    }
+    
+    public void testHtmlPropertyPassTru() throws Exception
+    {
+        HtmlRenderedAttr[] attrs = HtmlCheckAttributesUtil.generateBasicReadOnlyAttrs();
+        
+        MockResponseWriter writer = (MockResponseWriter)facesContext.getResponseWriter();
+        HtmlCheckAttributesUtil.checkRenderedAttributes(
+                newspaper, facesContext, writer, attrs);
+        if(HtmlCheckAttributesUtil.hasFailedAttrRender(attrs)) {
+            fail(HtmlCheckAttributesUtil.constructErrorMessage(attrs, writer.getWriter().toString()));
+        }
+    }
+    
+    public void testHtmlPropertyPassTruNotRendered() throws Exception
+    {
+        HtmlRenderedAttr[] attrs = HtmlCheckAttributesUtil.generateAttrsNotRenderedForReadOnly();
+        
+        MockResponseWriter writer = (MockResponseWriter)facesContext.getResponseWriter();
+        HtmlCheckAttributesUtil.checkRenderedAttributes(
+                newspaper, facesContext, writer, attrs);
+        if(HtmlCheckAttributesUtil.hasFailedAttrRender(attrs)) {
+            fail(HtmlCheckAttributesUtil.constructErrorMessage(attrs, writer.getWriter().toString()));
+        }
+    }
+}

Added: myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/custom/picklist/HtmlPicklistRendererTest.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/custom/picklist/HtmlPicklistRendererTest.java?rev=963899&view=auto
==============================================================================
--- myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/custom/picklist/HtmlPicklistRendererTest.java (added)
+++ myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/custom/picklist/HtmlPicklistRendererTest.java Tue Jul 13 22:57:38 2010
@@ -0,0 +1,109 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.myfaces.custom.picklist;
+
+import javax.faces.component.UISelectItem;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+import org.apache.myfaces.test.AbstractTomahawkViewControllerTestCase;
+import org.apache.myfaces.test.mock.MockResponseWriter;
+import org.apache.myfaces.test.utils.HtmlCheckAttributesUtil;
+import org.apache.myfaces.test.utils.HtmlRenderedAttr;
+
+public class HtmlPicklistRendererTest extends AbstractTomahawkViewControllerTestCase
+{
+    private HtmlSelectManyPicklist picklist;
+    
+    public HtmlPicklistRendererTest(String name)
+    {
+        super(name);
+    }
+
+    public static Test suite() {
+        return new TestSuite(HtmlPicklistRendererTest.class);
+    }
+    
+    public void setUp() throws Exception
+    {
+        super.setUp();
+        picklist = new HtmlSelectManyPicklist();        
+    }
+    
+    public void tearDown() throws Exception 
+    {
+        super.tearDown();
+        picklist = null;
+    }
+    
+    public void testHtmlPropertyPassTru() throws Exception
+    {
+        HtmlRenderedAttr[] attrs = {
+            //_AccesskeyProperty
+            new HtmlRenderedAttr("accesskey", 2),
+            //_UniversalProperties
+            new HtmlRenderedAttr("dir", 2), 
+            new HtmlRenderedAttr("lang", 2), 
+            new HtmlRenderedAttr("title", 2),
+            //_FocusBlurProperties
+            new HtmlRenderedAttr("onfocus", 2), 
+            new HtmlRenderedAttr("onblur", 2),
+            //_ChangeSelectProperties
+            new HtmlRenderedAttr("onchange", 2), 
+            new HtmlRenderedAttr("onselect", 2),
+            //_EventProperties
+            new HtmlRenderedAttr("onclick", 2), 
+            new HtmlRenderedAttr("ondblclick", 2), 
+            new HtmlRenderedAttr("onkeydown", 2), 
+            new HtmlRenderedAttr("onkeypress", 2),
+            new HtmlRenderedAttr("onkeyup", 2), 
+            new HtmlRenderedAttr("onmousedown", 2), 
+            new HtmlRenderedAttr("onmousemove", 2), 
+            new HtmlRenderedAttr("onmouseout", 2),
+            new HtmlRenderedAttr("onmouseover", 2), 
+            new HtmlRenderedAttr("onmouseup", 2),
+            //_StyleProperties
+            new HtmlRenderedAttr("style", 2), 
+            new HtmlRenderedAttr("styleClass", "styleClass", "class=\"styleClass\"", 2),
+            //_TabindexProperty
+            new HtmlRenderedAttr("tabindex", 2)
+        };
+        
+        UISelectItem item = new UISelectItem();
+        item.setItemLabel("mars");
+        item.setItemValue("mars");
+        picklist.getChildren().add(item);
+        picklist.setAddButtonStyle("btnStyle");
+        picklist.setAddButtonStyleClass("btnStyleClass");
+        picklist.setAddAllButtonStyle("btnStyle");
+        picklist.setAddAllButtonStyleClass("btnStyleClass");
+        picklist.setRemoveButtonStyle("btnStyle");
+        picklist.setRemoveButtonStyleClass("btnStyleClass");
+        picklist.setRemoveAllButtonStyle("btnStyle");
+        picklist.setRemoveAllButtonStyleClass("btnStyleClass");
+        
+        MockResponseWriter writer = (MockResponseWriter)facesContext.getResponseWriter();
+        HtmlCheckAttributesUtil.checkRenderedAttributes(
+                picklist, facesContext, writer, attrs);
+        if(HtmlCheckAttributesUtil.hasFailedAttrRender(attrs)) {
+            fail(HtmlCheckAttributesUtil.constructErrorMessage(attrs, writer.getWriter().toString()));
+        }
+    }
+}

Modified: myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/custom/picklist/HtmlPicklistRendererValueTest.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/custom/picklist/HtmlPicklistRendererValueTest.java?rev=963899&r1=963898&r2=963899&view=diff
==============================================================================
--- myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/custom/picklist/HtmlPicklistRendererValueTest.java (original)
+++ myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/custom/picklist/HtmlPicklistRendererValueTest.java Tue Jul 13 22:57:38 2010
@@ -26,11 +26,11 @@ import javax.el.ELContext;
 import javax.el.ValueExpression;
 import javax.faces.component.UISelectItem;
 
-import org.apache.myfaces.renderkit.html.ext.TestBean;
-import org.apache.myfaces.renderkit.html.ext.TestIntegerConverter;
-import org.apache.shale.test.base.AbstractJsfTestCase;
-import org.apache.shale.test.el.MockValueExpression;
-import org.apache.shale.test.mock.MockResponseWriter;
+import org.apache.myfaces.renderkit.html.ext.MockBean;
+import org.apache.myfaces.renderkit.html.ext.MockIntegerConverter;
+import org.apache.myfaces.test.base.AbstractJsfTestCase;
+import org.apache.myfaces.test.el.MockValueExpression;
+import org.apache.myfaces.test.mock.MockResponseWriter;
 
 /**
  * Test cases for HtmlPicklistRenderer.
@@ -75,7 +75,7 @@ public class HtmlPicklistRendererValueTe
     @SuppressWarnings("unchecked")
     public void testValueTypeRender() throws IOException
     {
-        TestBean bean = new TestBean();
+        MockBean bean = new MockBean();
         externalContext.getApplicationMap().put("bean", bean);
         ValueExpression beanVE = new MockValueExpression("#{bean.values}", Object.class);
         
@@ -100,7 +100,7 @@ public class HtmlPicklistRendererValueTe
         selectMany.getChildren().add(item);
         
         // register the converter
-        application.addConverter(Integer.class, TestIntegerConverter.class.getName());
+        application.addConverter(Integer.class, MockIntegerConverter.class.getName());
         
         // Render the component (only encodeEnd is used in this renderer)
         _renderer.encodeEnd(facesContext, selectMany);
@@ -114,7 +114,7 @@ public class HtmlPicklistRendererValueTe
     @SuppressWarnings({ "unchecked", "serial" })
     public void testValueTypeSubmit() throws IOException
     {
-        TestBean bean = new TestBean();
+        MockBean bean = new MockBean();
         externalContext.getApplicationMap().put("bean", bean);
         ValueExpression beanVE = new MockValueExpression("#{bean.values}", Object.class)
         {

Added: myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/custom/savestate/SaveStateTestBean.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/custom/savestate/SaveStateTestBean.java?rev=963899&view=auto
==============================================================================
--- myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/custom/savestate/SaveStateTestBean.java (added)
+++ myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/custom/savestate/SaveStateTestBean.java Tue Jul 13 22:57:38 2010
@@ -0,0 +1,74 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.myfaces.custom.savestate;
+
+import java.io.Serializable;
+import java.util.LinkedList;
+
+import javax.faces.component.StateHolder;
+import javax.faces.context.FacesContext;
+
+/**
+ * @author cagatay
+ * Test bean for UISaveStateTest
+ */
+public class SaveStateTestBean implements Serializable, StateHolder {
+
+    private LinkedList linkedList;
+
+    private String name;
+
+    public LinkedList getLinkedList() {
+        if(linkedList == null)
+            linkedList = new LinkedList();
+        return linkedList;
+    }
+
+    public void setLinkedList(LinkedList linkedList) {
+        this.linkedList = linkedList;
+    }
+
+    public boolean isTransient() {
+        return false;
+    }
+
+    public void restoreState(FacesContext context, Object state) {
+        Object values[] = (Object[])state;
+        name = (String)values[0];
+    }
+
+    public Object saveState(FacesContext context) {
+        Object values[] = new Object[1];
+        values[0] = name;
+        return values;
+    }
+
+    public void setTransient(boolean newTransientValue) {
+        
+    }
+
+    public String name() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+}

Added: myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/custom/savestate/UISaveStateTest.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/custom/savestate/UISaveStateTest.java?rev=963899&view=auto
==============================================================================
--- myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/custom/savestate/UISaveStateTest.java (added)
+++ myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/custom/savestate/UISaveStateTest.java Tue Jul 13 22:57:38 2010
@@ -0,0 +1,95 @@
+package org.apache.myfaces.custom.savestate;
+
+/*
+ * 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.
+ */
+import java.util.LinkedList;
+
+import javax.faces.el.ValueBinding;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+import org.apache.myfaces.test.AbstractTomahawkViewControllerTestCase;
+
+/**
+ * @author cagatay
+ * Tests for UISaveState
+ */
+public class UISaveStateTest extends AbstractTomahawkViewControllerTestCase{
+
+    private UISaveState saveState;
+    private SaveStateTestBean saveStateTestBean;
+
+    public UISaveStateTest(String name) {
+        super(name);
+    }
+
+    public static Test suite() {
+        return new TestSuite(UISaveStateTest.class);
+    }
+
+    public void setUp() throws Exception{
+        super.setUp();
+        saveState = new UISaveState();
+        saveStateTestBean = new SaveStateTestBean();
+        facesContext.getExternalContext().getRequestMap().put("testBean", saveStateTestBean);
+    }
+
+    public void tearDown() throws Exception{
+        saveState = null;
+        saveStateTestBean = null;
+        super.tearDown();
+    }
+
+    public void testWorksWithLinkedList() {
+        ValueBinding valueBinding = facesContext.getApplication().createValueBinding("#{testBean.linkedList}");
+        saveState.setValueBinding("value", valueBinding);
+
+        LinkedList linkedList = (LinkedList) valueBinding.getValue(facesContext);
+
+        try {
+            Object state = saveState.saveState(facesContext);
+            Object values[] = (Object[])state;
+            assertEquals(values[2], linkedList);
+
+            saveState.restoreState(facesContext, state);
+            
+        }catch(Exception exception) {
+            fail();
+        }
+    }
+
+    public void testWorksWithStateHolder() {
+        ValueBinding valueBinding = facesContext.getApplication().createValueBinding("#{testBean}");
+        saveState.setValueBinding("value", valueBinding);
+
+        SaveStateTestBean testBean = (SaveStateTestBean) valueBinding.getValue(facesContext);
+
+        try {
+            Object state = saveState.saveState(facesContext);
+            Object values[] = (Object[])state;
+            assertNotSame(values[2], testBean); //values[2] should be a type of "javax.faces.component._AttachedStateWrapper"
+
+            saveState.restoreState(facesContext, state);
+        }catch(Exception exception) {
+            fail();
+        }
+    }
+
+}

Added: myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/custom/selectOneCountry/SelectOneCountryRendererTest.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/custom/selectOneCountry/SelectOneCountryRendererTest.java?rev=963899&view=auto
==============================================================================
--- myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/custom/selectOneCountry/SelectOneCountryRendererTest.java (added)
+++ myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/custom/selectOneCountry/SelectOneCountryRendererTest.java Tue Jul 13 22:57:38 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.custom.selectOneCountry;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+import org.apache.myfaces.test.AbstractTomahawkViewControllerTestCase;
+import org.apache.myfaces.test.mock.MockResponseWriter;
+import org.apache.myfaces.test.utils.HtmlCheckAttributesUtil;
+import org.apache.myfaces.test.utils.HtmlRenderedAttr;
+
+public class SelectOneCountryRendererTest extends AbstractTomahawkViewControllerTestCase
+{
+    private SelectOneCountry selectCountry;
+    
+    public SelectOneCountryRendererTest(String name)
+    {
+        super(name);
+    }
+
+    public static Test suite() {
+        return new TestSuite(SelectOneCountryRendererTest.class);
+    }
+    
+    public void setUp() throws Exception
+    {
+        super.setUp();
+        selectCountry = new SelectOneCountry();
+        facesContext.getApplication().addComponent("org.apache.myfaces.CAPTCHA", "org.apache.myfaces.custom.captcha.CAPTCHAComponent");        
+    }
+    
+    public void tearDown() throws Exception 
+    {
+        super.tearDown();
+        selectCountry = null;
+    }
+    
+    public void testHtmlPropertyPassTru() throws Exception
+    {
+        HtmlRenderedAttr[] attrs = HtmlCheckAttributesUtil.generateBasicAttrs();
+        
+        MockResponseWriter writer = (MockResponseWriter)facesContext.getResponseWriter();
+        HtmlCheckAttributesUtil.checkRenderedAttributes(
+                selectCountry, facesContext, writer, attrs);
+        if(HtmlCheckAttributesUtil.hasFailedAttrRender(attrs)) 
+        {
+            fail(HtmlCheckAttributesUtil.constructErrorMessage(attrs, writer.getWriter().toString()));
+        }
+    }
+}

Added: myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/custom/selectOneLanguage/SelectOneLanguageRendererTest.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/custom/selectOneLanguage/SelectOneLanguageRendererTest.java?rev=963899&view=auto
==============================================================================
--- myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/custom/selectOneLanguage/SelectOneLanguageRendererTest.java (added)
+++ myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/custom/selectOneLanguage/SelectOneLanguageRendererTest.java Tue Jul 13 22:57:38 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.custom.selectOneLanguage;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+import org.apache.myfaces.test.AbstractTomahawkViewControllerTestCase;
+import org.apache.myfaces.test.mock.MockResponseWriter;
+import org.apache.myfaces.test.utils.HtmlCheckAttributesUtil;
+import org.apache.myfaces.test.utils.HtmlRenderedAttr;
+
+public class SelectOneLanguageRendererTest extends AbstractTomahawkViewControllerTestCase
+{
+    private SelectOneLanguage selectLanguage;
+    
+    public SelectOneLanguageRendererTest(String name)
+    {
+        super(name);
+    }
+
+    public static Test suite() {
+        return new TestSuite(SelectOneLanguageRendererTest.class);
+    }
+    
+    public void setUp() throws Exception
+    {
+        super.setUp();
+        selectLanguage = new SelectOneLanguage();
+        facesContext.getApplication().addComponent("org.apache.myfaces.CAPTCHA", "org.apache.myfaces.custom.captcha.CAPTCHAComponent");        
+    }
+    
+    public void tearDown() throws Exception 
+    {
+        super.tearDown();
+        selectLanguage = null;
+    }
+    
+    public void testHtmlPropertyPassTru() throws Exception
+    {
+        HtmlRenderedAttr[] attrs = HtmlCheckAttributesUtil.generateBasicAttrs();
+        
+        MockResponseWriter writer = (MockResponseWriter)facesContext.getResponseWriter();
+        HtmlCheckAttributesUtil.checkRenderedAttributes(
+                selectLanguage, facesContext, writer, attrs);
+        if(HtmlCheckAttributesUtil.hasFailedAttrRender(attrs)) 
+        {
+            fail(HtmlCheckAttributesUtil.constructErrorMessage(attrs, writer.getWriter().toString()));
+        }
+    }
+}

Added: myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/custom/selectOneRow/SelectOneRowRendererTest.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/custom/selectOneRow/SelectOneRowRendererTest.java?rev=963899&view=auto
==============================================================================
--- myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/custom/selectOneRow/SelectOneRowRendererTest.java (added)
+++ myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/custom/selectOneRow/SelectOneRowRendererTest.java Tue Jul 13 22:57:38 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.custom.selectOneRow;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+import org.apache.myfaces.test.AbstractTomahawkViewControllerTestCase;
+import org.apache.myfaces.test.mock.MockResponseWriter;
+import org.apache.myfaces.test.utils.HtmlCheckAttributesUtil;
+import org.apache.myfaces.test.utils.HtmlRenderedAttr;
+
+public class SelectOneRowRendererTest extends AbstractTomahawkViewControllerTestCase
+{
+    private SelectOneRow selectOneRow;
+    
+    public SelectOneRowRendererTest(String name)
+    {
+        super(name);
+    }
+
+    public static Test suite() {
+        return new TestSuite(SelectOneRowRendererTest.class);
+    }
+    
+    public void setUp() throws Exception
+    {
+        super.setUp();
+        selectOneRow = new SelectOneRow();   
+        selectOneRow.setGroupName("groupName");
+    }
+    
+    public void tearDown() throws Exception 
+    {
+        super.tearDown();
+        selectOneRow = null;
+    }
+    
+    public void testHtmlPropertyPassTru() throws Exception
+    {
+        HtmlRenderedAttr[] attrs = HtmlCheckAttributesUtil.generateBasicAttrs();
+        
+        MockResponseWriter writer = (MockResponseWriter)facesContext.getResponseWriter();
+        HtmlCheckAttributesUtil.checkRenderedAttributes(
+                selectOneRow, facesContext, writer, attrs);
+        if(HtmlCheckAttributesUtil.hasFailedAttrRender(attrs)) {
+            fail(HtmlCheckAttributesUtil.constructErrorMessage(attrs, writer.getWriter().toString()));
+        }
+    }
+}

Added: myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/custom/selectitems/Movie.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/custom/selectitems/Movie.java?rev=963899&view=auto
==============================================================================
--- myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/custom/selectitems/Movie.java (added)
+++ myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/custom/selectitems/Movie.java Tue Jul 13 22:57:38 2010
@@ -0,0 +1,77 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.myfaces.custom.selectitems;
+
+/**
+ * @author cagatay (latest modification by $Author: lu4242 $)
+ * @version $Revision: 783163 $ $Date: 2009-06-09 18:37:19 -0500 (Mar, 09 Jun 2009) $
+ * Simple test entity
+ */
+public class Movie {
+    private String name;
+    
+    private String director;
+    
+    private boolean disabled;
+    
+    private Boolean escaped;
+    
+    public Movie() {}
+    
+    public Movie(String name, String director) {
+        this.name = name;
+        this.director = director;
+        this.disabled = false;
+        this.escaped = Boolean.TRUE;
+    }
+    
+    public String getName() {
+        return name;
+    }
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getDirector() {
+        return director;
+    }
+    public void setDirector(String director) {
+        this.director = director;
+    }
+
+    public boolean isDisabled()
+    {
+        return disabled;
+    }
+
+    public void setDisabled(boolean disabled)
+    {
+        this.disabled = disabled;
+    }
+
+    public Boolean getEscaped()
+    {
+        return escaped;
+    }
+
+    public void setEscaped(Boolean escaped)
+    {
+        this.escaped = escaped;
+    }
+}

Added: myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/custom/selectitems/UISelectItems2Test.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/custom/selectitems/UISelectItems2Test.java?rev=963899&view=auto
==============================================================================
--- myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/custom/selectitems/UISelectItems2Test.java (added)
+++ myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/custom/selectitems/UISelectItems2Test.java Tue Jul 13 22:57:38 2010
@@ -0,0 +1,146 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.myfaces.custom.selectitems;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.faces.el.ValueBinding;
+import javax.faces.model.SelectItem;
+import javax.faces.model.SelectItemGroup;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+import org.apache.myfaces.test.base.AbstractJsfTestCase;
+
+/**
+ * @author cagatay (latest modification by $Author: lu4242 $)
+ * @version $Revision: 783163 $ $Date: 2009-06-09 18:37:19 -0500 (mar, 09 jun 2009) $
+ */
+public class UISelectItems2Test extends AbstractJsfTestCase{
+    
+    private UISelectItems selectItems;
+    
+    private Collection movieCollection;
+    
+    private Collection movieSelectItemsGroupCollection;
+    
+    private Map movieMap;
+    
+    private SelectItem[] movieSelectItems;
+
+    public UISelectItems2Test(String testName) {
+        super(testName);
+    }
+    
+    public static Test suite() {
+        return new TestSuite(UISelectItems2Test.class);
+    }
+
+    /**
+     * Sets up the test environment for <s:selectItems value="#{PossibleValueHere}" var="Movie" itemLabel="#{Movie.name} itemValue="#{Movie.director}" />
+     * Accepted possible values for the component can be a SelectItems array, a collection, a map and SelectItems group collection.
+     */
+    public void setUp() throws Exception{
+        super.setUp();
+        //component
+        selectItems = new UISelectItems();
+        ValueBinding itemLabelVb =  facesContext.getApplication().createValueBinding("#{Movie.name}");
+        ValueBinding itemValueVb =  facesContext.getApplication().createValueBinding("#{Movie.director}");
+        ValueBinding itemDisabledVb =  facesContext.getApplication().createValueBinding("#{Movie.disabled}");
+        ValueBinding itemLabelEscapedVb =  facesContext.getApplication().createValueBinding("#{Movie.escaped}");
+        
+        selectItems.setValueBinding("itemLabel", itemLabelVb);
+        selectItems.setValueBinding("itemValue", itemValueVb);
+        selectItems.setValueBinding("itemDisabled", itemDisabledVb);
+        selectItems.setValueBinding("itemLabelEscaped", itemLabelEscapedVb);
+        selectItems.getAttributes().put("var", "Movie");
+        
+        //entities
+        Movie movie1 = new Movie("Godfather", "Francis Ford Coppola");
+        Movie movie2 = new Movie("Goodfellas", "Martin Scorsese");
+        Movie movie3 = new Movie("Casino", "Martin Scorsese");
+        Movie movie4 = new Movie("Scarface", "Brian De Palma");
+        
+        //different value types
+        movieSelectItems = new SelectItem[3];
+        movieSelectItems[0] = new SelectItem(movie2.getDirector(), movie2.getName());
+        movieSelectItems[1] = new SelectItem(movie3.getDirector(), movie3.getName());
+        movieSelectItems[2] = new SelectItem(movie4.getDirector(), movie4.getName());
+        
+        movieCollection = new ArrayList();
+        movieCollection.add(movie1);
+        movieCollection.add(movie2);
+        movieCollection.add(movie3);
+        movieCollection.add(movie4);
+        
+        movieMap = new HashMap();
+        movieMap.put(movie3.getName(), movie3);
+        movieMap.put(movie4.getName(), movie4);
+
+        movieSelectItemsGroupCollection = new ArrayList();
+        movieSelectItemsGroupCollection.add(createSelectItemGroup("group1", movieSelectItems));
+        movieSelectItemsGroupCollection.add(createSelectItemGroup("group2", movieSelectItems));
+    }
+    
+    private SelectItemGroup createSelectItemGroup(String groupName, SelectItem[] items) {
+        SelectItemGroup group = new SelectItemGroup();
+        group.setLabel(groupName);
+        group.setSelectItems(items);
+         return group;
+    }
+    
+    public void tearDown() throws Exception{
+        selectItems = null;
+        super.tearDown();
+    }
+    
+    public void testCreateSelectItemsBySelectItems() {
+        selectItems.setValue(movieSelectItems);
+        SelectItem[] items = (SelectItem[]) selectItems.getValue();
+        assertEquals(items[1].getValue(), new String("Martin Scorsese"));
+        assertEquals(items[1].getLabel(), new String("Casino"));
+        assertEquals(items.length, 3);
+    }
+    
+    public void testCreateSelectItemsFromCollection() {
+        selectItems.setValue(movieCollection);
+        SelectItem[] items = (SelectItem[]) selectItems.getValue();
+        assertEquals(items[0].getValue(), "Francis Ford Coppola");
+        assertEquals(items[0].getLabel(), "Godfather");
+        assertEquals(items.length, 4);
+    }
+    
+    public void testCreateSelectItemsFromMap() {
+        selectItems.setValue(movieMap);
+        SelectItem[] items = (SelectItem[]) selectItems.getValue();
+        assertEquals(items.length, 2);
+    }
+    
+    public void testCreateSelectItemsFromSelectItemsGroupCollection() {
+        selectItems.setValue(movieSelectItemsGroupCollection);
+        SelectItem[] items = (SelectItem[]) selectItems.getValue();
+        assertEquals(items[5].getValue(), "Brian De Palma");
+        assertEquals(items[5].getLabel(),"Scarface");
+        assertEquals(items.length, 6);
+    }
+}

Added: myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/custom/selectitems/UISelectItemsTest.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/custom/selectitems/UISelectItemsTest.java?rev=963899&view=auto
==============================================================================
--- myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/custom/selectitems/UISelectItemsTest.java (added)
+++ myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/custom/selectitems/UISelectItemsTest.java Tue Jul 13 22:57:38 2010
@@ -0,0 +1,142 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.myfaces.custom.selectitems;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.faces.el.ValueBinding;
+import javax.faces.model.SelectItem;
+import javax.faces.model.SelectItemGroup;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+import org.apache.myfaces.test.base.AbstractJsfTestCase;
+
+/**
+ * @author cagatay (latest modification by $Author: lu4242 $)
+ * @version $Revision: 783163 $ $Date: 2009-06-09 18:37:19 -0500 (Mar, 09 Jun 2009) $
+ */
+public class UISelectItemsTest extends AbstractJsfTestCase{
+    
+    private UISelectItems selectItems;
+    
+    private Collection movieCollection;
+    
+    private Collection movieSelectItemsGroupCollection;
+    
+    private Map movieMap;
+    
+    private SelectItem[] movieSelectItems;
+
+    public UISelectItemsTest(String testName) {
+        super(testName);
+    }
+    
+    public static Test suite() {
+        return new TestSuite(UISelectItemsTest.class);
+    }
+
+    /**
+     * Sets up the test environment for <s:selectItems value="#{PossibleValueHere}" var="Movie" itemLabel="#{Movie.name} itemValue="#{Movie.director}" />
+     * Accepted possible values for the component can be a SelectItems array, a collection, a map and SelectItems group collection.
+     */
+    public void setUp() throws Exception{
+        super.setUp();
+        //component
+        selectItems = new UISelectItems();
+        ValueBinding itemLabelVb =  facesContext.getApplication().createValueBinding("#{Movie.name}");
+        ValueBinding itemValueVb =  facesContext.getApplication().createValueBinding("#{Movie.director}");
+        
+        selectItems.setValueBinding("itemLabel", itemLabelVb);
+        selectItems.setValueBinding("itemValue", itemValueVb);
+        selectItems.getAttributes().put("var", "Movie");
+        
+        //entities
+        Movie movie1 = new Movie("Godfather", "Francis Ford Coppola");
+        Movie movie2 = new Movie("Goodfellas", "Martin Scorsese");
+        Movie movie3 = new Movie("Casino", "Martin Scorsese");
+        Movie movie4 = new Movie("Scarface", "Brian De Palma");
+        
+        //different value types
+        movieSelectItems = new SelectItem[3];
+        movieSelectItems[0] = new SelectItem(movie2.getDirector(), movie2.getName());
+        movieSelectItems[1] = new SelectItem(movie3.getDirector(), movie3.getName());
+        movieSelectItems[2] = new SelectItem(movie4.getDirector(), movie4.getName());
+        
+        movieCollection = new ArrayList();
+        movieCollection.add(movie1);
+        movieCollection.add(movie2);
+        movieCollection.add(movie3);
+        movieCollection.add(movie4);
+        
+        movieMap = new HashMap();
+        movieMap.put(movie3.getName(), movie3);
+        movieMap.put(movie4.getName(), movie4);
+
+        movieSelectItemsGroupCollection = new ArrayList();
+        movieSelectItemsGroupCollection.add(createSelectItemGroup("group1", movieSelectItems));
+        movieSelectItemsGroupCollection.add(createSelectItemGroup("group2", movieSelectItems));
+    }
+    
+    private SelectItemGroup createSelectItemGroup(String groupName, SelectItem[] items) {
+        SelectItemGroup group = new SelectItemGroup();
+        group.setLabel(groupName);
+        group.setSelectItems(items);
+         return group;
+    }
+    
+    public void tearDown() throws Exception{
+        selectItems = null;
+        super.tearDown();
+    }
+    
+    public void testCreateSelectItemsBySelectItems() {
+        selectItems.setValue(movieSelectItems);
+        SelectItem[] items = (SelectItem[]) selectItems.getValue();
+        assertEquals(items[1].getValue(), new String("Martin Scorsese"));
+        assertEquals(items[1].getLabel(), new String("Casino"));
+        assertEquals(items.length, 3);
+    }
+    
+    public void testCreateSelectItemsFromCollection() {
+        selectItems.setValue(movieCollection);
+        SelectItem[] items = (SelectItem[]) selectItems.getValue();
+        assertEquals(items[0].getValue(), "Francis Ford Coppola");
+        assertEquals(items[0].getLabel(), "Godfather");
+        assertEquals(items.length, 4);
+    }
+    
+    public void testCreateSelectItemsFromMap() {
+        selectItems.setValue(movieMap);
+        SelectItem[] items = (SelectItem[]) selectItems.getValue();
+        assertEquals(items.length, 2);
+    }
+    
+    public void testCreateSelectItemsFromSelectItemsGroupCollection() {
+        selectItems.setValue(movieSelectItemsGroupCollection);
+        SelectItem[] items = (SelectItem[]) selectItems.getValue();
+        assertEquals(items[5].getValue(), "Brian De Palma");
+        assertEquals(items[5].getLabel(),"Scarface");
+        assertEquals(items.length, 6);
+    }
+}

Added: myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/custom/stylesheet/StylesheetRendererTest.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/custom/stylesheet/StylesheetRendererTest.java?rev=963899&view=auto
==============================================================================
--- myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/custom/stylesheet/StylesheetRendererTest.java (added)
+++ myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/custom/stylesheet/StylesheetRendererTest.java Tue Jul 13 22:57:38 2010
@@ -0,0 +1,107 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.myfaces.custom.stylesheet;
+
+import java.io.IOException;
+import java.io.StringWriter;
+
+import javax.faces.FacesException;
+
+import junit.framework.Test;
+
+import org.apache.myfaces.test.AbstractTomahawkViewControllerTestCase;
+import org.apache.myfaces.test.mock.MockResponseWriter;
+
+public class StylesheetRendererTest extends AbstractTomahawkViewControllerTestCase
+{
+
+    private MockResponseWriter writer ;
+    private Stylesheet stylesheet ;
+    
+    public StylesheetRendererTest(String name)
+    {
+        super(name);
+    }
+    
+    protected void setUp() throws Exception
+    {
+        super.setUp();
+        stylesheet = new Stylesheet();
+        stylesheet.setPath("test.css");
+        stylesheet.setMedia("printer");
+        writer = new MockResponseWriter(new StringWriter(), null, null);
+        facesContext.setResponseWriter(writer);
+//        facesContext.getRenderKit().addRenderer(
+//                stylesheet.getFamily(), 
+//                stylesheet.getRendererType(), 
+//                new StylesheetRenderer());
+    }
+
+    protected void tearDown() throws Exception
+    {
+        super.tearDown();
+        writer = null;
+        stylesheet = null;
+    }
+
+    /*
+     * Test method for 'org.apache.myfaces.custom.stylesheet.StylesheetRenderer.encodeEnd(FacesContext, UIComponent)'
+     */
+    public void testInline() throws IOException
+    {
+        stylesheet.setInline(true);
+        stylesheet.setPath("/styles/test.css");
+        stylesheet.encodeEnd(facesContext);
+        facesContext.renderResponse();
+
+        String output = writer.getWriter().toString();
+        
+        assertTrue("looking for a <style>", output.trim().startsWith("<style"));
+    }
+
+    /*
+     * Test method for 'org.apache.myfaces.custom.stylesheet.StylesheetRenderer.encodeEnd(FacesContext, UIComponent)'
+     */
+    public void testInlineInvalid() throws IOException
+    {
+        stylesheet.setInline(true);
+        try
+        {
+            stylesheet.encodeEnd(facesContext);
+            fail("No exception was thrown for an invalid stylesheet path");
+        }
+        catch(FacesException e)
+        {
+            // expected
+        }
+    }
+
+    public void testLink() throws IOException
+    {
+
+        stylesheet.encodeEnd(facesContext);
+        facesContext.renderResponse();
+
+        String output = writer.getWriter().toString();
+        
+        assertTrue("looking for a <link>", output.trim().startsWith("<link"));
+    }
+
+}

Added: myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/custom/swapimage/HtmlSwapImageRendererTest.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/custom/swapimage/HtmlSwapImageRendererTest.java?rev=963899&view=auto
==============================================================================
--- myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/custom/swapimage/HtmlSwapImageRendererTest.java (added)
+++ myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/custom/swapimage/HtmlSwapImageRendererTest.java Tue Jul 13 22:57:38 2010
@@ -0,0 +1,101 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.myfaces.custom.swapimage;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+import org.apache.myfaces.test.AbstractTomahawkViewControllerTestCase;
+import org.apache.myfaces.test.mock.MockResponseWriter;
+import org.apache.myfaces.test.utils.HtmlCheckAttributesUtil;
+import org.apache.myfaces.test.utils.HtmlRenderedAttr;
+
+public class HtmlSwapImageRendererTest extends AbstractTomahawkViewControllerTestCase
+{
+    private HtmlSwapImage swapImage;
+    
+    public HtmlSwapImageRendererTest(String name)
+    {
+        super(name);
+    }
+
+    public static Test suite() {
+        return new TestSuite(HtmlSwapImageRendererTest.class);
+    }
+    
+    public void setUp() throws Exception
+    {
+        super.setUp();
+        swapImage = new HtmlSwapImage();
+        swapImage.setActiveImageUrl("http://testurl/swapimage/activeImg.jpeg");
+        swapImage.setSwapImageUrl("http://testurl/swapimage/swapImg.jpeg");
+        swapImage.setUrl("http://testurl.com");
+    }
+    
+    public void tearDown() throws Exception 
+    {
+        super.tearDown();
+        swapImage = null;
+    }
+    
+    public void testHtmlPropertyPassTru() throws Exception
+    {
+        HtmlRenderedAttr[] attrs = {
+            //_UniversalProperties
+            new HtmlRenderedAttr("dir"), 
+            new HtmlRenderedAttr("lang"), 
+            new HtmlRenderedAttr("title"),
+            //_EventProperties
+            new HtmlRenderedAttr("onclick"), 
+            new HtmlRenderedAttr("ondblclick"), 
+            new HtmlRenderedAttr("onkeydown"), 
+            new HtmlRenderedAttr("onkeypress"),
+            new HtmlRenderedAttr("onkeyup"), 
+            new HtmlRenderedAttr("onmousedown"), 
+            new HtmlRenderedAttr("onmousemove"), 
+            new HtmlRenderedAttr("onmouseout", "onmouseout", "onmouseout=\""),
+            new HtmlRenderedAttr("onmouseover", "onmouseover", "onmouseover=\""), 
+            new HtmlRenderedAttr("onmouseup"),
+            //_StyleProperties
+            new HtmlRenderedAttr("style"), 
+            new HtmlRenderedAttr("styleClass", "styleClass", "class=\"styleClass\""),
+        };
+        
+        MockResponseWriter writer = (MockResponseWriter)facesContext.getResponseWriter();
+        HtmlCheckAttributesUtil.checkRenderedAttributes(
+                swapImage, facesContext, writer, attrs);
+        if(HtmlCheckAttributesUtil.hasFailedAttrRender(attrs)) 
+        {
+            fail(HtmlCheckAttributesUtil.constructErrorMessage(attrs, writer.getWriter().toString()));
+        }
+    }
+    
+    public void testHtmlPropertyPassTruNotRendered() throws Exception
+    {
+        HtmlRenderedAttr[] attrs = HtmlCheckAttributesUtil.generateAttrsNotRenderedForReadOnly();
+        
+        MockResponseWriter writer = (MockResponseWriter)facesContext.getResponseWriter();
+        HtmlCheckAttributesUtil.checkRenderedAttributes(
+                swapImage, facesContext, writer, attrs);
+        if(HtmlCheckAttributesUtil.hasFailedAttrRender(attrs)) 
+        {
+            fail(HtmlCheckAttributesUtil.constructErrorMessage(attrs, writer.getWriter().toString()));
+        }
+    }
+}

Added: myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/custom/tabbedpane/HtmlTabbedPaneRendererTest.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/custom/tabbedpane/HtmlTabbedPaneRendererTest.java?rev=963899&view=auto
==============================================================================
--- myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/custom/tabbedpane/HtmlTabbedPaneRendererTest.java (added)
+++ myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/custom/tabbedpane/HtmlTabbedPaneRendererTest.java Tue Jul 13 22:57:38 2010
@@ -0,0 +1,124 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.myfaces.custom.tabbedpane;
+
+import java.io.PrintWriter;
+import java.io.StringWriter;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+import org.apache.myfaces.shared_tomahawk.renderkit.html.HTML;
+import org.apache.myfaces.test.AbstractTomahawkViewControllerTestCase;
+import org.apache.myfaces.test.mock.MockResponseWriter;
+import org.apache.myfaces.test.utils.HtmlCheckAttributesUtil;
+import org.apache.myfaces.test.utils.HtmlRenderedAttr;
+import org.apache.myfaces.test.utils.MockTestViewHandler;
+
+public class HtmlTabbedPaneRendererTest extends AbstractTomahawkViewControllerTestCase
+{
+    private HtmlPanelTabbedPane tabbedPane;
+    
+    public HtmlTabbedPaneRendererTest(String name)
+    {
+        super(name);
+    }
+
+    public static Test suite() {
+        return new TestSuite(HtmlTabbedPaneRendererTest.class);
+    }
+    
+    public void setUp() throws Exception
+    {
+        super.setUp();
+        application.setViewHandler(new MockTestViewHandler());
+        tabbedPane = new HtmlPanelTabbedPane();
+    }
+    
+    public void tearDown() throws Exception 
+    {
+        super.tearDown();
+        tabbedPane = null;
+    }
+    
+    public void testHtmlPropertyPassTru() throws Exception
+    {
+        HtmlRenderedAttr[] attrs = {
+            //_UniversalProperties
+            new HtmlRenderedAttr("dir"), 
+            new HtmlRenderedAttr("lang"), 
+            new HtmlRenderedAttr("title"),
+            //_EventProperties
+            new HtmlRenderedAttr("onclick"), 
+            new HtmlRenderedAttr("ondblclick"), 
+            new HtmlRenderedAttr("onkeydown"), 
+            new HtmlRenderedAttr("onkeypress"),
+            new HtmlRenderedAttr("onkeyup"), 
+            new HtmlRenderedAttr("onmousedown"), 
+            new HtmlRenderedAttr("onmousemove"), 
+            new HtmlRenderedAttr("onmouseout"),
+            new HtmlRenderedAttr("onmouseover"), 
+            new HtmlRenderedAttr("onmouseup"),
+            //_StyleProperties
+            new HtmlRenderedAttr("style"), 
+            new HtmlRenderedAttr("styleClass", "styleClass", "class=\"myFaces_panelTabbedPane styleClass\""),
+        };
+        
+        tabbedPane.setServerSideTabSwitch(false);
+        
+        MockResponseWriter writer = (MockResponseWriter)facesContext.getResponseWriter();
+        try {
+            HtmlCheckAttributesUtil.checkRenderedAttributes(
+                    tabbedPane, facesContext, writer, attrs);
+        } catch(Exception e) {
+            StringWriter sw = new StringWriter();
+            e.printStackTrace(new PrintWriter(sw));
+            fail(sw.toString() + "\nHTML.TABLE_PASSTHROUGH_ATTRIBUTES: " + printHTMLAttrs(HTML.TABLE_PASSTHROUGH_ATTRIBUTES));
+        }
+        if(HtmlCheckAttributesUtil.hasFailedAttrRender(attrs)) {
+            fail(HtmlCheckAttributesUtil.constructErrorMessage(attrs, writer.getWriter().toString()));
+        }
+    }
+    
+    public void testHtmlPropertyPassTruNotRendered() throws Exception 
+    { 
+        HtmlRenderedAttr[] attrs = HtmlCheckAttributesUtil.generateAttrsNotRenderedForReadOnly();
+
+        tabbedPane.setServerSideTabSwitch(false);
+        MockResponseWriter writer = (MockResponseWriter)facesContext.getResponseWriter();
+        HtmlCheckAttributesUtil.checkRenderedAttributes(
+                tabbedPane, facesContext, writer, attrs);
+        if(HtmlCheckAttributesUtil.hasFailedAttrRender(attrs)) 
+        {
+            fail(HtmlCheckAttributesUtil.constructErrorMessage(attrs, writer.getWriter().toString()));
+        }
+    }
+    
+    private String printHTMLAttrs(String[] attrs) 
+    {
+        StringBuffer buffer = new StringBuffer();
+        for(int i = 0; i < attrs.length; i++) {
+            buffer.append(attrs[i]);
+            if(i+1 < attrs.length) {
+                buffer.append(", ");
+            }
+        }
+        return buffer.toString();
+    }
+}

Added: myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/custom/toggle/ToggleGroupRendererTest.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/custom/toggle/ToggleGroupRendererTest.java?rev=963899&view=auto
==============================================================================
--- myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/custom/toggle/ToggleGroupRendererTest.java (added)
+++ myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/custom/toggle/ToggleGroupRendererTest.java Tue Jul 13 22:57:38 2010
@@ -0,0 +1,96 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.myfaces.custom.toggle;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+import org.apache.myfaces.test.AbstractTomahawkViewControllerTestCase;
+import org.apache.myfaces.test.mock.MockResponseWriter;
+import org.apache.myfaces.test.utils.HtmlCheckAttributesUtil;
+import org.apache.myfaces.test.utils.HtmlRenderedAttr;
+
+public class ToggleGroupRendererTest extends AbstractTomahawkViewControllerTestCase
+{
+    private MockResponseWriter writer;
+    private ToggleGroup toggleGroup;
+    
+    public ToggleGroupRendererTest(String name)
+    {
+        super(name);
+    }
+    
+    public static Test suite() {
+        return new TestSuite(ToggleGroupRendererTest.class);
+    }
+    
+    public void setUp() throws Exception {
+        super.setUp();
+        writer = (MockResponseWriter)facesContext.getResponseWriter();
+        toggleGroup = new ToggleGroup();
+    }
+    
+    public void tearDown() {
+        writer = null;
+        toggleGroup = null;
+    }    
+    
+    public void testHtmlPropertyPassTru() throws Exception
+    {
+        HtmlRenderedAttr[] attrs = {
+            //_UniversalProperties
+            new HtmlRenderedAttr("dir"), 
+            new HtmlRenderedAttr("lang"), 
+            new HtmlRenderedAttr("title"),
+            //_EventProperties
+            new HtmlRenderedAttr("onclick"), 
+            new HtmlRenderedAttr("ondblclick"), 
+            new HtmlRenderedAttr("onkeydown"), 
+            new HtmlRenderedAttr("onkeypress"),
+            new HtmlRenderedAttr("onkeyup"), 
+            new HtmlRenderedAttr("onmousedown"), 
+            new HtmlRenderedAttr("onmousemove"), 
+            new HtmlRenderedAttr("onmouseout"),
+            new HtmlRenderedAttr("onmouseover"), 
+            new HtmlRenderedAttr("onmouseup"),
+            //_StyleProperties
+            new HtmlRenderedAttr("style", "style", "style=\"style\""), 
+            new HtmlRenderedAttr("styleClass", "styleClass", "class=\"styleClass\""),
+        };
+
+        HtmlCheckAttributesUtil.checkRenderedAttributes(
+                toggleGroup, facesContext, writer, attrs);
+        if(HtmlCheckAttributesUtil.hasFailedAttrRender(attrs)) 
+        {
+            fail(HtmlCheckAttributesUtil.constructErrorMessage(attrs, writer.getWriter().toString()));
+        }
+    }    
+    
+    public void testHtmlPropertyPassTruNotRendered() throws Exception
+    {
+        HtmlRenderedAttr[] attrs = HtmlCheckAttributesUtil.generateAttrsNotRenderedForReadOnly();
+
+        HtmlCheckAttributesUtil.checkRenderedAttributes(
+                toggleGroup, facesContext, writer, attrs);
+        if(HtmlCheckAttributesUtil.hasFailedAttrRender(attrs)) 
+        {
+            fail(HtmlCheckAttributesUtil.constructErrorMessage(attrs, writer.getWriter().toString()));
+        }
+    }    
+}

Added: myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/custom/toggle/ToggleLinkRendererTest.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/custom/toggle/ToggleLinkRendererTest.java?rev=963899&view=auto
==============================================================================
--- myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/custom/toggle/ToggleLinkRendererTest.java (added)
+++ myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/custom/toggle/ToggleLinkRendererTest.java Tue Jul 13 22:57:38 2010
@@ -0,0 +1,101 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.myfaces.custom.toggle;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+import org.apache.myfaces.component.html.ext.HtmlInputText;
+import org.apache.myfaces.test.AbstractTomahawkViewControllerTestCase;
+import org.apache.myfaces.test.mock.MockResponseWriter;
+import org.apache.myfaces.test.utils.HtmlCheckAttributesUtil;
+import org.apache.myfaces.test.utils.HtmlRenderedAttr;
+
+public class ToggleLinkRendererTest extends AbstractTomahawkViewControllerTestCase
+{
+    private MockResponseWriter writer;
+    private ToggleLink link;
+    private TogglePanel panel;
+    
+    public ToggleLinkRendererTest(String name)
+    {
+        super(name);
+    }
+    
+    public static Test suite() {
+        return new TestSuite(ToggleLinkRendererTest.class);
+    }
+    
+    public void setUp() throws Exception {
+        super.setUp();
+        writer = (MockResponseWriter)facesContext.getResponseWriter();
+        link = new ToggleLink();
+        panel = new TogglePanel();
+        
+        HtmlInputText inputText = new HtmlInputText();
+        inputText.setId("comp1");
+        
+        panel.getChildren().add(link);
+        panel.getChildren().add(inputText);
+        link.setFor("comp1");
+    }
+    
+    public void tearDown() {
+        writer = null;
+        link = null;
+    }    
+    
+    public void testHtmlPropertyPassTru() throws Exception
+    {
+        HtmlRenderedAttr[] attrs = {
+            //_AccesskeyProperty
+            new HtmlRenderedAttr("accesskey"),
+            //_UniversalProperties
+            new HtmlRenderedAttr("dir"), 
+            new HtmlRenderedAttr("lang"), 
+            new HtmlRenderedAttr("title"),
+            //_FocusBlurProperties
+            new HtmlRenderedAttr("onfocus"), 
+            new HtmlRenderedAttr("onblur"),
+            //_EventProperties
+            new HtmlRenderedAttr("onclick", "onclick", "onclick=\""), 
+            new HtmlRenderedAttr("ondblclick"), 
+            new HtmlRenderedAttr("onkeydown"), 
+            new HtmlRenderedAttr("onkeypress"),
+            new HtmlRenderedAttr("onkeyup"), 
+            new HtmlRenderedAttr("onmousedown"), 
+            new HtmlRenderedAttr("onmousemove"), 
+            new HtmlRenderedAttr("onmouseout"),
+            new HtmlRenderedAttr("onmouseover"), 
+            new HtmlRenderedAttr("onmouseup"),
+            //_StyleProperties
+            new HtmlRenderedAttr("style"), 
+            new HtmlRenderedAttr("styleClass", "styleClass", "class=\"styleClass\""),
+            //_TabindexProperty
+            new HtmlRenderedAttr("tabindex")
+        };
+
+        HtmlCheckAttributesUtil.checkRenderedAttributes(
+                link, facesContext, writer, attrs);
+        if(HtmlCheckAttributesUtil.hasFailedAttrRender(attrs)) 
+        {
+            fail(HtmlCheckAttributesUtil.constructErrorMessage(attrs, writer.getWriter().toString()));
+        }
+    }    
+}

Added: myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/custom/toggle/TogglePanelRendererTest.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/custom/toggle/TogglePanelRendererTest.java?rev=963899&view=auto
==============================================================================
--- myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/custom/toggle/TogglePanelRendererTest.java (added)
+++ myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/custom/toggle/TogglePanelRendererTest.java Tue Jul 13 22:57:38 2010
@@ -0,0 +1,78 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.myfaces.custom.toggle;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+import org.apache.myfaces.test.AbstractTomahawkViewControllerTestCase;
+import org.apache.myfaces.test.mock.MockResponseWriter;
+import org.apache.myfaces.test.utils.HtmlCheckAttributesUtil;
+import org.apache.myfaces.test.utils.HtmlRenderedAttr;
+
+public class TogglePanelRendererTest extends AbstractTomahawkViewControllerTestCase
+{
+    private MockResponseWriter writer;
+    private TogglePanel panel;
+    
+    public TogglePanelRendererTest(String name)
+    {
+        super(name);
+    }
+    
+    public static Test suite() {
+        return new TestSuite(TogglePanelRendererTest.class);
+    }
+    
+    public void setUp() throws Exception {
+        super.setUp();
+        writer = (MockResponseWriter)facesContext.getResponseWriter();
+        panel = new TogglePanel();
+    }
+    
+    public void tearDown() {
+        writer = null;
+        panel = null;
+    }    
+    
+    public void testHtmlPropertyPassTru() throws Exception
+    {
+        HtmlRenderedAttr[] attrs = HtmlCheckAttributesUtil.generateBasicReadOnlyAttrs();
+
+        HtmlCheckAttributesUtil.checkRenderedAttributes(
+                panel, facesContext, writer, attrs);
+        if(HtmlCheckAttributesUtil.hasFailedAttrRender(attrs)) 
+        {
+            fail(HtmlCheckAttributesUtil.constructErrorMessage(attrs, writer.getWriter().toString()));
+        }
+    } 
+    
+    
+    public void testHtmlPropertyPassTruNotRendered() throws Exception
+    {
+        HtmlRenderedAttr[] attrs = HtmlCheckAttributesUtil.generateAttrsNotRenderedForReadOnly();
+
+        HtmlCheckAttributesUtil.checkRenderedAttributes(
+                panel, facesContext, writer, attrs);
+        if(HtmlCheckAttributesUtil.hasFailedAttrRender(attrs)) 
+        {
+            fail(HtmlCheckAttributesUtil.constructErrorMessage(attrs, writer.getWriter().toString()));
+        }
+    }    
+}

Added: myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/custom/transform/ManagedFoo.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/custom/transform/ManagedFoo.java?rev=963899&view=auto
==============================================================================
--- myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/custom/transform/ManagedFoo.java (added)
+++ myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/custom/transform/ManagedFoo.java Tue Jul 13 22:57:38 2010
@@ -0,0 +1,96 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.myfaces.custom.transform;
+
+import java.io.InputStream;
+
+/**
+ * Simple class to be used as a ManagedBean in testing.
+ *
+ * @author Sean Schofield
+ */
+public class ManagedFoo
+{
+    private String content;
+    private String stylesheet;
+    private String contentLocation;
+    private String stylesheetLocation;
+    private InputStream contentStream;
+    private InputStream styleStream;
+
+    public String getContent()
+    {
+        return content;
+    }
+
+    public void setContent(String content)
+    {
+        this.content = content;
+    }
+
+    public String getStylesheet()
+    {
+        return stylesheet;
+    }
+
+    public void setStylesheet(String stylesheet)
+    {
+        this.stylesheet = stylesheet;
+    }
+
+    public String getContentLocation()
+    {
+        return contentLocation;
+    }
+
+    public void setContentLocation(String contentLocation)
+    {
+        this.contentLocation = contentLocation;
+    }
+
+    public String getStylesheetLocation()
+    {
+        return stylesheetLocation;
+    }
+
+    public void setStylesheetLocation(String stylesheetLocation)
+    {
+        this.stylesheetLocation = stylesheetLocation;
+    }
+
+    public InputStream getContentStream()
+    {
+        return contentStream;
+    }
+
+    public void setContentStream(InputStream contentStream)
+    {
+        this.contentStream = contentStream;
+    }
+
+    public InputStream getStyleStream()
+    {
+        return styleStream;
+    }
+
+    public void setStyleStream(InputStream styleStream)
+    {
+        this.styleStream = styleStream;
+    }
+}