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 testColumnsTab() throws Exception {
FileRowColContainer f = new FileRowColContainer("testfiles/test.tsv", "\t");
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));
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 | assertNotNull(f);↵ | | 1 | assertNotNull(f);↵
|
2 | assertTrue("Not empty", f.getSize() > 0);↵ | | 2 | assertTrue("Not empty", f.getSize() > 0);↵
|
|
3 | int myRow = f.nextRow();↵ | | 3 | int myRow = f.nextRow();↵
|
4 | assertEquals(0, myRow);↵ | | 4 | assertEquals(0, myRow);↵
|
5 | assertEquals("a1", f.getColumn(myRow, 0));↵ | | 5 | assertEquals("a1", f.getColumn(myRow, 0));↵
|
6 | assertEquals("d1", f.getColumn(myRow, 3));↵ | | 6 | assertEquals("d1", f.getColumn(myRow, 3));↵
|
|
7 | try {↵ | | 7 | try {↵
|
8 | f.getColumn(myRow, 4);↵ | | 8 | f.getColumn(myRow, 4);↵
|
9 | fail("Expected out of bounds");↵ | | 9 | fail("Expected out of bounds");↵
|
10 | } catch (IndexOutOfBoundsException e) {↵ | | 10 | } catch (IndexOutOfBoundsException e) {↵
|
11 | }↵ | | 11 | }↵
|
12 | myRow = f.nextRow();↵ | | 12 | myRow = f.nextRow();↵
|
13 | assertEquals(1, myRow);↵ | | 13 | assertEquals(1, myRow);↵
|
14 | assertEquals("b2", f.getColumn(myRow, 1));↵ | | 14 | assertEquals("b2", f.getColumn(myRow, 1));↵
|
15 | assertEquals("c2", f.getColumn(myRow, 2));↵ | | 15 | assertEquals("c2", f.getColumn(myRow, 2));↵
|
16 | }↵ | | 16 | }↵
|
|
17 | public void testColumnsTab() throws Exception {↵ | | 17 | public void testColumnsComma() throws Exception {↵
|
18 | FileRowColContainer f = new FileRowColContainer("testfiles/test.tsv", "\t");↵ | | 18 | FileRowColContainer f = new FileRowColContainer("testfiles/test.csv", ",");↵
|
19 | assertNotNull(f);↵ | | 19 | assertNotNull(f);↵
|
20 | assertTrue("Not empty", f.getSize() > 0);↵ | | 20 | assertTrue("Not empty", f.getSize() > 0);↵
|
|
21 | int myRow = f.nextRow();↵ | | 21 | int myRow = f.nextRow();↵
|
22 | assertEquals(0, myRow);↵ | | 22 | assertEquals(0, myRow);↵
|
23 | assertEquals("a1", f.getColumn(myRow, 0));↵ | | 23 | assertEquals("a1", f.getColumn(myRow, 0));↵
|
24 | assertEquals("d1", f.getColumn(myRow, 3));↵ | | 24 | assertEquals("d1", f.getColumn(myRow, 3));↵
|
|
25 | try {↵ | | 25 | try {↵
|
26 | f.getColumn(myRow, 4);↵ | | 26 | f.getColumn(myRow, 4);↵
|
27 | fail("Expected out of bounds");↵ | | 27 | fail("Expected out of bounds");↵
|
28 | } catch (IndexOutOfBoundsException e) {↵ | | 28 | } catch (IndexOutOfBoundsException e) {↵
|
29 | }↵ | | 29 | }↵
|
30 | myRow = f.nextRow();↵ | | 30 | myRow = f.nextRow();↵
|
31 | assertEquals(1, myRow);↵ | | 31 | assertEquals(1, myRow);↵
|
32 | assertEquals("b2", f.getColumn(myRow, 1));↵ | | 32 | assertEquals("b2", f.getColumn(myRow, 1));↵
|
33 | assertEquals("c2", f.getColumn(myRow, 2));↵ | | 33 | assertEquals("c2", f.getColumn(myRow, 2));↵
|
34 | | | 34 |
|
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 |