click-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bck...@apache.org
Subject svn commit: r961613 - in /click/trunk/click/extras/test/org/apache/click/extras: control/ tree/ util/
Date Thu, 08 Jul 2010 07:41:19 GMT
Author: bckfnn
Date: Thu Jul  8 07:41:18 2010
New Revision: 961613

URL: http://svn.apache.org/viewvc?rev=961613&view=rev
Log:
generics. CLK-696

Modified:
    click/trunk/click/extras/test/org/apache/click/extras/control/CheckListTest.java
    click/trunk/click/extras/test/org/apache/click/extras/control/ColorPickerTest.java
    click/trunk/click/extras/test/org/apache/click/extras/control/CountryFieldTest.java
    click/trunk/click/extras/test/org/apache/click/extras/control/FormTableTest.java
    click/trunk/click/extras/test/org/apache/click/extras/control/HiddenListTest.java
    click/trunk/click/extras/test/org/apache/click/extras/control/NumberFieldTest.java
    click/trunk/click/extras/test/org/apache/click/extras/tree/TreeTest.java
    click/trunk/click/extras/test/org/apache/click/extras/util/ExtrasClickUtilsTest.java

Modified: click/trunk/click/extras/test/org/apache/click/extras/control/CheckListTest.java
URL: http://svn.apache.org/viewvc/click/trunk/click/extras/test/org/apache/click/extras/control/CheckListTest.java?rev=961613&r1=961612&r2=961613&view=diff
==============================================================================
--- click/trunk/click/extras/test/org/apache/click/extras/control/CheckListTest.java (original)
+++ click/trunk/click/extras/test/org/apache/click/extras/control/CheckListTest.java Thu Jul
 8 07:41:18 2010
@@ -19,7 +19,6 @@
 package org.apache.click.extras.control;
 
 import java.util.ArrayList;
-import java.util.Iterator;
 import java.util.List;
 
 import org.apache.click.control.Option;
@@ -37,7 +36,7 @@ public class CheckListTest extends TestC
     public void testSortOptions() {
         CheckList cL = new CheckList();
         int[] in = {1,2,3,4,5,6};
-        List oL = createOptionsList(in);
+        List<Option> oL = createOptionsList(in);
 
         cL.setOptionList(oL);
         int[] sort = {6,4,2,1,3,5};
@@ -68,8 +67,8 @@ public class CheckListTest extends TestC
         return ret;
     }
     
-    private List createOptionsList(int[] values) {
-        List ret = new ArrayList();
+    private List<Option> createOptionsList(int[] values) {
+        List<Option> ret = new ArrayList<Option>();
         for(int i=0; i<values.length; i++) {
             String value = Integer.toString(values[i]);
             String label = "Label: "+i;
@@ -78,15 +77,14 @@ public class CheckListTest extends TestC
         return ret;
     }
     
-    private void compareOptions(int[] values,List options) {
+    private void compareOptions(int[] values, List<Option> options) {
         assertNotNull(options);
         String demanded ="";
         String given = "";
         for(int i=0;i<values.length;i++) {
             demanded += values[i]+",";
         }
-        for (Iterator it = options.iterator(); it.hasNext(); ) {
-            Option opt = (Option) it.next();
+        for (Option opt : options) {
             assertNotNull(opt);
             given += opt.getValue()+",";
         }

Modified: click/trunk/click/extras/test/org/apache/click/extras/control/ColorPickerTest.java
URL: http://svn.apache.org/viewvc/click/trunk/click/extras/test/org/apache/click/extras/control/ColorPickerTest.java?rev=961613&r1=961612&r2=961613&view=diff
==============================================================================
--- click/trunk/click/extras/test/org/apache/click/extras/control/ColorPickerTest.java (original)
+++ click/trunk/click/extras/test/org/apache/click/extras/control/ColorPickerTest.java Thu
Jul  8 07:41:18 2010
@@ -51,7 +51,7 @@ public class ColorPickerTest extends Tes
     public void testValidate() {
         MockContext mockContext = MockContext.initContext();
         MockRequest mr = mockContext.getMockRequest();
-        Map paras = mr.getParameterMap();
+        Map<String, Object> paras = mr.getParameterMap();
         
         ColorPicker cp = new ColorPicker("color");
         

Modified: click/trunk/click/extras/test/org/apache/click/extras/control/CountryFieldTest.java
URL: http://svn.apache.org/viewvc/click/trunk/click/extras/test/org/apache/click/extras/control/CountryFieldTest.java?rev=961613&r1=961612&r2=961613&view=diff
==============================================================================
--- click/trunk/click/extras/test/org/apache/click/extras/control/CountryFieldTest.java (original)
+++ click/trunk/click/extras/test/org/apache/click/extras/control/CountryFieldTest.java Thu
Jul  8 07:41:18 2010
@@ -39,14 +39,14 @@ public class CountryFieldTest extends Te
      * CLK-458
      */
     public void testDuplicateCountries() {
-        MockContext mockContext = MockContext.initContext();
+        MockContext.initContext();
 
         CountrySelect countrySelect = new CountrySelect("select");
         countrySelect.bindRequestValue();
-        List countries = countrySelect.getOptionList();
-        Iterator it = countries.iterator();
+        List<?> countries = countrySelect.getOptionList();
+        Iterator<?> it = countries.iterator();
         
-        Set uniqueChecker = new HashSet();
+        Set<String> uniqueChecker = new HashSet<String>();
         while(it.hasNext()) {
             Option option = (Option) it.next();
             

Modified: click/trunk/click/extras/test/org/apache/click/extras/control/FormTableTest.java
URL: http://svn.apache.org/viewvc/click/trunk/click/extras/test/org/apache/click/extras/control/FormTableTest.java?rev=961613&r1=961612&r2=961613&view=diff
==============================================================================
--- click/trunk/click/extras/test/org/apache/click/extras/control/FormTableTest.java (original)
+++ click/trunk/click/extras/test/org/apache/click/extras/control/FormTableTest.java Thu Jul
 8 07:41:18 2010
@@ -19,10 +19,13 @@
 package org.apache.click.extras.control;
 
 import java.util.List;
+
 import junit.framework.TestCase;
+
 import org.apache.click.MockContext;
 import org.apache.click.Page;
 import org.apache.click.control.Form;
+import org.apache.click.element.Element;
 import org.apache.click.util.PageImports;
 
 public class FormTableTest extends TestCase {
@@ -41,8 +44,8 @@ public class FormTableTest extends TestC
         FormTable table = new FormTable("table");
 
         pageImports.processControl(table);
-        List headElements = pageImports.getHeadElements();
-        List jsElements = pageImports.getJsElements();
+        List<Element> headElements = pageImports.getHeadElements();
+        List<Element> jsElements = pageImports.getJsElements();
 
         assertTrue(headElements.get(0).toString().contains("/table.css"));
         assertTrue(headElements.get(1).toString().contains("/control.css"));

Modified: click/trunk/click/extras/test/org/apache/click/extras/control/HiddenListTest.java
URL: http://svn.apache.org/viewvc/click/trunk/click/extras/test/org/apache/click/extras/control/HiddenListTest.java?rev=961613&r1=961612&r2=961613&view=diff
==============================================================================
--- click/trunk/click/extras/test/org/apache/click/extras/control/HiddenListTest.java (original)
+++ click/trunk/click/extras/test/org/apache/click/extras/control/HiddenListTest.java Thu
Jul  8 07:41:18 2010
@@ -54,7 +54,7 @@ public class HiddenListTest extends Test
         hiddenList.addValue("B");
         hiddenList.addValue("C");
         
-        List valueObject = (List) hiddenList.getValueObject();
+        List<?> valueObject = (List<?>) hiddenList.getValueObject();
         assertEquals(3, valueObject.size());
         assertEquals("A", valueObject.get(0));
         assertEquals("B", valueObject.get(1));
@@ -64,14 +64,14 @@ public class HiddenListTest extends Test
     public void testSetValueObject() {
         HiddenList hiddenList = new HiddenList("hiddenList");
         
-        List valueObject = new ArrayList();
+        List<String> valueObject = new ArrayList<String>();
         valueObject.add("A");
         valueObject.add("B");
         valueObject.add("C");
         
         hiddenList.setValueObject(valueObject);
         
-        List values = hiddenList.getValues();
+        List<String> values = hiddenList.getValues();
         assertEquals(3, values.size());
         assertEquals("A", values.get(0));
         assertEquals("B", values.get(1));

Modified: click/trunk/click/extras/test/org/apache/click/extras/control/NumberFieldTest.java
URL: http://svn.apache.org/viewvc/click/trunk/click/extras/test/org/apache/click/extras/control/NumberFieldTest.java?rev=961613&r1=961612&r2=961613&view=diff
==============================================================================
--- click/trunk/click/extras/test/org/apache/click/extras/control/NumberFieldTest.java (original)
+++ click/trunk/click/extras/test/org/apache/click/extras/control/NumberFieldTest.java Thu
Jul  8 07:41:18 2010
@@ -31,11 +31,13 @@ public class NumberFieldTest extends Tes
 
     Locale defaultLocale;
 
+    @Override
     protected void setUp() throws Exception {
         defaultLocale = Locale.getDefault();
         Locale.setDefault(Locale.US);
     }
 
+    @Override
     protected void tearDown() throws Exception {
         Locale.setDefault(defaultLocale);
     }
@@ -108,7 +110,7 @@ public class NumberFieldTest extends Tes
     public void testOnProcess() {
         MockContext mockContext = MockContext.initContext(Locale.US);
         MockRequest req = mockContext.getMockRequest();
-        Map params = req.getParameterMap();
+        Map<String, Object> params = req.getParameterMap();
         
         NumberField engF = new NumberField("en");
         engF.setPattern("#,##0.00");
@@ -151,7 +153,7 @@ public class NumberFieldTest extends Tes
     public void testValidate() {
         MockContext mockContext = MockContext.initContext(Locale.US);
         MockRequest req = mockContext.getMockRequest();
-        Map params = req.getParameterMap();
+        Map<String, Object> params = req.getParameterMap();
         
         NumberField engF = new NumberField("en");
         engF.setPattern("0");

Modified: click/trunk/click/extras/test/org/apache/click/extras/tree/TreeTest.java
URL: http://svn.apache.org/viewvc/click/trunk/click/extras/test/org/apache/click/extras/tree/TreeTest.java?rev=961613&r1=961612&r2=961613&view=diff
==============================================================================
--- click/trunk/click/extras/test/org/apache/click/extras/tree/TreeTest.java (original)
+++ click/trunk/click/extras/test/org/apache/click/extras/tree/TreeTest.java Thu Jul  8 07:41:18
2010
@@ -35,12 +35,14 @@ public class TreeTest extends TestCase {
     private String[] testIds;
     private MockContext mockContext;
 
+    @Override
     public void setUp() throws Exception {
         mockContext = MockContext.initContext();
         buildTree();
         buildTestIds();
     }
     
+    @Override
     public void tearDown() throws Exception {
         tree = null;
     }
@@ -82,7 +84,7 @@ public class TreeTest extends TestCase {
         //nodeId '3.1' should be invisible because its parent 'three' is not expanded,
         //thus only node 'one' and 'three' should be returned.
         boolean includeInvisibleNodes = false;
-        List result = tree.getSelectedNodes(includeInvisibleNodes);
+        List<TreeNode> result = tree.getSelectedNodes(includeInvisibleNodes);
         assertEquals(2, result.size());
         
         //now check if all values are selected
@@ -105,7 +107,7 @@ public class TreeTest extends TestCase {
         //nodeId '3.1' should be invisible because its parent 'three' is not expanded,
         //thus only node 'one' and 'three' should be returned.
         boolean includeInvisibleNodes = false;
-        List result = tree.getExpandedNodes(includeInvisibleNodes);
+        List<TreeNode> result = tree.getExpandedNodes(includeInvisibleNodes);
         
         //rootnode is expanded by default.
         //Result below should be 2 because 3.1 is collapsed hiding 3.1.1 which is expanded

Modified: click/trunk/click/extras/test/org/apache/click/extras/util/ExtrasClickUtilsTest.java
URL: http://svn.apache.org/viewvc/click/trunk/click/extras/test/org/apache/click/extras/util/ExtrasClickUtilsTest.java?rev=961613&r1=961612&r2=961613&view=diff
==============================================================================
--- click/trunk/click/extras/test/org/apache/click/extras/util/ExtrasClickUtilsTest.java (original)
+++ click/trunk/click/extras/test/org/apache/click/extras/util/ExtrasClickUtilsTest.java Thu
Jul  8 07:41:18 2010
@@ -186,7 +186,7 @@ public class ExtrasClickUtilsTest extend
         form.copyFrom(user, true);
         assertEquals("NSW", codeField.getValueObject());
         
-        Map map = new HashMap();
+        Map<String, Object> map = new HashMap<String, Object>();
         map.put("name", "malcolm");
         form = new Form();
         TextField nameField2 = new TextField("name");



Mime
View raw message