svn commit: r17593 - trunk/src/argouml-app/tests/org/argouml/kernel/TestProjectWithProfiles.java

Luis Sergio Oliveira <[email protected]>
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: euluis
Date: 2009-12-02 15:08:56-0800
New Revision: 17593

Modified:
   trunk/src/argouml-app/tests/org/argouml/kernel/TestProjectWithProfiles.java

Log:
Issue 5862: updated automated test for project loading with removed user defined profile which now checks that correct exception is thrown.

Modified: trunk/src/argouml-app/tests/org/argouml/kernel/TestProjectWithProfiles.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/tests/org/argouml/kernel/TestProjectWithProfiles.java?view=diff&pathrev=17593&r1=17592&r2=17593
==============================================================================
--- trunk/src/argouml-app/tests/org/argouml/kernel/TestProjectWithProfiles.java	(original)
+++ trunk/src/argouml-app/tests/org/argouml/kernel/TestProjectWithProfiles.java	2009-12-02 15:08:56-0800
@@ -1,5 +1,5 @@
 // $Id$
-// Copyright (c) 2007-2008 The Regents of the University of California. All
+// Copyright (c) 2007-2009 The Regents of the University of California. All
 // Rights Reserved. Permission to use, copy, modify, and distribute this
 // software and its documentation without fee, and without a written
 // agreement is hereby granted, provided that the above copyright notice
@@ -41,6 +41,8 @@
 import org.argouml.application.helpers.ApplicationVersion;
 import org.argouml.model.InitializeModel;
 import org.argouml.model.Model;
+import org.argouml.model.XmiReferenceException;
+import org.argouml.model.XmiReferenceRuntimeException;
 import org.argouml.persistence.AbstractFilePersister;
 import org.argouml.persistence.OpenException;
 import org.argouml.persistence.PersistenceManager;
@@ -366,6 +368,10 @@
             fail("Failed to throw exception for missing user defined profile");
         } catch (OpenException e) {
             // Success - expected exception
+            Throwable cause = e.getCause();
+            assertTrue("Cause isn't of one of the expected types.",
+                cause instanceof XmiReferenceRuntimeException
+                || cause instanceof XmiReferenceException);
         }
     }

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

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.