svn commit: r13689 - trunk/tests/org/argouml/ui/GUITestProjectBrowser.java

[email protected]
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: euluis
Date: 2007-10-24 14:14:09-0700
New Revision: 13689

Modified:
   trunk/tests/org/argouml/ui/GUITestProjectBrowser.java

Log:
Fixing errors in the GUITestProjectBrowser test cases.

Modified: trunk/tests/org/argouml/ui/GUITestProjectBrowser.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/tests/org/argouml/ui/GUITestProjectBrowser.java?view=diff&rev=13689&p1=trunk/tests/org/argouml/ui/GUITestProjectBrowser.java&p2=trunk/tests/org/argouml/ui/GUITestProjectBrowser.java&r1=13688&r2=13689
==============================================================================
--- trunk/tests/org/argouml/ui/GUITestProjectBrowser.java	(original)
+++ trunk/tests/org/argouml/ui/GUITestProjectBrowser.java	2007-10-24 14:14:09-0700
@@ -31,6 +31,7 @@
 import junit.framework.TestCase;
 import org.argouml.model.InitializeModel;
 
+import org.argouml.cognitive.ui.ToDoPane;
 import org.argouml.kernel.Project;
 import org.argouml.kernel.ProjectManager;
 import org.argouml.model.Model;
@@ -49,6 +50,8 @@
  */
 public class GUITestProjectBrowser extends TestCase {
 
+    private static final String GURKBURK = "Gurkburk";
+
     /**
      * Constructor.
      *
@@ -64,6 +67,9 @@
     public void setUp() throws Exception {
 	super.setUp();
         InitializeModel.initializeDefault();
+        SplashScreen splashScreen = new SplashScreen();
+        assertNotNull(ProjectBrowser.makeInstance(splashScreen, 
+                true, new ToDoPane(splashScreen)));
     }
 
     /**
@@ -71,7 +77,6 @@
      * Also test that everything is set up properly within the object.
      */
     public void testConstruction() {
-	assertNotNull(ProjectBrowser.getInstance());
 	ProjectBrowser pb = ProjectBrowser.getInstance();
 	assertNotNull(pb.getLocale());
 	assertNotNull(pb.getAppName());
@@ -88,8 +93,8 @@
     public void testAppName() {
 	ProjectBrowser pb = ProjectBrowser.getInstance();
 
-	pb.setAppName("Gurkburk");
-	assertEquals("Gurkburk", pb.getAppName());
+	pb.setAppName(GURKBURK);
+	assertEquals(GURKBURK, pb.getAppName());
     }
 
     /**
@@ -162,6 +167,8 @@
 
         Model.getPump().flushModelEvents();
 
+        pb.setAppName(GURKBURK);
+
         tm.setTarget(diagram1);
         assertTrue("Title should contain diagram1 name", 
                 pb.getTitle().indexOf(diagram1.getName()) != -1);
@@ -171,7 +178,7 @@
                 pb.getTitle().indexOf(diagram2.getName()) != -1);
         
         assertTrue("Title should contain application name", 
-                pb.getTitle().indexOf("Gurkburk") != -1);
+                pb.getTitle().indexOf(GURKBURK) != -1);
 
         assertTrue("Title should contain *", 
                 pb.getTitle().indexOf("*") != -1);
@@ -180,7 +187,7 @@
         a.putValue("non-interactive", Boolean.TRUE);
         a.actionPerformed(null);
         
-        assertTrue("Title should not contain *", 
-                pb.getTitle().indexOf("*") == -1);
+        assertTrue("Title should contain *", 
+                pb.getTitle().indexOf("*") != -1);
     }
 }
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.