Author: scooter
Date: 2011-06-15 15:58:50 -0700 (Wed, 15 Jun 2011)
New Revision: 25772

Modified:
   
cytoscape/trunk/application/src/test/java/cytoscape/plugin/DownloadableInfoTest.java
   
cytoscape/trunk/application/src/test/java/cytoscape/plugin/PluginFileReaderTest.java
   
cytoscape/trunk/application/src/test/java/cytoscape/plugin/PluginPropertiesTest.java
Log:
Fix tests that leave random cytoscape.version values laying around


Modified: 
cytoscape/trunk/application/src/test/java/cytoscape/plugin/DownloadableInfoTest.java
===================================================================
--- 
cytoscape/trunk/application/src/test/java/cytoscape/plugin/DownloadableInfoTest.java
        2011-06-15 21:59:36 UTC (rev 25771)
+++ 
cytoscape/trunk/application/src/test/java/cytoscape/plugin/DownloadableInfoTest.java
        2011-06-15 22:58:50 UTC (rev 25772)
@@ -125,6 +125,7 @@
         * Test method for {@link 
cytoscape.plugin.DownloadableInfo#setCytoscapeVersion(java.lang.String)}.
         */
        public void testCytoscapeVersion() {
+               String currentVersion = cytoscape.CytoscapeVersion.version;
                cytoscape.CytoscapeVersion.version = "2.5";
 
                di.addCytoscapeVersion("2.5");
@@ -139,6 +140,7 @@
                //di.addCytoscapeVersion("2.5.6");
                //assertTrue(di.containsVersion("2.5.6"));
                //assertEquals(di.getCytoscapeVersion(), "2.5.6");
+               cytoscape.CytoscapeVersion.version = currentVersion;
        }
 
        /**
@@ -203,6 +205,8 @@
        
          /** test for bug #... */
          public void testPluginCompatible() {
+                       String currentVersion = 
cytoscape.CytoscapeVersion.version;
+
                  // at each version level (major, minor, bugfix)
                  cytoscape.CytoscapeVersion.version = "3.6";
                  di.addCytoscapeVersion("2.1");
@@ -217,6 +221,8 @@
 
                  di.addCytoscapeVersion("2.6.1");
                  assertTrue(di.isPluginCompatibleWithCurrent());
+
+                       cytoscape.CytoscapeVersion.version = currentVersion;
          }
 
        

Modified: 
cytoscape/trunk/application/src/test/java/cytoscape/plugin/PluginFileReaderTest.java
===================================================================
--- 
cytoscape/trunk/application/src/test/java/cytoscape/plugin/PluginFileReaderTest.java
        2011-06-15 21:59:36 UTC (rev 25771)
+++ 
cytoscape/trunk/application/src/test/java/cytoscape/plugin/PluginFileReaderTest.java
        2011-06-15 22:58:50 UTC (rev 25772)
@@ -131,12 +131,14 @@
     assertNotNull(reader.getPlugins());
     assertEquals(reader.getPlugins().size(), 10);
 
+               String cytoscapeVersion = cytoscape.CytoscapeVersion.version;
     cytoscape.CytoscapeVersion.version = "2.3.3";
     int count = 0;
     for (DownloadableInfo info: reader.getPlugins()) {
       if (info.isPluginCompatibleWithCurrent()) count ++;
     }
   assertEquals(count, 2);
+               cytoscape.CytoscapeVersion.version = cytoscapeVersion;;
   }
 
   // regression test to insure themes work as expected

Modified: 
cytoscape/trunk/application/src/test/java/cytoscape/plugin/PluginPropertiesTest.java
===================================================================
--- 
cytoscape/trunk/application/src/test/java/cytoscape/plugin/PluginPropertiesTest.java
        2011-06-15 21:59:36 UTC (rev 25771)
+++ 
cytoscape/trunk/application/src/test/java/cytoscape/plugin/PluginPropertiesTest.java
        2011-06-15 22:58:50 UTC (rev 25772)
@@ -40,9 +40,11 @@
        //}
 
        public void testMatchingCyVersion() throws 
cytoscape.plugin.ManagerException {
+               String currentVersion = 
cytoscape.CytoscapeInit.getProperties().getProperty("cytoscape.version.number");
                
cytoscape.CytoscapeInit.getProperties().setProperty("cytoscape.version.number", 
"2.3.3");
                PluginInfo info = pp.fillPluginInfoObject(null);
                assertNotNull(info);
+               
cytoscape.CytoscapeInit.getProperties().setProperty("cytoscape.version.number", 
currentVersion);
        }
 
 

-- 
You received this message because you are subscribed to the Google Groups 
"cytoscape-cvs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/cytoscape-cvs?hl=en.

Reply via email to