jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pmoua...@apache.org
Subject svn commit: r1201238 - in /jmeter/trunk: src/core/org/apache/jmeter/gui/ src/core/org/apache/jmeter/services/ src/core/org/apache/jmeter/testelement/ src/reports/org/apache/jmeter/gui/ src/reports/org/apache/jmeter/testelement/ test/src/org/apache/jmet...
Date Sat, 12 Nov 2011 10:10:19 GMT
Author: pmouawad
Date: Sat Nov 12 10:10:18 2011
New Revision: 1201238

URL: http://svn.apache.org/viewvc?rev=1201238&view=rev
Log:
Bug 52150 - FileServer has 3 confusingly similar methods to set the file base

Step 1, make all methods use same exception for same cause (replace IOException by IllegalStateException)
and impact callers.

Modified:
    jmeter/trunk/src/core/org/apache/jmeter/gui/GuiPackage.java
    jmeter/trunk/src/core/org/apache/jmeter/services/FileServer.java
    jmeter/trunk/src/core/org/apache/jmeter/testelement/TestPlan.java
    jmeter/trunk/src/reports/org/apache/jmeter/gui/ReportGuiPackage.java
    jmeter/trunk/src/reports/org/apache/jmeter/testelement/ReportPlan.java
    jmeter/trunk/test/src/org/apache/jmeter/services/TestFileServer.java

Modified: jmeter/trunk/src/core/org/apache/jmeter/gui/GuiPackage.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/gui/GuiPackage.java?rev=1201238&r1=1201237&r2=1201238&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/gui/GuiPackage.java (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/gui/GuiPackage.java Sat Nov 12 10:10:18 2011
@@ -646,7 +646,7 @@ public final class GuiPackage implements
 
         try {
             FileServer.getFileServer().setBasedir(testPlanFile);
-        } catch (IOException e1) {
+        } catch (IllegalStateException e1) {
             log.error("Failure setting file server's base dir", e1);
         }
     }

Modified: jmeter/trunk/src/core/org/apache/jmeter/services/FileServer.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/services/FileServer.java?rev=1201238&r1=1201237&r2=1201238&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/services/FileServer.java (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/services/FileServer.java Sat Nov 12 10:10:18 2011
@@ -110,11 +110,11 @@ public class FileServer {
      * Normally the provided path is a file, so using the parent directory is appropriate.
      * 
      * @param basedir the path to set, or {@code null} if the GUI is being cleared
-     * @throws IOException if there is a problem resolving the file name
+     * @throws IllegalStateException if files are still open
      */
-    public synchronized void setBasedir(String basedir) throws IOException {
+    public synchronized void setBasedir(String basedir) {
         if (filesOpen()) {
-            throw new IOException("Files are still open, cannot change base directory");
+            throw new IllegalStateException("Files are still open, cannot change base directory");
         }
         files.clear();
         if (basedir != null) {

Modified: jmeter/trunk/src/core/org/apache/jmeter/testelement/TestPlan.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/testelement/TestPlan.java?rev=1201238&r1=1201237&r2=1201238&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/testelement/TestPlan.java (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/testelement/TestPlan.java Sat Nov 12 10:10:18
2011
@@ -303,7 +303,7 @@ public class TestPlan extends AbstractTe
         if (getBasedir() != null && getBasedir().length() > 0) {
             try {
                 FileServer.getFileServer().setBasedir(FileServer.getFileServer().getBaseDir()
+ getBasedir());
-            } catch (IOException e) {
+            } catch (IllegalStateException e) {
                 log.error("Failed to set file server base dir with " + getBasedir(), e);
             }
         }

Modified: jmeter/trunk/src/reports/org/apache/jmeter/gui/ReportGuiPackage.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/reports/org/apache/jmeter/gui/ReportGuiPackage.java?rev=1201238&r1=1201237&r2=1201238&view=diff
==============================================================================
--- jmeter/trunk/src/reports/org/apache/jmeter/gui/ReportGuiPackage.java (original)
+++ jmeter/trunk/src/reports/org/apache/jmeter/gui/ReportGuiPackage.java Sat Nov 12 10:10:18
2011
@@ -601,7 +601,7 @@ public final class ReportGuiPackage impl
         ReportGuiPackage.getInstance().getMainFrame().setExtendedFrameTitle(reportPlanFile);
         try {
             FileServer.getFileServer().setBasedir(reportPlanFile);
-        } catch (IOException e1) {
+        } catch (IllegalStateException e1) {
             log.error("Failure setting file server's base dir", e1);
         }
     }

Modified: jmeter/trunk/src/reports/org/apache/jmeter/testelement/ReportPlan.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/reports/org/apache/jmeter/testelement/ReportPlan.java?rev=1201238&r1=1201237&r2=1201238&view=diff
==============================================================================
--- jmeter/trunk/src/reports/org/apache/jmeter/testelement/ReportPlan.java (original)
+++ jmeter/trunk/src/reports/org/apache/jmeter/testelement/ReportPlan.java Sat Nov 12 10:10:18
2011
@@ -208,7 +208,7 @@ public class ReportPlan extends Abstract
         if (getBasedir() != null && getBasedir().length() > 0) {
             try {
                 FileServer.getFileServer().setBasedir(FileServer.getFileServer().getBaseDir()
+ getBasedir());
-            } catch (IOException e) {
+            } catch (IllegalStateException e) {
                 log.error("Failed to set file server base dir with " + getBasedir(), e);
             }
         }

Modified: jmeter/trunk/test/src/org/apache/jmeter/services/TestFileServer.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/test/src/org/apache/jmeter/services/TestFileServer.java?rev=1201238&r1=1201237&r2=1201238&view=diff
==============================================================================
--- jmeter/trunk/test/src/org/apache/jmeter/services/TestFileServer.java (original)
+++ jmeter/trunk/test/src/org/apache/jmeter/services/TestFileServer.java Sat Nov 12 10:10:18
2011
@@ -95,8 +95,8 @@ public class TestFileServer extends JMet
         assertEquals("a1,b1,c1,d1",FS.readLine(infile));
         try {
             FS.setBasedir("x");
-            fail("Expected IOException");
-        } catch (IOException ignored){
+            fail("Expected IllegalStateException");
+        } catch (IllegalStateException ignored){
         }
         FS.closeFile(infile);
         FS.setBasedir("y");



Mime
View raw message