svn commit: r18630 - trunk/src/argouml-core-model/tests/org/argouml/model/TestXmi.java

[email protected]
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: linus
Date: 2010-08-07 23:46:36-0700
New Revision: 18630

Modified:
   trunk/src/argouml-core-model/tests/org/argouml/model/TestXmi.java

Log:
Factored out the test of setIgnoredElements and getIgnoredElements to a separate test.

Modified: trunk/src/argouml-core-model/tests/org/argouml/model/TestXmi.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-model/tests/org/argouml/model/TestXmi.java?view=diff&pathrev=18630&r1=18629&r2=18630
==============================================================================
--- trunk/src/argouml-core-model/tests/org/argouml/model/TestXmi.java	(original)
+++ trunk/src/argouml-core-model/tests/org/argouml/model/TestXmi.java	2010-08-07 23:46:36-0700
@@ -70,6 +70,31 @@
     }
 
     /**
+     * Test the set and get of IgnoredElements.
+     */
+    public void testIgnoredElements() {
+        assertEquals("Ignored elements array not correct length", 0, 
+                xmiReader.getIgnoredElements().length);
+
+        xmiReader.setIgnoredElements(new String[] {"foo"});
+        assertEquals("Ignored elements array not correct length", 1, 
+                xmiReader.getIgnoredElements().length);
+
+        xmiReader.setIgnoredElements(new String[] {});
+        assertEquals("Ignored elements array not correct length", 0, 
+                xmiReader.getIgnoredElements().length);
+
+        xmiReader.setIgnoredElements(new String[] {"foo", "bar"});
+        assertEquals("Ignored elements array not correct length", 2, 
+                xmiReader.getIgnoredElements().length);
+
+        xmiReader.setIgnoredElements(null);
+        assertEquals("Ignored elements array not correct length", 0, 
+                xmiReader.getIgnoredElements().length);
+    }
+    
+    
+    /**
      * Test the XMI reader.
      * 
      * @throws IOException If we couldn't open the file
@@ -80,8 +105,7 @@
         assertEquals("Wrong tag", "XMI", xmiReader.getTagName());
         String[] ignoredElements = new String[] {"foo"};
         xmiReader.setIgnoredElements(ignoredElements);
-        assertEquals("Ignored elements array not correct length", 1, 
-                xmiReader.getIgnoredElements().length);
+
         assertEquals("Ignored elements count not zero", 0, 
                 xmiReader.getIgnoredElementCount());

------------------------------------------------------
http://argouml.tigris.org/ds/viewMessage.do?dsForumId=5905&dsMessageId=2644160

To unsubscribe from this discussion, e-mail: [[email protected]].
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.