[richfaces-svn-commits] JBoss Rich Faces SVN: r299 - trunk/richfaces/toolBar/src/test/java/org/richfaces/component.
richfaces-svn-commits at lists.jboss.org
richfaces-svn-commits at lists.jboss.org
Fri Apr 6 04:43:14 EDT 2007
Author: A.Skokov
Date: 2007-04-06 04:43:14 -0400 (Fri, 06 Apr 2007)
New Revision: 299
Modified:
trunk/richfaces/toolBar/src/test/java/org/richfaces/component/ToolBarComponentTest.java
Log:
test updated
Modified: trunk/richfaces/toolBar/src/test/java/org/richfaces/component/ToolBarComponentTest.java
===================================================================
--- trunk/richfaces/toolBar/src/test/java/org/richfaces/component/ToolBarComponentTest.java 2007-04-06 08:42:42 UTC (rev 298)
+++ trunk/richfaces/toolBar/src/test/java/org/richfaces/component/ToolBarComponentTest.java 2007-04-06 08:43:14 UTC (rev 299)
@@ -25,7 +25,6 @@
import com.gargoylesoftware.htmlunit.html.HtmlPage;
import junit.framework.Assert;
import org.ajax4jsf.tests.AbstractAjax4JsfTestCase;
-import org.richfaces.component.html.HtmlToolBar;
import org.richfaces.component.html.HtmlToolBarGroup;
import javax.faces.component.UIForm;
@@ -38,8 +37,8 @@
*/
public class ToolBarComponentTest extends AbstractAjax4JsfTestCase {
- private HtmlToolBar toolBar;
- private HtmlToolBarGroup toolBarGroup;
+ private UIToolBar toolBar;
+ private UIToolBarGroup toolBarGroup;
private HtmlCommandButton button1;
private HtmlCommandButton button2;
private UIForm form;
@@ -63,7 +62,7 @@
form.setId("form");
facesContext.getViewRoot().getChildren().add(form);
- toolBar = (HtmlToolBar)application.createComponent(HtmlToolBar.COMPONENT_TYPE);
+ toolBar = (UIToolBar)application.createComponent("org.richfaces.ToolBar");
toolBar.setId("toolBar");
form.getChildren().add(toolBar);
@@ -71,7 +70,7 @@
button1.setValue("Change 1");
toolBar.getChildren().add(button1);
- toolBarGroup = (HtmlToolBarGroup)application.createComponent(HtmlToolBarGroup.COMPONENT_TYPE);
+ toolBarGroup = (HtmlToolBarGroup)application.createComponent("org.richfaces.ToolBarGroup");
button2 = (HtmlCommandButton)application.createComponent(HtmlCommandButton.COMPONENT_TYPE);
button2.setValue("Change 2");
toolBarGroup.getChildren().add(button2);
@@ -90,33 +89,22 @@
}
/**
- * Test component default values
- *
- * @throws Exception
- */
- public void testDefaultValues() throws Exception {
- Assert.assertEquals("100%", toolBar.getWidth());
- Assert.assertEquals("none", toolBar.getItemSeparator());
- Assert.assertEquals("none", toolBarGroup.getItemSeparator());
- Assert.assertEquals("left", toolBarGroup.getLocation());
- }
- /**
* Test component rendering
*
* @throws Exception
*/
public void testRender() throws Exception {
HtmlPage page = renderView();
- Assert.assertNotNull(page);
+ assertNotNull(page);
System.out.println(page.asXml());
HtmlElement table = page.getHtmlElementById(form.getId() + ":" + toolBar.getId());
- Assert.assertNotNull(table);
- Assert.assertEquals("table", table.getNodeName());
+ assertNotNull(table);
+ assertEquals("table", table.getNodeName());
String classAttr = table.getAttributeValue("class");
- Assert.assertTrue(classAttr.contains("dr-toolbar-ext"));
- Assert.assertTrue(classAttr.contains("rich-toolbar"));
+ assertTrue(classAttr.contains("dr-toolbar-ext"));
+ assertTrue(classAttr.contains("rich-toolbar"));
}
/**
@@ -128,8 +116,8 @@
HtmlPage page = renderView();
Assert.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/toolBar.xcss"));
+ assertTrue(link.getAttributeValue("href").contains("org/richfaces/renderkit/html/css/toolBar.xcss"));
}
}
More information about the richfaces-svn-commits
mailing list