Author: abelevich
Date: 2008-11-28 05:55:19 -0500 (Fri, 28 Nov 2008)
New Revision: 11425
Modified:
trunk/ui/combobox/src/test/java/org/richfaces/component/ComboBoxComponentTest.java
trunk/ui/combobox/src/test/java/org/richfaces/renderkit/ComboBoxRendererTest.java
Log:
clear
Modified:
trunk/ui/combobox/src/test/java/org/richfaces/component/ComboBoxComponentTest.java
===================================================================
---
trunk/ui/combobox/src/test/java/org/richfaces/component/ComboBoxComponentTest.java 2008-11-28
10:54:49 UTC (rev 11424)
+++
trunk/ui/combobox/src/test/java/org/richfaces/component/ComboBoxComponentTest.java 2008-11-28
10:55:19 UTC (rev 11425)
@@ -39,17 +39,22 @@
import org.richfaces.component.UIComboBox;
import com.gargoylesoftware.htmlunit.html.HtmlElement;
+import com.gargoylesoftware.htmlunit.html.HtmlLink;
import com.gargoylesoftware.htmlunit.html.HtmlPage;
import com.gargoylesoftware.htmlunit.html.HtmlScript;
+/**
+ * @author Anton Belevich
+ *
+ */
public class ComboBoxComponentTest extends AbstractAjax4JsfTestCase {
UIComboBox comboBox;
UIForm form;
String suggestions =
"Alabama,Alaska,Arizona,Arkansas,California,Colorado,Connecticut,Delaware,Florida,Massachusetts,Michigan,Georgia,Hawaii,Idaho,Indiana,Iowa,Kansas,Kentucky,Louisiana,Maine,Minnesota,Mississippi,Missouri,Montana,Nebraska";
- List selectItems = new ArrayList();
+ List <SelectItem >selectItems = new ArrayList<SelectItem>();
- private static Set javaScripts = new HashSet();
+ private static Set <String> javaScripts = new HashSet <String>();
static {
javaScripts.add("org.ajax4jsf.javascript.PrototypeScript");
@@ -114,7 +119,7 @@
public void testComboBoxStyles() throws Exception {
HtmlPage page = renderView();
assertNotNull(page);
- List links = page.getDocumentElement().getHtmlElementsByTagName("link");
+ List <HtmlLink> links =
page.getDocumentHtmlElement().getHtmlElementsByTagName("link");
if (links.size() == 0) {
fail();
}
@@ -128,13 +133,13 @@
HtmlPage page = renderView();
assertNotNull(page);
- List scripts = page.getDocumentElement().getHtmlElementsByTagName("script");
- for (Iterator it = scripts.iterator(); it.hasNext();) {
- HtmlScript item = (HtmlScript) it.next();
+ List <HtmlScript> scripts =
page.getDocumentHtmlElement().getHtmlElementsByTagName("script");
+ for (Iterator <HtmlScript> it = scripts.iterator(); it.hasNext();) {
+ HtmlScript item = it.next();
String srcAttr = item.getSrcAttribute();
if (StringUtils.isNotBlank(srcAttr)) {
boolean found = false;
- for (Iterator srcIt = javaScripts.iterator(); srcIt.hasNext();) {
+ for (Iterator <String> srcIt = javaScripts.iterator(); srcIt.hasNext();) {
String src = (String) srcIt.next();
found = srcAttr.contains(src);
if (found) {
@@ -147,7 +152,6 @@
}
public void tearDown() throws Exception {
- // TODO Auto-generated method stub
form = null;
comboBox = null;
super.tearDown();
Modified:
trunk/ui/combobox/src/test/java/org/richfaces/renderkit/ComboBoxRendererTest.java
===================================================================
---
trunk/ui/combobox/src/test/java/org/richfaces/renderkit/ComboBoxRendererTest.java 2008-11-28
10:54:49 UTC (rev 11424)
+++
trunk/ui/combobox/src/test/java/org/richfaces/renderkit/ComboBoxRendererTest.java 2008-11-28
10:55:19 UTC (rev 11425)
@@ -25,7 +25,6 @@
import java.util.Iterator;
import java.util.List;
-import javax.faces.component.UIComponent;
import javax.faces.component.UISelectItem;
import javax.faces.model.SelectItem;
@@ -43,15 +42,13 @@
*/
public class ComboBoxRendererTest extends AbstractAjax4JsfTestCase {
- private UIComponent form;
private UIComboBox comboBox1;
private UIComboBox comboBox2;
String suggestions =
"Alabama,Alaska,Arizona,Arkansas,California,Colorado,Connecticut,Delaware,Florida,Massachusetts,Michigan,Georgia,Hawaii,Idaho,Indiana,Iowa,Kansas,Kentucky,Louisiana,Maine,Minnesota,Mississippi,Missouri,Montana,Nebraska";
- List selectItems = new ArrayList();
+ List <SelectItem> selectItems = new ArrayList <SelectItem>();
public void setUp() throws Exception {
super.setUp();
-
comboBox1 = (UIComboBox)
application.createComponent("org.richfaces.ComboBox");
comboBox1.setSuggestionValues(Arrays.asList(suggestions.split(",")));
selectItems.add(new SelectItem("District of Columbia"));