incubator-adffaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From awi...@apache.org
Subject svn commit: r430818 [9/9] - in /incubator/adffaces/trunk/trinidad: trinidad-api/src/main/java/org/apache/myfaces/trinidad/bean/util/ trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/ trinidad-api/src/test/java/org/apache/myfaces/trinida...
Date Fri, 11 Aug 2006 16:25:11 GMT
Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/test/java/org/apache/myfaces/trinidadinternal/renderkit/TestScript.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/test/java/org/apache/myfaces/trinidadinternal/renderkit/TestScript.java?rev=430818&r1=430817&r2=430818&view=diff
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/test/java/org/apache/myfaces/trinidadinternal/renderkit/TestScript.java
(original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/test/java/org/apache/myfaces/trinidadinternal/renderkit/TestScript.java
Fri Aug 11 09:24:50 2006
@@ -29,10 +29,8 @@
 import javax.faces.component.UIComponent;
 import javax.faces.context.FacesContext;
 import javax.faces.el.ValueBinding;
-import javax.servlet.http.HttpServletRequest;
 import org.apache.myfaces.trinidad.component.UIXCollection;
 import org.apache.myfaces.trinidad.model.SortCriterion;
-import org.apache.myfaces.trinidadinternal.ui.UIConstants;
 
 import org.apache.myfaces.trinidad.context.Agent;
 
@@ -66,7 +64,7 @@
     return _definition;
   }
 
-  public List getTests()
+  public List<Test> getTests()
   {
     return _tests;
   }
@@ -104,37 +102,40 @@
       _messages.put(clientId, new FacesMessage(sev, summary, detail));
     }
 
+    @Override
     public void apply(FacesContext context, UIComponent component)
     {
       // first, cleanup any messages left over from a previous test
       // ((MFacesContext) context).clearMessages();
 
       // Add any messages needed to run this suite of tests
-      Iterator messageIds = _messages.keySet().iterator();
+      Iterator<String> messageIds = _messages.keySet().iterator();
       while (messageIds.hasNext())
       {
-        String id = (String) messageIds.next();
-        FacesMessage fm = (FacesMessage) _messages.get(id);
+        String id = messageIds.next();
+        FacesMessage fm = _messages.get(id);
         context.addMessage(id, fm);
       }
     }
 
+    @Override
     public boolean shouldMatchBase()
     {
       return true;
     }
 
+    @Override
     public String toString()
     {
       StringBuffer sb = new StringBuffer(100);
       sb.append(" MessageTest[ ");
 
       boolean gotFirst = false;
-      Iterator messageIds = _messages.keySet().iterator();
+      Iterator<String> messageIds = _messages.keySet().iterator();
       while (messageIds.hasNext())
       {
-        String id = (String) messageIds.next();
-        FacesMessage fm = (FacesMessage) _messages.get(id);
+        String id = messageIds.next();
+        FacesMessage fm = _messages.get(id);
 
         // Severity toString() implementation is different in the
         // RI and MyFaces;  in the RI it's "name ordinal",
@@ -158,7 +159,8 @@
       return sb.toString();
     }
 
-    private Map _messages = new LinkedHashMap();
+    private Map<String, FacesMessage> _messages = 
+      new LinkedHashMap<String, FacesMessage>();
   }
 
   static public class AttributeTest extends Test
@@ -200,16 +202,18 @@
       _delegateTests.add(delegateTest);
     }
 
+    @SuppressWarnings("unchecked")
+    @Override
     public void apply(FacesContext context, UIComponent component)
     {
-      Iterator tests = _delegateTests.iterator();
+      Iterator<Test> tests = _delegateTests.iterator();
       
       if (_testComponentId != null)
         component = component.findComponent(_testComponentId); 
       
       while (tests.hasNext())
       {
-        Test test = (Test) tests.next();
+        Test test = tests.next();
         test.apply(context, component);
       }
       
@@ -220,7 +224,7 @@
       if ("tableSortCriteria".equals(_name))
       {
         UIXCollection tableModel = (UIXCollection)  component;
-        List sortCriteriaList = new ArrayList();
+        List<SortCriterion> sortCriteriaList = new ArrayList<SortCriterion>();
         String sortCriterion = (String) _value;
         Boolean isAscending  = 
            new Boolean(sortCriterion.substring(sortCriterion.indexOf(" ")).trim());
@@ -248,6 +252,7 @@
       }
     }
 
+    @Override
     public boolean shouldMatchBase()
     {
       return _matchesBase;
@@ -263,6 +268,7 @@
       return _value;
     }
     
+    @Override
     public String toString()
     {
       String valStr;
@@ -304,7 +310,7 @@
       {
         StringBuffer buffer = new StringBuffer();
         buffer.append("AttributeTest[" + _name + "," + valStr);
-        Iterator tests = _delegateTests.iterator();
+        Iterator<Test> tests = _delegateTests.iterator();
         while (tests.hasNext())
         {
           buffer.append(',');
@@ -316,15 +322,15 @@
       }
     }
 
-    private String _name;
-    private Object _value;
-    private String _testComponentId;
-    private boolean _matchesBase;
-    private List    _delegateTests = new ArrayList();
+    private String     _name;
+    private Object     _value;
+    private String     _testComponentId;
+    private boolean    _matchesBase;
+    private List<Test> _delegateTests = new ArrayList<Test>();
   }
 
-  private Set  _agentTypes = new HashSet();
-  private List _tests = new ArrayList();
+  private Set<Object>         _agentTypes = new HashSet<Object>();
+  private List<Test>          _tests      = new ArrayList<Test>();
   private ComponentDefinition _definition;
   
 }

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/test/java/org/apache/myfaces/trinidadinternal/renderkit/TestScriptParser.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/test/java/org/apache/myfaces/trinidadinternal/renderkit/TestScriptParser.java?rev=430818&r1=430817&r2=430818&view=diff
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/test/java/org/apache/myfaces/trinidadinternal/renderkit/TestScriptParser.java
(original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/test/java/org/apache/myfaces/trinidadinternal/renderkit/TestScriptParser.java
Fri Aug 11 09:24:50 2006
@@ -67,6 +67,7 @@
     _info   = info;
   }
 
+  @Override
   public void startElement(
     ParseContext context,
     String       namespaceURI,
@@ -102,6 +103,7 @@
     return null;
   }
 
+  @Override
   public NodeParser startChildElement(
     ParseContext context,
     String       namespaceURI,
@@ -114,6 +116,8 @@
     return createTestParser(_componentInfo, localName, null);
   }
 
+  @Override
+  @SuppressWarnings("unchecked")
   public void addCompletedChild(
     ParseContext context,
     String       namespaceURI,
@@ -122,11 +126,12 @@
   {
     if (child instanceof TestScript.Test)
     {
-      _script.getTests().add(child);
+      _script.getTests().add((TestScript.Test)child);
     }
     else if (child instanceof List)
     {
-      Iterator iter = ((List) child).iterator();
+      Iterator<TestScript.Test> iter = 
+        ((List<TestScript.Test>) child).iterator();
       while (iter.hasNext())
       {
         _script.getTests().add(iter.next());
@@ -155,7 +160,7 @@
       _info   = info;
     }
 
-
+    @Override
     public void startElement(
       ParseContext context,
       String       namespaceURI,
@@ -189,6 +194,7 @@
          "true".equals(attrs.getValue(NAMESPACE, "usesUpload")));
     }
 
+    @Override
     public NodeParser startChildElement(
       ParseContext context,
       String       namespaceURI,
@@ -216,6 +222,7 @@
        }
     }
 
+    @Override
     public void addCompletedChild(
     ParseContext context,
     String       namespaceURI,
@@ -224,11 +231,12 @@
   {
     if (child instanceof TestScript.Test)
     {
-      _script.getTests().add(child);
+      _script.getTests().add((TestScript.Test)child);
     }
   }
 
 
+    @Override
     public Object endElement(
       ParseContext context,
       String       namespaceURI,
@@ -252,6 +260,7 @@
       _componentId = componentId;
     }
 
+    @Override
     public void startElement(
       ParseContext context,
       String       namespaceURI,
@@ -278,6 +287,7 @@
                                            _componentId);
     }
 
+    @Override
     public NodeParser startChildElement(
       ParseContext context,
       String       namespaceURI,
@@ -289,6 +299,7 @@
       return null;
     }
 
+    @Override
     public void addCompletedChild(
       ParseContext context,
       String       namespaceURI,
@@ -301,6 +312,7 @@
       }
     }
 
+    @Override
     public Object endElement(
       ParseContext context,
       String       namespaceURI,
@@ -322,7 +334,7 @@
       _componentInfo = info;
     }
 
-
+    @Override
     public void startElement(
       ParseContext context,
       String       namespaceURI,
@@ -354,6 +366,7 @@
       }
     }
 
+    @Override
     public NodeParser startChildElement(
       ParseContext context,
       String       namespaceURI,
@@ -363,6 +376,8 @@
       return createTestParser(_componentInfo, localName, null);
     }
 
+    @SuppressWarnings("unchecked")
+    @Override
     public void addCompletedChild(
       ParseContext context,
       String       namespaceURI,
@@ -371,22 +386,24 @@
     {
       if (child instanceof TestScript.Test)
       {
-        _childTests.add(child);
+        _childTests.add((TestScript.Test)child);
       }
       else if (child instanceof List)
       {
-        _childTests.addAll((List) child);
+        _childTests.addAll((List<TestScript.Test>) child);
       }
     }
 
+    @Override
     public Object endElement(
       ParseContext context,
       String       namespaceURI,
       String       localName) throws SAXParseException
     {
-      ArrayList allTests = new ArrayList();
+      ArrayList<TestScript.AttributeTest> allTests = 
+        new ArrayList<TestScript.AttributeTest>();
 
-      Iterator values = _propertyInfo.enumValues.iterator();
+      Iterator<Object> values = _propertyInfo.enumValues.iterator();
       while (values.hasNext())
       {
         Object value = values.next();
@@ -394,10 +411,10 @@
         allTests.add(new TestScript.AttributeTest(_name,
                                                   value,
                                                   isDefault));
-        Iterator childTests = _childTests.iterator();
+        Iterator<TestScript.Test> childTests = _childTests.iterator();
         while (childTests.hasNext())
         {
-          TestScript.Test childTest = (TestScript.Test) childTests.next();
+          TestScript.Test childTest = childTests.next();
           allTests.add(new TestScript.AttributeTest(_name,
                                                     value,
                                                     isDefault,
@@ -412,7 +429,7 @@
     private FacesConfigInfo.PropertyInfo    _propertyInfo;
     private String _name;
     private Object _defaultValue;
-    private List _childTests = new ArrayList();
+    private List<TestScript.Test> _childTests = new ArrayList<TestScript.Test>();
   }
 
   private class JavascriptTestParser extends BaseNodeParser
@@ -422,17 +439,17 @@
       _componentInfo = info;
     }
 
-
+    @Override
     public void startElement(
       ParseContext context,
       String       namespaceURI,
       String       localName,
       Attributes   attrs) throws SAXParseException
     {
-      Iterator properties = _componentInfo.properties.keySet().iterator();
+      Iterator<String> properties = _componentInfo.properties.keySet().iterator();
       while (properties.hasNext())
       {
-        String name = (String) properties.next();
+        String name = properties.next();
         if (name.startsWith("on"))
         {
           _tests.add(new TestScript.AttributeTest(name, null, false));
@@ -440,6 +457,7 @@
       }
     }
 
+    @Override
     public Object endElement(
       ParseContext context,
       String       namespaceURI,
@@ -449,7 +467,8 @@
     }
 
     private FacesConfigInfo.ComponentInfo   _componentInfo;
-    private List _tests = new ArrayList();
+    private List<TestScript.AttributeTest> _tests = 
+      new ArrayList<TestScript.AttributeTest>();
   }
 
   private class BooleanTestParser extends BaseNodeParser
@@ -459,7 +478,7 @@
       _componentInfo = info;
     }
 
-
+    @Override
     public void startElement(
       ParseContext context,
       String       namespaceURI,
@@ -497,6 +516,7 @@
 
     }
 
+    @Override
     public NodeParser startChildElement(
       ParseContext context,
       String       namespaceURI,
@@ -506,6 +526,8 @@
       return createTestParser(_componentInfo, localName, null);
     }
 
+    @SuppressWarnings("unchecked")
+    @Override
     public void addCompletedChild(
       ParseContext context,
       String       namespaceURI,
@@ -514,15 +536,15 @@
     {
       if (child instanceof TestScript.Test)
       {
-        _childTests.add(child);
+        _childTests.add((TestScript.Test)child);
       }
       else if (child instanceof List)
       {
-        _childTests.addAll((List) child);
+        _childTests.addAll((List<TestScript.Test>) child);
       }
     }
 
-
+    @Override
     public Object endElement(
       ParseContext context,
       String       namespaceURI,
@@ -538,10 +560,10 @@
       boolean matchesBase = (value == _defaultValue);
       Boolean valueObj    = value ? Boolean.TRUE : Boolean.FALSE;
       _tests.add(new TestScript.AttributeTest(_name, valueObj, matchesBase));
-      Iterator iter = _childTests.iterator();
+      Iterator<TestScript.Test> iter = _childTests.iterator();
       while (iter.hasNext())
       {
-        TestScript.Test test = (TestScript.Test) iter.next();
+        TestScript.Test test = iter.next();
         // Don't bother testing and re-testing that an attribute
         // matches the base in all sorts of combos;  keep it simple!
         if (matchesBase)
@@ -557,8 +579,8 @@
     private String _name;
     private boolean _defaultValue;
     private FacesConfigInfo.ComponentInfo   _componentInfo;
-    private List _tests = new ArrayList();
-    private List _childTests = new ArrayList();
+    private List<TestScript.Test> _tests = new ArrayList<TestScript.Test>();
+    private List<TestScript.Test> _childTests = new ArrayList<TestScript.Test>();
   }
 
   private class MessageParser extends BaseNodeParser
@@ -568,6 +590,7 @@
       _componentInfo = info;
     }
 
+    @Override
     public void startElement(
       ParseContext context,
       String       namespaceURI,
@@ -594,7 +617,7 @@
                                          clientId);
       }
 
-
+    @Override
     public Object endElement(
       ParseContext context,
       String       namespaceURI,
@@ -603,7 +626,10 @@
       return _test;
     }
 
-    private FacesConfigInfo.ComponentInfo   _componentInfo;
+    // -= Simon Lessard =- 
+    // TODO: Never read locally as of 2006-08-09. Delete whenever 
+    //       this attribute prove to be useless.
+    //private FacesConfigInfo.ComponentInfo _componentInfo;
     private TestScript.Test _test;
   }
 

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/test/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/table/TableSelectOneRendererTest.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/test/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/table/TableSelectOneRendererTest.java?rev=430818&r1=430817&r2=430818&view=diff
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/test/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/table/TableSelectOneRendererTest.java
(original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/test/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/table/TableSelectOneRendererTest.java
Fri Aug 11 09:24:50 2006
@@ -46,11 +46,13 @@
     super(testName);
   }
   
+  @Override
   public void setUp()
   {
     super.setUp();
   }
   
+  @Override
   public void tearDown()
   {
     super.tearDown();
@@ -123,7 +125,7 @@
     table.setRowIndex(expectedSelectedIndex);
     RowKeySet state = table.getSelectedRowKeys();
     assertTrue("row is selected", state.isContained());
-    Iterator selection = state.iterator();
+    Iterator<Object> selection = state.iterator();
     // make sure there is exactly one selected item:
     assertTrue("has one selected item", selection.hasNext());
     selection.next();
@@ -147,7 +149,7 @@
       String selectedParam = table.getCurrencyString();
       table.setRowIndex(oldIndex);
 
-      Map requestParams = new HashMap(2);
+      Map<String, String> requestParams = new HashMap<String, String>(2);
       String selectionParam =
         TableSelectOneRenderer.__getSelectionParameterName(facesContext, table);
       requestParams.put(selectionParam, selectedParam);
@@ -174,6 +176,7 @@
       setDisclosedRowKeys(new RowKeySetImpl());
     }
 
+    @Override
     public void queueEvent(FacesEvent event)
     {
       this.event = event;

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/test/java/org/apache/myfaces/trinidadinternal/renderkit/testData/Person.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/test/java/org/apache/myfaces/trinidadinternal/renderkit/testData/Person.java?rev=430818&r1=430817&r2=430818&view=diff
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/test/java/org/apache/myfaces/trinidadinternal/renderkit/testData/Person.java
(original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/test/java/org/apache/myfaces/trinidadinternal/renderkit/testData/Person.java
Fri Aug 11 09:24:50 2006
@@ -29,11 +29,11 @@
        return _name;
      }
      
-     public List getKids()
+     public List<Person> getKids()
      {
        return _kids;
      }
      
      private final String _name;
-     private final List _kids = new ArrayList();
+     private final List<Person> _kids = new ArrayList<Person>();
  }

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/test/java/org/apache/myfaces/trinidadinternal/uinode/nav/GoButtonFacesBeanTest.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/test/java/org/apache/myfaces/trinidadinternal/uinode/nav/GoButtonFacesBeanTest.java?rev=430818&r1=430817&r2=430818&view=diff
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/test/java/org/apache/myfaces/trinidadinternal/uinode/nav/GoButtonFacesBeanTest.java
(original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/test/java/org/apache/myfaces/trinidadinternal/uinode/nav/GoButtonFacesBeanTest.java
Fri Aug 11 09:24:50 2006
@@ -45,11 +45,13 @@
     super(testName);
   }
 
+  @Override
   public void setUp()
   {
     super.setUp();
   }
   
+  @Override
   public void tearDown()
   {
     super.tearDown();

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/test/java/org/apache/myfaces/trinidadinternal/util/SubKeyMapTest.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/test/java/org/apache/myfaces/trinidadinternal/util/SubKeyMapTest.java?rev=430818&r1=430817&r2=430818&view=diff
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/test/java/org/apache/myfaces/trinidadinternal/util/SubKeyMapTest.java
(original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/test/java/org/apache/myfaces/trinidadinternal/util/SubKeyMapTest.java
Fri Aug 11 09:24:50 2006
@@ -30,7 +30,7 @@
 
   public void testSubKey()
   {
-    HashMap base = new HashMap();
+    HashMap<String, Object> base = new HashMap<String, Object>();
     SubKeyMap one = new SubKeyMap(base, "one");
     SubKeyMap two = new SubKeyMap(base, "two");
 
@@ -56,16 +56,16 @@
     assertTrue(two.isEmpty());
   }
 
-
+  @Override
   protected boolean supportsNullKeys()
   {
     return false;
   }
 
-
-  protected Map createMap()
+  @Override
+  protected Map<String, Object> createMap()
   {
-    HashMap base = new HashMap();
+    HashMap<String, Object> base = new HashMap<String, Object>();
 
     // Make sure we're not fooled by pre-existing contents
     base.put("something", "here");

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/test/java/org/apache/myfaces/trinidadinternal/validator/ByteLengthValidatorTest.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/test/java/org/apache/myfaces/trinidadinternal/validator/ByteLengthValidatorTest.java?rev=430818&r1=430817&r2=430818&view=diff
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/test/java/org/apache/myfaces/trinidadinternal/validator/ByteLengthValidatorTest.java
(original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/test/java/org/apache/myfaces/trinidadinternal/validator/ByteLengthValidatorTest.java
Fri Aug 11 09:24:50 2006
@@ -40,11 +40,13 @@
     super(name);
   }
   
+  @Override
   public void setUp()
   {
     super.setUp();
   }
   
+  @Override
   public void tearDown()
   {
     super.tearDown();



Mime
View raw message