public void process() {
   JMeterVariables vars = JMeterContextService.getContext().getVariables();
   String threadId = vars.getObject(THREAD_ID).toString();
   SampleResult previousResult = JMeterContextService.getContext().getPreviousResult();
   Map<String, String> map = (Map<String, String>) vars.getObject(mapName);
   map.put(threadId, previousResult.getResponseDataAsString());
 }
コード例 #2
0
ファイル: RegexExtractor.java プロジェクト: zioda/Lab7ORW
 private String getInputString(SampleResult result) {
   String inputString =
       useUrl()
           ? result.getUrlAsString() // Bug 39707
           : useHeaders()
               ? result.getResponseHeaders()
               : useRequestHeaders()
                   ? result.getRequestHeaders()
                   : useCode()
                       ? result.getResponseCode() // Bug 43451
                       : useMessage()
                           ? result.getResponseMessage() // Bug 43451
                           : useUnescapedBody()
                               ? StringEscapeUtils.unescapeHtml4(result.getResponseDataAsString())
                               : useBodyAsDocument()
                                   ? Document.getTextFromDocument(result.getResponseData())
                                   : result.getResponseDataAsString() // Bug 36898
       ;
   if (log.isDebugEnabled()) {
     log.debug("Input = " + inputString);
   }
   return inputString;
 }