[richfaces-svn-commits] JBoss Rich Faces SVN: r301 - trunk/richfaces/datascroller/src/test/java/org/richfaces/component.
richfaces-svn-commits at lists.jboss.org
richfaces-svn-commits at lists.jboss.org
Fri Apr 6 07:56:56 EDT 2007
Author: A.Skokov
Date: 2007-04-06 07:56:56 -0400 (Fri, 06 Apr 2007)
New Revision: 301
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-06 11:15:12 UTC (rev 300)
+++ trunk/richfaces/datascroller/src/test/java/org/richfaces/component/DatascrollerComponentTest.java 2007-04-06 11:56:56 UTC (rev 301)
@@ -29,6 +29,7 @@
import javax.faces.component.UIComponent;
import javax.faces.component.UIData;
+import javax.faces.component.UIOutput;
import javax.faces.component.html.HtmlDataTable;
import javax.faces.component.html.HtmlForm;
import java.util.HashSet;
@@ -50,6 +51,12 @@
private UIDatascroller scroller;
private UIComponent form;
private UIData data;
+ private UIOutput first;
+ private UIOutput fastrewind;
+ private UIOutput previous;
+ private UIOutput fastforward;
+ private UIOutput next;
+ private UIOutput last;
/**
* Create the test case
@@ -79,6 +86,32 @@
scroller.setId("dataScroller");
scroller.setFor(data.getId());
+ first = (UIOutput) application.createComponent(UIOutput.COMPONENT_TYPE);
+ first.setId("first");
+ first.setValue("first");
+ fastrewind = (UIOutput) application.createComponent(UIOutput.COMPONENT_TYPE);
+ fastrewind.setId("fastrewind");
+ fastrewind.setValue("fastrewind");
+ previous = (UIOutput) application.createComponent(UIOutput.COMPONENT_TYPE);
+ previous.setId("previous");
+ previous.setValue("previous");
+ fastforward = (UIOutput) application.createComponent(UIOutput.COMPONENT_TYPE);
+ fastforward.setId("fastforward");
+ fastforward.setValue("fastforward");
+ next = (UIOutput) application.createComponent(UIOutput.COMPONENT_TYPE);
+ next.setId("next");
+ next.setValue("next");
+ last = (UIOutput) application.createComponent(UIOutput.COMPONENT_TYPE);
+ last.setId("last");
+ last.setValue("last");
+
+ scroller.getFacets().put(first.getId(), first);
+ scroller.getFacets().put(fastrewind.getId(), fastrewind);
+ scroller.getFacets().put(previous.getId(), previous);
+ scroller.getFacets().put(fastforward.getId(), fastforward);
+ scroller.getFacets().put(next.getId(), next);
+ scroller.getFacets().put(last.getId(), last);
+
form.getChildren().add(scroller);
}
@@ -90,6 +123,12 @@
scroller = null;
form = null;
data = null;
+ first = null;
+ fastrewind = null;
+ previous = null;
+ fastforward = null;
+ next = null;
+ last = null;
}
/**
@@ -106,6 +145,19 @@
assertNotNull(div);
assertEquals("div", div.getNodeName());
+ HtmlElement f1 = page.getHtmlElementById(first.getClientId(facesContext));
+ assertNotNull(f1);
+ HtmlElement f2 = page.getHtmlElementById(last.getClientId(facesContext));
+ assertNotNull(f2);
+ HtmlElement f3 = page.getHtmlElementById(fastforward.getClientId(facesContext));
+ assertNotNull(f3);
+ HtmlElement f4 = page.getHtmlElementById(fastrewind.getClientId(facesContext));
+ assertNotNull(f4);
+ HtmlElement f5 = page.getHtmlElementById(next.getClientId(facesContext));
+ assertNotNull(f5);
+ HtmlElement f6 = page.getHtmlElementById(previous.getClientId(facesContext));
+ assertNotNull(f6);
+
String classAttr = div.getAttributeValue("class");
assertTrue(classAttr.contains("dr-dscr"));
assertTrue(classAttr.contains("rich-datascr"));
More information about the richfaces-svn-commits
mailing list