Author: abelevich
Date: 2007-07-02 12:36:02 -0400 (Mon, 02 Jul 2007)
New Revision: 1436
Modified:
trunk/sandbox/scrollable-grid/src/test/java/org/richfaces/renderkit/html/ScrollableGridRendererTest.java
Log:
fix test class
Modified:
trunk/sandbox/scrollable-grid/src/test/java/org/richfaces/renderkit/html/ScrollableGridRendererTest.java
===================================================================
---
trunk/sandbox/scrollable-grid/src/test/java/org/richfaces/renderkit/html/ScrollableGridRendererTest.java 2007-07-02
16:32:19 UTC (rev 1435)
+++
trunk/sandbox/scrollable-grid/src/test/java/org/richfaces/renderkit/html/ScrollableGridRendererTest.java 2007-07-02
16:36:02 UTC (rev 1436)
@@ -152,54 +152,71 @@
if(elem.getNodeName().equals("div")){
String elemClassAttr = elem.getAttributeValue("class");
- assertTrue(elemClassAttr.contains("ClientUI_InlineBox"));
- boolean templates = elem.getId().equals(grid.getId()+ "_GridBodyTemplate")
|| elem.getId().equals(grid.getId()+ "_GridFooterTemplate") ||
elem.getId().equals(grid.getId()+ "_GridHeaderTemplate");
- assertTrue(templates);
- Iterator divIter = elem.getChildElementsIterator();
- HtmlElement inDiv = (HtmlElement) divIter.next();
- assertNotNull(inDiv);
- assertEquals("div", inDiv.getNodeName());
+ res = false;
+ if(elemClassAttr.contains("ClientUI_InlineBox")){
+ res = true;
+ }else if(elemClassAttr.contains("ClientUI_Grid_HSplit")){
+ res = true;
+ }
+ assertTrue(res);
- Iterator spanIter = inDiv.getChildElementsIterator();
+ if(!elemClassAttr.contains("ClientUI_Grid_HSplit")){
+
+ boolean templates = elem.getId().equals(grid.getId()+ "_GridBodyTemplate")
|| elem.getId().equals(grid.getId()+ "_GridFooterTemplate") ||
elem.getId().equals(grid.getId()+ "_GridHeaderTemplate");
+ assertTrue(templates);
+
+ Iterator divIter = elem.getChildElementsIterator();
+ HtmlElement inDiv = (HtmlElement) divIter.next();
+ assertNotNull(inDiv);
+ assertEquals("div", inDiv.getNodeName());
+
+ Iterator spanIter = inDiv.getChildElementsIterator();
- for (;spanIter.hasNext();) {
+ for (;spanIter.hasNext();) {
- HtmlElement span = (HtmlElement) spanIter.next();
- assertNotNull(span);
- assertEquals("span", span.getNodeName());
- elemClassAttr = span.getAttributeValue("class");
- assertNotNull(elemClassAttr);
+ HtmlElement element = (HtmlElement) spanIter.next();
+ assertNotNull(element);
+ res = false;
+ if(element.getNodeName().equals("span")){
+ res = true;
+
+ }else{
+ if(element.getNodeName().equals("div")){
+ String divId = element.getAttributeValue("id");
+ assertEquals(id + ":sb", divId);
+ res = true;
+ }
+ }
+
+ assertTrue(res);
+ elemClassAttr = element.getAttributeValue("class");
+ assertNotNull(elemClassAttr);
- if(span.getId().contains("FrozenBox")){
- assertTrue(elemClassAttr.contains("ClientUI_TmplBox
ClientUI_FrozenBox"));
- }else if(span.getId().contains("NormalBox")){
- assertTrue(elemClassAttr.contains("ClientUI_TmplBox
ClientUI_NormalBox"));
- }
+ if(element.getId().contains("FrozenBox")){
+ assertTrue(elemClassAttr.contains("ClientUI_TmplBox
ClientUI_FrozenBox"));
+ }else if(element.getId().contains("NormalBox")){
+ assertTrue(elemClassAttr.contains("ClientUI_TmplBox
ClientUI_NormalBox"));
+ }
- for (int i = 0; i < columns; i++) {
+ for (int i = 0; i < columns; i++) {
- HtmlElement hcell = page.getHtmlElementById(id + ":hc_" + i);
- assertNotNull(hcell);
- elemClassAttr = hcell.getAttributeValue("class");
- assertTrue(elemClassAttr.contains("ClientUI_Grid_HC Idg-header-cell"));
+ HtmlElement hcell = page.getHtmlElementById(id + ":hc_" + i);
+ assertNotNull(hcell);
+ elemClassAttr = hcell.getAttributeValue("class");
+ assertTrue(elemClassAttr.contains("ClientUI_Grid_HC Idg-header-cell"));
- for (int j = 0; j < grid.getRows(); j++) {
- HtmlElement bcell = page.getHtmlElementById(id + ":c_" + j +
"_" + i);
- assertNotNull(bcell);
- elemClassAttr = bcell.getAttributeValue("class");
- assertTrue(elemClassAttr.contains("ClientUI_Grid_BC Idg-column-cell"));
+ for (int j = 0; j < grid.getRows(); j++) {
+ HtmlElement bcell = page.getHtmlElementById(id + ":c_" + j +
"_" + i);
+ assertNotNull(bcell);
+ elemClassAttr = bcell.getAttributeValue("class");
+ assertTrue(elemClassAttr.contains("ClientUI_Grid_BC
Idg-column-cell"));
+ }
}
-
}
-
}
-
}
-
}
-
}
-
}
Show replies by date