[richfaces-svn-commits] JBoss Rich Faces SVN: r293 - in trunk/richfaces/datascroller/src/test/java/org/richfaces: component and 1 other directories.

richfaces-svn-commits at lists.jboss.org richfaces-svn-commits at lists.jboss.org
Fri Apr 6 04:37:12 EDT 2007


Author: A.Skokov
Date: 2007-04-06 04:37:12 -0400 (Fri, 06 Apr 2007)
New Revision: 293

Removed:
   trunk/richfaces/datascroller/src/test/java/org/richfaces/component/html/HtmlDatascrollerTest.java
   trunk/richfaces/datascroller/src/test/java/org/richfaces/taglib/
Modified:
   trunk/richfaces/datascroller/src/test/java/org/richfaces/component/DatascrollerComponentTest.java
Log:
test updated

Modified: trunk/richfaces/datascroller/src/test/java/org/richfaces/component/DatascrollerComponentTest.java
===================================================================
--- trunk/richfaces/datascroller/src/test/java/org/richfaces/component/DatascrollerComponentTest.java	2007-04-05 19:54:10 UTC (rev 292)
+++ trunk/richfaces/datascroller/src/test/java/org/richfaces/component/DatascrollerComponentTest.java	2007-04-06 08:37:12 UTC (rev 293)
@@ -24,10 +24,8 @@
 import com.gargoylesoftware.htmlunit.html.HtmlElement;
 import com.gargoylesoftware.htmlunit.html.HtmlPage;
 import com.gargoylesoftware.htmlunit.html.HtmlScript;
-import junit.framework.Assert;
 import org.ajax4jsf.tests.AbstractAjax4JsfTestCase;
 import org.apache.commons.lang.StringUtils;
-import org.richfaces.component.html.HtmlDatascroller;
 
 import javax.faces.component.UIComponent;
 import javax.faces.component.UIData;
@@ -49,7 +47,7 @@
         javaScripts.add("prototype.js");
     }
 
-    private HtmlDatascroller scroller;
+    private UIDatascroller scroller;
     private UIComponent form;
     private UIData data;
 
@@ -77,7 +75,7 @@
         data.setRows(5);
         form.getChildren().add(data);
 
-        scroller = (HtmlDatascroller)application.createComponent(HtmlDatascroller.COMPONENT_TYPE);
+        scroller = (UIDatascroller)application.createComponent("org.richfaces.Datascroller");
         scroller.setId("dataScroller");
         scroller.setFor(data.getId());
 
@@ -95,36 +93,22 @@
     }
 
     /**
-     * Test component default values
-     *
-     * @throws Exception
-     */
-    public void testDefaultValues() throws Exception {
-        assertEquals(0, scroller.getFastStep());
-        assertEquals(10, scroller.getMaxPages());
-        assertEquals(true, scroller.isRenderIfSinglePage());
-        assertEquals(true, scroller.isIgnoreDupResponses());
-        assertEquals(true, scroller.isAjaxSingle());
-        assertEquals(true, scroller.isRenderCurrentAsText());
-    }
-
-    /**
      * Test component rendering
      *
      * @throws Exception
      */
     public void testRender() throws Exception {
         HtmlPage page = renderView();
-        Assert.assertNotNull(page);
+        assertNotNull(page);
         System.out.println(page.asXml());
 
-        HtmlElement div = page.getHtmlElementById(form.getId() + ":" + scroller.getId());
-        Assert.assertNotNull(div);
-        Assert.assertEquals("div", div.getNodeName());
+        HtmlElement div = page.getHtmlElementById(scroller.getClientId(facesContext));
+        assertNotNull(div);
+        assertEquals("div", div.getNodeName());
 
         String classAttr = div.getAttributeValue("class");
-        Assert.assertTrue(classAttr.contains("dr-dscr"));
-        Assert.assertTrue(classAttr.contains("rich-datascr"));
+        assertTrue(classAttr.contains("dr-dscr"));
+        assertTrue(classAttr.contains("rich-datascr"));
     }
 
     /**
@@ -134,12 +118,12 @@
      */
     public void testRenderStyle() throws Exception {
         HtmlPage page = renderView();
-        Assert.assertNotNull(page);
+        assertNotNull(page);
         List links = page.getDocumentElement().getHtmlElementsByTagName("link");
 
-        Assert.assertEquals(1, links.size());
+        assertEquals(1, links.size());
         HtmlElement link = (HtmlElement) links.get(0);
-        Assert.assertTrue(link.getAttributeValue("href").contains("org/richfaces/renderkit/html/css/datascroller.xcss"));
+        assertTrue(link.getAttributeValue("href").contains("org/richfaces/renderkit/html/css/datascroller.xcss"));
     }
 
     /**
@@ -149,7 +133,7 @@
      */
     public void testRenderScript() throws Exception {
         HtmlPage page = renderView();
-        Assert.assertNotNull(page);
+        assertNotNull(page);
         List scripts = page.getDocumentElement().getHtmlElementsByTagName("script");
 
         for (Iterator it = scripts.iterator(); it.hasNext();) {

Deleted: trunk/richfaces/datascroller/src/test/java/org/richfaces/component/html/HtmlDatascrollerTest.java
===================================================================
--- trunk/richfaces/datascroller/src/test/java/org/richfaces/component/html/HtmlDatascrollerTest.java	2007-04-05 19:54:10 UTC (rev 292)
+++ trunk/richfaces/datascroller/src/test/java/org/richfaces/component/html/HtmlDatascrollerTest.java	2007-04-06 08:37:12 UTC (rev 293)
@@ -1,61 +0,0 @@
-/**
- * License Agreement.
- *
- *  JBoss RichFaces 3.0 - Ajax4jsf Component Library
- *
- * Copyright (C) 2007  Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
- */
-
-package org.richfaces.component.html;
-
-import org.ajax4jsf.tests.AbstractAjax4JsfTestCase;
-
-/**
- * Unit test for HtmlDatascroller.
- */
-public class HtmlDatascrollerTest extends AbstractAjax4JsfTestCase {
-    public HtmlDatascrollerTest(String name) {
-        super(name);
-    }
-
-    /* (non-Javadoc)
-     * @see org.ajax4jsf.tests.AbstractAjax4JsfTestCase#setUp()
-     */
-    public void setUp() throws Exception {
-        super.setUp();
-    }
-
-    /* (non-Javadoc)
-     * @see org.ajax4jsf.tests.AbstractAjax4JsfTestCase#tearDown()
-     */
-    public void tearDown() throws Exception {
-        super.tearDown();
-    }
-
-    /**
-     * Test save/restore state
-     *
-     * @throws Exception
-     */
-    public void testSaveStateFacesContext() throws Exception {
-        HtmlDatascroller ds = new HtmlDatascroller();
-        ds.setStyleClass("styleClass");
-        Object state = ds.saveState(facesContext);
-        HtmlDatascroller newDs = new HtmlDatascroller();
-        newDs.restoreState(facesContext, state);
-        assertEquals("styleClass", newDs.getStyleClass());
-    }
-}




More information about the richfaces-svn-commits mailing list