public void testColumns() throws Exception {
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));
public void testColumnsComma() throws Exception {
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:
|
|
Method name:
|
Number of AST nodes: 0
|
|
Number of AST nodes: 0
|
|
1 | public void testColumns() throws Exception {↵ | | 1 | public void testColumnsComma() throws Exception {↵
|
2 | FileRowColContainer f = new FileRowColContainer("testfiles/test.csv");↵ | | 2 | FileRowColContainer f = new FileRowColContainer("testfiles/test.csv", ",");↵
|
3 | assertNotNull(f);↵ | | 3 | assertNotNull(f);↵
|
4 | assertTrue("Not empty", f.getSize() > 0);↵ | | 4 | assertTrue("Not empty", f.getSize() > 0);↵
|
|
5 | int myRow = f.nextRow();↵ | | 5 | int myRow = f.nextRow();↵
|
6 | assertEquals(0, myRow);↵ | | 6 | assertEquals(0, myRow);↵
|
7 | assertEquals("a1", f.getColumn(myRow, 0));↵ | | 7 | assertEquals("a1", f.getColumn(myRow, 0));↵
|
8 | assertEquals("d1", f.getColumn(myRow, 3));↵ | | 8 | assertEquals("d1", f.getColumn(myRow, 3));↵
|
|
9 | try {↵ | | 9 | try {↵
|
10 | f.getColumn(myRow, 4);↵ | | 10 | f.getColumn(myRow, 4);↵
|
11 | fail("Expected out of bounds");↵ | | 11 | fail("Expected out of bounds");↵
|
12 | } catch (IndexOutOfBoundsException e) {↵ | | 12 | } catch (IndexOutOfBoundsException e) {↵
|
13 | }↵ | | 13 | }↵
|
14 | myRow = f.nextRow();↵ | | 14 | myRow = f.nextRow();↵
|
15 | assertEquals(1, myRow);↵ | | 15 | assertEquals(1, myRow);↵
|
16 | assertEquals("b2", f.getColumn(myRow, 1));↵ | | 16 | assertEquals("b2", f.getColumn(myRow, 1));↵
|
17 | assertEquals("c2", f.getColumn(myRow, 2));↵ | | 17 | assertEquals("c2", f.getColumn(myRow, 2));↵
|
18 | | | 18 |
|
See real code fragment |
|
See real code fragment |
Summary
Number of common nesting structure subtrees | 0 |
Number of refactorable cases | 0 |
Number of non-refactorable cases | 0 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.0 |
Clones location | |
Number of node comparisons | 0 |