https://bz.apache.org/bugzilla/show_bug.cgi?id=61306

            Bug ID: 61306
           Summary: Refactoring SampleResult
           Product: JMeter
           Version: 3.0
          Hardware: PC
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: Main
          Assignee: [email protected]
          Reporter: [email protected]
  Target Milestone: ---

Hello everyone.
I was analyzing the modularization of some classes, and I identified that the
class SampleResult has an opportunity for cohesion improvement. 
The class SaveService was in the same situation and the problem was solved as
follows: The OldSaveService class was created, and several get() and set()
methods that were used only to configure the class parameters were moved from
SaveService to OldSaveService. 
The new class was then accessed through an instance variable in SaveService.
This strategy has cleaned and improved SaveService cohesion.
With this in mind, I would recommend creating a new class: SampleResultConfig ,
and moving the following methods:

setDataEncoding
setRequestHeaders
setTimeStamp
setResultFileName
setThreadName
getEndTime
getBodySize
getSampleLabel
setStampAndTime
getLatency
setLatency
getConnectTime
getThreadName
setResponseHeaders
setResponseCode
getResponseMessage
setResponseMessage
getUrlAsString
getSampleLabel
setTimes
getContentType
setSaveConfig
setStartNextThreadLoop
getResultFileName
getResponseData
setDataType
getTime
getAssertionResults
getAllThreads
getResponseDataAsString
getSubResults
setSampleCount
getSamplerData
setSuccessful
setResponseMessageOK
getStartTime
setBodySize
setAllThreads
setStopThread
getURL
getDataEncodingNoDefault
getBytes
setEndTime
setStopTestNow
getErrorCount
setSamplerData
setContentType
getGroupThreads
setResponseData
getSaveConfig
setResponseData
setMonitor
getParent
getDataType
setStopTest
setBytes
getResponseCode
setStartTime
getResponseHeaders
setErrorCount
setSampleLabel
setEncodingAndType
setHeadersSize
getSearchableTokens
setResponseCodeOK
getSampleCount
setURL
setGroupThreads
getDataEncodingWithDefault
getIdleTime
getRequestHeaders
getDataEncodingWithDefault
setConnectTime
setResponseOK
getMediaType
getHeadersSize
getTimeStamp
setParent
setIdleTime

from the SampleResult.
Those parameters accessed by an instance variable in the SampleResult.
Moreover, the orthogonality is the design would be enhanced.

What do you think about that?

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to