HTTPSamplerBase config = new HTTPNullSampler(); config.setProtocol("http"); config.setMethod(HTTPSamplerBase.GET); config.addArgument("param1", "value1"); config.setPath("/index.html?p1=p2"); config.setDomain("www.apache.org"); assertEquals("http://www.apache.org/index.html?param1=value1&p1=p2", config.getUrl().toString());
HTTPSamplerBase config = new HTTPNullSampler(); config.setProtocol("http"); config.setMethod(HTTPSamplerBase.GET); config.parseArguments("param1"); config.setPath("/index.html"); config.setDomain("www.apache.org"); assertEquals("http://www.apache.org/index.html?param1", config.getUrl().toString());
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/test/src/org/apache/jmeter/protocol/http/sampler/TestHTTPSamplers.java File path: /jakarta-jmeter-2.3.2/test/src/org/apache/jmeter/protocol/http/sampler/TestHTTPSamplers.java
Method name: void testMakingUrl2() Method name: void testMakingUrl9()
Number of AST nodes: 7 Number of AST nodes: 7
1
HTTPSamplerBase config = new HTTPNullSampler();
1
HTTPSamplerBase config = new HTTPNullSampler();
2
            config.setProtocol("http");
2
            config.setProtocol("http");
3
            config.setMethod(HTTPSamplerBase.GET);
3
            config.setMethod(HTTPSamplerBase.GET);
4
            config.addArgument("param1", "value1");
4
            config.parseArguments("param1");
5
            config.setPath("/index.html?p1=p2");
5
            config.setPath("/index.html");
6
            config.setDomain("www.apache.org");
6
            config.setDomain("www.apache.org");
7
            assertEquals("http://www.apache.org/index.html?param1=value1&p1=p2", config.getUrl().toString());
7
            assertEquals("http://www.apache.org/index.html?param1", config.getUrl().toString());
Summary
Number of common nesting structure subtrees1
Number of refactorable cases0
Number of non-refactorable cases1
Time elapsed for finding largest common nesting structure subtrees (ms)0.0
Clones locationClones are declared in the same class
Number of node comparisons49
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements7
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)0.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    HTTPSamplerBase config = new HTTPNullSampler();
    1
    HTTPSamplerBase config = new HTTPNullSampler();
    2
    config.setProtocol("http");
    2
    config.setProtocol("http");
    3
    config.setMethod(HTTPSamplerBase.GET);
    3
    config.setMethod(HTTPSamplerBase.GET);
    4
    config.addArgument("param1", "value1");
    4
    config.addArgument("param1", "value1");
    4
    config.parseArguments("param1");
    Differences
    Expression1Expression2Difference
    addArgumentparseArgumentsMETHOD_INVOCATION_NAME_MISMATCH
    config.addArgument("param1","value1")config.parseArguments("param1")ARGUMENT_NUMBER_MISMATCH
    Preondition Violations
    Expression config.addArgument("param1","value1") cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression config.parseArguments("param1") cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression config.addArgument("param1","value1") is a void method call, and thus it cannot be parameterized
    Expression config.parseArguments("param1") is a void method call, and thus it cannot be parameterized
    Expression config.addArgument("param1","value1") cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression config.parseArguments("param1") cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression config.addArgument("param1","value1") is a void method call, and thus it cannot be parameterized
    Expression config.parseArguments("param1") is a void method call, and thus it cannot be parameterized
    4
    config.parseArguments("param1");
    5
    config.setPath("/index.html?p1=p2");
    5
    config.setPath("/index.html?p1=p2");
    5
    config.setPath("/index.html");
    Differences
    Expression1Expression2Difference
    "/index.html?p1=p2""/index.html"LITERAL_VALUE_MISMATCH
    5
    config.setPath("/index.html");
    6
    config.setDomain("www.apache.org");
    6
    config.setDomain("www.apache.org");
    7
    assertEquals("http://www.apache.org/index.html?param1=value1&p1=p2", config.getUrl().toString());
    7
    assertEquals("http://www.apache.org/index.html?param1=value1&p1=p2", config.getUrl().toString());
    7
    assertEquals("http://www.apache.org/index.html?param1", config.getUrl().toString());
    Differences
    Expression1Expression2Difference
    "http://www.apache.org/index.html?param1=value1&p1=p2""http://www.apache.org/index.html?param1"LITERAL_VALUE_MISMATCH
    7
    assertEquals("http://www.apache.org/index.html?param1", config.getUrl().toString());
    Precondition Violations (8)
    Row Violation
    1Expression config.addArgument("param1","value1") cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression config.parseArguments("param1") cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression config.addArgument("param1","value1") is a void method call, and thus it cannot be parameterized
    4Expression config.parseArguments("param1") is a void method call, and thus it cannot be parameterized
    5Expression config.addArgument("param1","value1") cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Expression config.parseArguments("param1") cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Expression config.addArgument("param1","value1") is a void method call, and thus it cannot be parameterized
    8Expression config.parseArguments("param1") is a void method call, and thus it cannot be parameterized