svn commit: r14381 - trunk/src/app/tests/org/argouml/uml/ui/behavior/collaborations/TestUMLAssociationEndRoleBaseListModel.java

[email protected]
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: tfmorris
Date: 2008-04-18 20:26:17-0700
New Revision: 14381

Modified:
   trunk/src/app/tests/org/argouml/uml/ui/behavior/collaborations/TestUMLAssociationEndRoleBaseListModel.java

Log:
Java 5 and DefaultListModel updates

Modified: trunk/src/app/tests/org/argouml/uml/ui/behavior/collaborations/TestUMLAssociationEndRoleBaseListModel.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/app/tests/org/argouml/uml/ui/behavior/collaborations/TestUMLAssociationEndRoleBaseListModel.java?view=diff&rev=14381&p1=trunk/src/app/tests/org/argouml/uml/ui/behavior/collaborations/TestUMLAssociationEndRoleBaseListModel.java&p2=trunk/src/app/tests/org/argouml/uml/ui/behavior/collaborations/TestUMLAssociationEndRoleBaseListModel.java&r1=14380&r2=14381
==============================================================================
--- trunk/src/app/tests/org/argouml/uml/ui/behavior/collaborations/TestUMLAssociationEndRoleBaseListModel.java	(original)
+++ trunk/src/app/tests/org/argouml/uml/ui/behavior/collaborations/TestUMLAssociationEndRoleBaseListModel.java	2008-04-18 20:26:17-0700
@@ -25,11 +25,10 @@
 package org.argouml.uml.ui.behavior.collaborations;
 
 import java.util.Collection;
-import java.util.Iterator;
 
 import junit.framework.TestCase;
-import org.argouml.model.InitializeModel;
 
+import org.argouml.model.InitializeModel;
 import org.argouml.model.Model;
 import org.argouml.uml.ui.UMLModelElementListModel2;
 
@@ -110,9 +109,8 @@
         Collection connections = Model.getFacade().getConnections(baseAssoc);
         Model.getUmlFactory().delete(baseAssoc);
 
-        Iterator iter = connections.iterator();
-        while (iter.hasNext()) {
-            Model.getUmlFactory().delete(iter.next());
+        for (Object connection : connections) {
+            Model.getUmlFactory().delete(connection);
         }
         connections = null;
 
@@ -128,16 +126,16 @@
         Model.getCollaborationsHelper().setBase(elem, baseEnd);
         Model.getPump().flushModelEvents();
         assertEquals(1, model.getSize());
-        assertEquals(baseEnd, model.getElementAt(0));
+        assertEquals(baseEnd, model.get(0));
     }
 
     /**
      * Testing that we have an empty model to begin with.
      */
     public void testEmpty() {
-        assertEquals(0, model.getSize());
+        assertEquals(0, model.size());
         try {
-            model.getElementAt(0);
+            model.get(0);
             fail();
         } catch (ArrayIndexOutOfBoundsException ex) {
             // This is what we expect.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.