FileRowColContainer f = new FileRowColContainer("testfiles/test.csv", ","); assertNotNull(f); assertTrue("Not empty", f.getSize() > 0); int myRow = f.nextRow(); assertEquals(0, myRow); assertEquals("a1", f.getColumn(myRow, 0)); assertEquals("d1", f.getColumn(myRow, 3)); try { f.getColumn(myRow, 4); fail("Expected out of bounds"); } catch (IndexOutOfBoundsException e) { } myRow = f.nextRow(); assertEquals(1, myRow); assertEquals("b2", f.getColumn(myRow, 1)); assertEquals("c2", f.getColumn(myRow, 2));
FileRowColContainer f = new FileRowColContainer("testfiles/test.csv"); assertNotNull(f); assertTrue("Not empty", f.getSize() > 0); int myRow = f.nextRow(); assertEquals(0, myRow); assertEquals("a1", f.getColumn(myRow, 0)); assertEquals("d1", f.getColumn(myRow, 3)); try { f.getColumn(myRow, 4); fail("Expected out of bounds"); } catch (IndexOutOfBoundsException e) { } myRow = f.nextRow(); assertEquals(1, myRow); assertEquals("b2", f.getColumn(myRow, 1)); assertEquals("c2", f.getColumn(myRow, 2));
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/test/src/org/apache/jmeter/functions/TestFileRowColContainer.java File path: /jakarta-jmeter-2.3.2/test/src/org/apache/jmeter/functions/TestFileRowColContainer.java
Method name: void testColumnsComma() Method name: void testColumns()
Number of AST nodes: 14 Number of AST nodes: 14
1
FileRowColContainer f = new FileRowColContainer("testfiles/test.csv", ",");
1
FileRowColContainer f = new FileRowColContainer("testfiles/test.csv");
2
			assertNotNull(f);
2
			assertNotNull(f);
3
			assertTrue("Not empty", f.getSize() > 0);
3
			assertTrue("Not empty", f.getSize() > 0);
4
			int myRow = f.nextRow();
4
			int myRow = f.nextRow();
5
			assertEquals(0, myRow);
5
			assertEquals(0, myRow);
6
			assertEquals("a1", f.getColumn(myRow, 0));
6
			assertEquals("a1", f.getColumn(myRow, 0));
7
			assertEquals("d1", f.getColumn(myRow, 3));
7
			assertEquals("d1", f.getColumn(myRow, 3));
8
			try {
8
			try {
9
				f.getColumn(myRow, 4);
9
				f.getColumn(myRow, 4);
10
				fail("Expected out of bounds");
10
				fail("Expected out of bounds");
11
			} catch (IndexOutOfBoundsException e) {
11
			} catch (IndexOutOfBoundsException e) {
12
			}
12
			}
13
			myRow = f.nextRow();
13
			myRow = f.nextRow();
14
			assertEquals(1, myRow);
14
			assertEquals(1, myRow);
15
			assertEquals("b2", f.getColumn(myRow, 1));
15
			assertEquals("b2", f.getColumn(myRow, 1));
16
			assertEquals("c2", f.getColumn(myRow, 2));
16
			assertEquals("c2", f.getColumn(myRow, 2));
Summary
Number of common nesting structure subtrees1
Number of refactorable cases1
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.3
Clones locationClones are declared in the same class
Number of node comparisons82
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements14
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)14.4
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    FileRowColContainer f = new FileRowColContainer("testfiles/test.csv", ",");
    1
    FileRowColContainer f = new FileRowColContainer("testfiles/test.csv", ",");
    1
    FileRowColContainer f = new FileRowColContainer("testfiles/test.csv");
    Differences
    Expression1Expression2Difference
    new FileRowColContainer("testfiles/test.csv",",")new FileRowColContainer("testfiles/test.csv")ARGUMENT_NUMBER_MISMATCH
    Preondition Violations
    Expression new FileRowColContainer("testfiles/test.csv",",") cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression new FileRowColContainer("testfiles/test.csv") cannot be parameterized, because it has dependencies to/from statements that will be extracted
    1
    FileRowColContainer f = new FileRowColContainer("testfiles/test.csv");
    2
    assertNotNull(f);
    2
    assertNotNull(f);
    3
    assertTrue("Not empty", f.getSize() > 0);
    3
    assertTrue("Not empty", f.getSize() > 0);
    4
    int myRow = f.nextRow();
    4
    int myRow = f.nextRow();
    5
    assertEquals(0, myRow);
    5
    assertEquals(0, myRow);
    6
    assertEquals("a1", f.getColumn(myRow, 0));
    6
    assertEquals("a1", f.getColumn(myRow, 0));
    7
    assertEquals("d1", f.getColumn(myRow, 3));
    7
    assertEquals("d1", f.getColumn(myRow, 3));
    8
    try
    8
    try
    9
    f.getColumn(myRow, 4);
    9
    f.getColumn(myRow, 4);
    10
    fail("Expected out of bounds");
    10
    fail("Expected out of bounds");
    11
    myRow = f.nextRow();
    11
    myRow = f.nextRow();
    12
    assertEquals(1, myRow);
    12
    assertEquals(1, myRow);
    13
    assertEquals("b2", f.getColumn(myRow, 1));
    13
    assertEquals("b2", f.getColumn(myRow, 1));
    14
    assertEquals("c2", f.getColumn(myRow, 2));
    14
    assertEquals("c2", f.getColumn(myRow, 2));
    Precondition Violations (2)
    Row Violation
    1Expression new FileRowColContainer("testfiles/test.csv",",") cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression new FileRowColContainer("testfiles/test.csv") cannot be parameterized, because it has dependencies to/from statements that will be extracted