Author: F.antonov
Date: 2007-05-03 10:32:10 -0400 (Thu, 03 May 2007)
New Revision: 635
Modified:
trunk/richfaces/menu-components/src/test/java/org/richfaces/component/MenuItemComponentTest.java
Log:
Test cases correction.
Modified:
trunk/richfaces/menu-components/src/test/java/org/richfaces/component/MenuItemComponentTest.java
===================================================================
---
trunk/richfaces/menu-components/src/test/java/org/richfaces/component/MenuItemComponentTest.java 2007-05-03
14:28:05 UTC (rev 634)
+++
trunk/richfaces/menu-components/src/test/java/org/richfaces/component/MenuItemComponentTest.java 2007-05-03
14:32:10 UTC (rev 635)
@@ -58,7 +58,7 @@
private static Set javaScripts = new HashSet();
static {
- javaScripts.add("prototype.js");
+ javaScripts.add("PrototypeScript");
javaScripts.add("AjaxScript");
javaScripts.add("CommandScript");
}
@@ -102,7 +102,7 @@
* MenuItem rendering test.
*/
public void testMenuItemRender() throws Exception {
- menuItem.setSubmitMode(MenuComponent.MODE_NONE);
+ menuItem.setMode(MenuComponent.MODE_NONE);
HtmlPage page = renderView();
assertNotNull(page);
// System.out.println(page.asXml());
@@ -191,7 +191,7 @@
public void testEnabledMenuItemServerMode() throws Exception {
assertEquals(false, menuItem.isDisabled());
menuItem.getAttributes().put("iconClass", "iconClass");
- menuItem.setSubmitMode(MenuComponent.MODE_SERVER);
+ menuItem.setMode(MenuComponent.MODE_SERVER);
menuItem.getAttributes().put("target", "target");
menuItem.getAttributes().put("selectStyle",
"menuItemSelectStyle");
HtmlPage page = renderView();
@@ -201,7 +201,7 @@
.getClientId(facesContext)
+ ":anchor");
assertNotNull(anchor);
- assertEquals("a", anchor.getNodeName());
+ assertEquals("span", anchor.getNodeName());
String classAttr = anchor.getAttributeValue("class");
assertTrue(classAttr.contains("rich-menu-item-label"));
@@ -233,7 +233,7 @@
* Test for enabled MenuItem component in "ajax" mode.
*/
public void testEnabledMenuItemAJAXMode() throws Exception {
- menuItem.setSubmitMode(MenuComponent.MODE_AJAX);
+ menuItem.setMode(MenuComponent.MODE_AJAX);
menuItem.getAttributes().put("style", "menuItemStyle");
HtmlPage page = renderView();
assertNotNull(page);
@@ -251,7 +251,7 @@
* Test for enabled MenuItem component in "none" mode.
*/
public void testEnabledMenuItemNoneMode() throws Exception {
- menuItem.setSubmitMode(MenuComponent.MODE_NONE);
+ menuItem.setMode(MenuComponent.MODE_NONE);
HtmlPage page = renderView();
assertNotNull(page);
// System.out.println(page.asXml());
@@ -274,7 +274,7 @@
assertNotNull(links);
HtmlElement link = (HtmlElement) links.get(0);
assertTrue(link.getAttributeValue("href").contains(
- "org/richfaces/renderkit/html/css/menucomponents.xcss"));
+ "menucomponents.xcss"));
}
/**
@@ -312,7 +312,7 @@
public void testMenuItemDoDecodeAJAXMode() throws Exception {
menuItem.setImmediate(true);
- menuItem.setSubmitMode(MenuComponent.MODE_AJAX);
+ menuItem.setMode(MenuComponent.MODE_AJAX);
externalContext.getRequestParameterMap().put(
menuItem.getClientId(facesContext), "Action");
@@ -331,7 +331,7 @@
public void testMenuItemDoDecodeServerMode() throws Exception {
menuItem.setImmediate(false);
- menuItem.setSubmitMode(MenuComponent.MODE_SERVER);
+ menuItem.setMode(MenuComponent.MODE_SERVER);
externalContext.getRequestParameterMap().put(
menuItem.getClientId(facesContext) + ":hidden",
"Action");
@@ -366,16 +366,17 @@
public void testRenderImages() throws Exception {
renderView();
InternetResourceBuilder builder = ResourceBuilderImpl.getInstance();
- InternetResource resource = builder.createResource(null,
MenuItemBackground.class.getName());
+ InternetResource resource = builder.createResource(null,
+ MenuItemBackground.class.getName());
assertNotNull(resource);
String uri = "http:" + resource.getUri(facesContext, null);
Page page = webClient.getPage(uri);
assertTrue(page.getWebResponse().getStatusCode() == HttpServletResponse.SC_OK);
ImageInfo info = new ImageInfo();
info.setInput(page.getWebResponse().getContentAsStream());
- //image recognizable?
+ // image recognizable?
assertTrue(info.check());
assertEquals(ImageInfo.FORMAT_GIF, info.getFormat());
}
-
+
}
Show replies by date