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 [3/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...

Added: myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/custom/swapimage/HtmlSwapImageClientBehaviorRendererTest.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/custom/swapimage/HtmlSwapImageClientBehaviorRendererTest.java?rev=980615&view=auto
==============================================================================
--- myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/custom/swapimage/HtmlSwapImageClientBehaviorRendererTest.java (added)
+++ myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/custom/swapimage/HtmlSwapImageClientBehaviorRendererTest.java Fri Jul 30 00:33:23 2010
@@ -0,0 +1,75 @@
+/*
+ * 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 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.junit.Ignore;
+import org.junit.Test;
+
+/**
+ * @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 HtmlSwapImageClientBehaviorRendererTest 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()
+    {
+        HtmlSwapImage swapImage = new HtmlSwapImage();
+        swapImage.setActiveImageUrl("http://testurl/swapimage/activeImg.jpeg");
+        swapImage.setSwapImageUrl("http://testurl/swapimage/swapImg.jpeg");
+        swapImage.setUrl("http://testurl.com");
+        return swapImage;
+    }
+
+    @Override
+    protected HtmlRenderedClientEventAttr[] getClientBehaviorHtmlRenderedAttributes()
+    {
+        return attrs;
+    }
+
+    @Test
+    @Ignore
+    @Override
+    public void testClientBehaviorHolderRendersName()
+    {
+        super.testClientBehaviorHolderRendersName();
+    }
+}

Added: myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/custom/tabbedpane/HtmlTabbedPaneClientBehaviorTest.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/custom/tabbedpane/HtmlTabbedPaneClientBehaviorTest.java?rev=980615&view=auto
==============================================================================
--- myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/custom/tabbedpane/HtmlTabbedPaneClientBehaviorTest.java (added)
+++ myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/custom/tabbedpane/HtmlTabbedPaneClientBehaviorTest.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.custom.tabbedpane;
+
+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 HtmlTabbedPaneClientBehaviorTest 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 HtmlPanelTabbedPane();
+    }
+
+    @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/custom/toggle/ToggleGroupClientBehaviorTest.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/custom/toggle/ToggleGroupClientBehaviorTest.java?rev=980615&view=auto
==============================================================================
--- myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/custom/toggle/ToggleGroupClientBehaviorTest.java (added)
+++ myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/custom/toggle/ToggleGroupClientBehaviorTest.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.custom.toggle;
+
+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 ToggleGroupClientBehaviorTest 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 ToggleGroup();
+    }
+
+    @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/custom/toggle/ToggleLinkClientBehaviorRendererTest.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/custom/toggle/ToggleLinkClientBehaviorRendererTest.java?rev=980615&view=auto
==============================================================================
--- myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/custom/toggle/ToggleLinkClientBehaviorRendererTest.java (added)
+++ myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/custom/toggle/ToggleLinkClientBehaviorRendererTest.java Fri Jul 30 00:33:23 2010
@@ -0,0 +1,81 @@
+/*
+ * 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 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.HtmlInputText;
+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 ToggleLinkClientBehaviorRendererTest 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()
+    {
+        ToggleLink component = new ToggleLink();
+        TogglePanel panel = new TogglePanel();
+        UIComponent form = new HtmlForm();
+        HtmlInputText inputText = new HtmlInputText();
+        inputText.setId("comp1");
+        component.setFor("comp1");
+        form.getChildren().add(panel);
+        panel.getChildren().add(component);
+        panel.getChildren().add(inputText);
+        facesContext.getViewRoot().getChildren().add(form);
+        return component;
+    }
+
+    @Override
+    protected HtmlRenderedClientEventAttr[] getClientBehaviorHtmlRenderedAttributes()
+    {
+        return attrs;
+    }
+}

Added: myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/custom/toggle/TogglePanelClientBehaviorTest.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/custom/toggle/TogglePanelClientBehaviorTest.java?rev=980615&view=auto
==============================================================================
--- myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/custom/toggle/TogglePanelClientBehaviorTest.java (added)
+++ myfaces/tomahawk/trunk/core20/src/test/java/org/apache/myfaces/custom/toggle/TogglePanelClientBehaviorTest.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.custom.toggle;
+
+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 TogglePanelClientBehaviorTest 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 TogglePanel();
+    }
+
+    @Override
+    protected HtmlRenderedClientEventAttr[] getClientBehaviorHtmlRenderedAttributes()
+    {
+        return attrs;
+    }
+    
+    /**
+     * div tag does not have name attribute
+     */
+    @Test
+    @Ignore
+    @Override
+    public void testClientBehaviorHolderRendersName()
+    {
+        super.testClientBehaviorHolderRendersName();
+    }
+}