You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@jmeter.apache.org by bu...@apache.org on 2011/11/08 02:23:43 UTC

DO NOT REPLY [Bug 52150] New: FileServer has 3 confusingly similar methods to set the file base

https://issues.apache.org/bugzilla/show_bug.cgi?id=52150

             Bug #: 52150
           Summary: FileServer has 3 confusingly similar methods to set
                    the file base
           Product: JMeter
           Version: 2.5.1
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: Main
        AssignedTo: issues@jmeter.apache.org
        ReportedBy: sebb@apache.org
    Classification: Unclassified


The FileServer class has 3 different methods to set the base.

1) setBase(File jmxBase), which does:
   files.clear();
   base = jmxBase;

2) setBaseDir(String basedir):
   files.clear();
   if (basedir != null) {
       if (basedir is a directory) {
           base = basedir
       } else {
           base = basedir.parent
       }
   }

3) setBaseForScriptFile(File scriptPath)
   files.clear();
   base = scriptPath.parent

1) is only called by RemoteJMeterEngineImpl.rconfigure(), which needs to set
the relative path for use with CSV files.

It's not clear if 2) and 3) are both really needed.

Needs more study to see if the code can be simplified.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

DO NOT REPLY [Bug 52150] FileServer has 3 confusingly similar methods to set the file base

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=52150

--- Comment #3 from Sebb <se...@apache.org> 2011-11-23 22:54:57 UTC ---
The checkForOpenFiles() method does more than its name suggests.

Either we rename the method, or we pull up the files.clear() method into the
calling methods. I think having a separate call to files.clear() would be
better.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

DO NOT REPLY [Bug 52150] FileServer has 3 confusingly similar methods to set the file base

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=52150

Philippe Mouawad <p....@ubik-ingenierie.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Platform|PC                          |All
         OS/Version|Windows XP                  |All

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

DO NOT REPLY [Bug 52150] FileServer has 3 confusingly similar methods to set the file base

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=52150

--- Comment #2 from Philippe Mouawad <p....@ubik-ingenierie.com> 2011-11-12 11:15:04 UTC ---
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

Date: Sat Nov 12 10:14:21 2011
New Revision: 1201240

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

Step 2, facctor common check code

Modified:
   jmeter/trunk/src/core/org/apache/jmeter/services/FileServer.java


Date: Sat Nov 12 11:05:29 2011
New Revision: 1201245

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

Step 3, factor setBase when no null is sure

Modified:
   jmeter/trunk/src/core/org/apache/jmeter/services/FileServer.java

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

DO NOT REPLY [Bug 52150] FileServer has 3 confusingly similar methods to set the file base

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=52150

Sebb <se...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|REOPENED                    |RESOLVED
         Resolution|                            |FIXED

--- Comment #4 from Sebb <se...@apache.org> 2011-11-27 12:05:01 UTC ---
On reflection, files.clear() should only tidy up the hash, so the name is OK.

Added some documentation

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

DO NOT REPLY [Bug 52150] FileServer has 3 confusingly similar methods to set the file base

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=52150

Philippe Mouawad <p....@ubik-ingenierie.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |p.mouawad@ubik-ingenierie.c
                   |                            |om
         Resolution|                            |FIXED

--- Comment #1 from Philippe Mouawad <p....@ubik-ingenierie.com> 2011-11-11 22:10:19 UTC ---
Date: Fri Nov 11 22:09:06 2011
New Revision: 1201070

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

Modified:
   jmeter/trunk/src/core/org/apache/jmeter/services/FileServer.java
   jmeter/trunk/test/src/org/apache/jmeter/services/TestFileServer.java
   jmeter/trunk/xdocs/changes.xml

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

DO NOT REPLY [Bug 52150] FileServer has 3 confusingly similar methods to set the file base

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=52150

Philippe Mouawad <p....@ubik-ingenierie.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|FIXED                       |

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.