String titleValue = "mytitle"; String descriptionValue = "mydescription"; setupFormData(sampler, titleValue, descriptionValue); // Test sending data with default encoding String contentEncoding = ""; sampler.setContentEncoding(contentEncoding); postWriter.setHeaders(connection, sampler); postWriter.sendPostData(connection, sampler); checkContentTypeUrlEncoded(connection);
String titleValue = "mytitle"; String descriptionValue = "mydescription"; setupFormData(sampler, titleValue, descriptionValue); // Test sending data with default encoding String contentEncoding = ""; sampler.setContentEncoding(contentEncoding); postWriter.setHeaders(connection, sampler); postWriter.sendPostData(connection, sampler); checkContentTypeUrlEncoded(connection);
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/test/src/org/apache/jmeter/protocol/http/sampler/PostWriterTest.java File path: /jakarta-jmeter-2.3.2/test/src/org/apache/jmeter/protocol/http/sampler/PostWriterTest.java
Method name: void testSendPostData_NoFilename() Method name: void testSendFormData_Urlencoded()
Number of AST nodes: 8 Number of AST nodes: 8
1
String titleValue = "mytitle";
1
String titleValue = "mytitle";
2
        String descriptionValue = "mydescription";
2
        String descriptionValue = "mydescription";
3
        setupFormData(sampler, titleValue, descriptionValue);
3
        setupFormData(sampler, titleValue, descriptionValue);
4
        // Test sending data with default encoding
4
        // Test sending data with default encoding
5
        String contentEncoding = "";
5
        String contentEncoding = "";
6
        sampler.setContentEncoding(contentEncoding);        
6
        sampler.setContentEncoding(contentEncoding);        
7
        postWriter.setHeaders(connection, sampler);
7
        postWriter.setHeaders(connection, sampler);
8
        postWriter.sendPostData(connection, sampler);
8
        postWriter.sendPostData(connection, sampler);
9
        
9
        
10
        checkContentTypeUrlEncoded(connection);
10
        checkContentTypeUrlEncoded(connection);
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 comparisons64
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements8
    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 1
    Mapped Statements
    ID Statement ID Statement
    2
    String titleValue = "mytitle";
    1
    String titleValue = "mytitle";
    3
    String descriptionValue = "mydescription";
    2
    String descriptionValue = "mydescription";
    4
    setupFormData(sampler, titleValue, descriptionValue);
    3
    setupFormData(sampler, titleValue, descriptionValue);
    5
    String contentEncoding = "";
    4
    String contentEncoding = "";
    6
    sampler.setContentEncoding(contentEncoding);
    5
    sampler.setContentEncoding(contentEncoding);
    7
    postWriter.setHeaders(connection, sampler);
    6
    postWriter.setHeaders(connection, sampler);
    8
    postWriter.sendPostData(connection, sampler);
    7
    postWriter.sendPostData(connection, sampler);
    9
    checkContentTypeUrlEncoded(connection);
    8
    checkContentTypeUrlEncoded(connection);
    Precondition Violations (1)
    Row Violation
    1Clone fragment #1 returns variables contentEncoding , while Clone fragment #2 returns variables titleValue, descriptionValue, contentEncoding