org.apache.jmeter.protocol.http.correlation

## Class Correlation

- java.lang.Object
- - org.apache.jmeter.protocol.http.correlation.Correlation

-     public class Correlation
      extends Object

  Class is being used to find and extract parameters as per the extractor type and perform correlation on parameters.

- - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static void` | `addExtractor(String testName, String extractorTypeClassName, ExtractorData extractor)` Add extractor to current testplan GUI
    `static Map<String,String>` | `createJmxParameterMap(List<HTTPSamplerBase> httpSamplerBaseList, List<HeaderManager> headerManagerList)` Create a map which contain all the parameters from the list of HTTPSamplerBase test elements
    `static Object[][]` | `extractCorrelationCandidates(Map<String,String> firstJmxMap, Map<String,String> secondJmxMap)` Compare the maps to extract the correlation candidate parameters.
    `static void` | `extractParameters(File file)` Compare the list of HTTP-request objects from two TestPlans(one imported and one currently in GUI) and prepare the map containing the parameter list which are candidates for correlation.
    `static int` | `getAddedExtractorCount()`
    `static void` | `setAddedExtractorCount(int addedExtractorCount)`
    `static void` | `updateJxmFileWithExtractors(List<ExtractorData> extractors, Map<String,String> parameterMap)` Update the GUI with all the created extractors present in extractors

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Method Detail

    - #### getAddedExtractorCount

          public static int getAddedExtractorCount()

    - #### setAddedExtractorCount

          public static void setAddedExtractorCount(int addedExtractorCount)

    - #### extractParameters

          public static void extractParameters(File file)
                                        throws IllegalUserActionException

      Compare the list of HTTP-request objects from two TestPlans(one imported and one currently in GUI) and prepare the map containing the parameter list which are candidates for correlation.
      Parameters:
        `file` - JMX file whose parameters need to be extracted
      Throws:
        `IllegalUserActionException` - when cannot correlate script

    - #### createJmxParameterMap

          public static Map<String,String> createJmxParameterMap(List<HTTPSamplerBase> httpSamplerBaseList,
                                                                 List<HeaderManager> headerManagerList)

      Create a map which contain all the parameters from the list of HTTPSamplerBase test elements
      Parameters:
        `httpSamplerBaseList` - List of HTTPSamplerBase Test Elements
        `headerManagerList` - List of HeaderManager Test Elements
      Returns:
        Map with HTTP API parameters (name, value)

    - #### extractCorrelationCandidates

          public static Object[][] extractCorrelationCandidates(Map<String,String> firstJmxMap,
                                                                Map<String,String> secondJmxMap)

      Compare the maps to extract the correlation candidate parameters.
      Parameters:
        `firstJmxMap` - Map for first JMX script
        `secondJmxMap` - Map for second JMX script
      Returns:
        2D array of object containing parameter names and values

    - #### updateJxmFileWithExtractors

          public static void updateJxmFileWithExtractors(List<ExtractorData> extractors,
                                                         Map<String,String> parameterMap)

      Update the GUI with all the created extractors present in extractors
      Parameters:
        `extractors` - list of extractors
        `parameterMap` - Map containing parameter name and values which are a candidate for correlation

    - #### addExtractor

          public static void addExtractor(String testName,
                                          String extractorTypeClassName,
                                          ExtractorData extractor)

      Add extractor to current testplan GUI
      Parameters:
        `testName` - Node's name where the extractor should be added
        `extractorTypeClassName` - Type of extractor to be added
        `extractor` - ExtractorData object

Copyright © 1998-2019 Apache Software Foundation. All Rights Reserved.