Lines 23-31
Link Here
|
23 |
import static org.junit.Assert.assertTrue; |
23 |
import static org.junit.Assert.assertTrue; |
24 |
import static org.junit.Assert.fail; |
24 |
import static org.junit.Assert.fail; |
25 |
|
25 |
|
|
|
26 |
import java.io.File; |
26 |
import java.nio.file.NoSuchFileException; |
27 |
import java.nio.file.NoSuchFileException; |
27 |
|
28 |
|
28 |
import org.apache.jmeter.junit.JMeterTestCase; |
29 |
import org.apache.jmeter.junit.JMeterTestCase; |
|
|
30 |
import org.apache.jmeter.services.FileServer; |
31 |
import org.apache.jmeter.util.JMeterUtils; |
32 |
import org.junit.After; |
33 |
import org.junit.Before; |
29 |
import org.junit.Test; |
34 |
import org.junit.Test; |
30 |
|
35 |
|
31 |
/** |
36 |
/** |
Lines 35-41
Link Here
|
35 |
*/ |
40 |
*/ |
36 |
public class TestFileRowColContainer extends JMeterTestCase { |
41 |
public class TestFileRowColContainer extends JMeterTestCase { |
37 |
|
42 |
|
38 |
@Test(expected=NoSuchFileException.class) |
43 |
private String defaultBase = null; |
|
|
44 |
|
45 |
@Before |
46 |
public void setUp() { |
47 |
defaultBase = FileServer.getDefaultBase(); |
48 |
FileServer.getFileServer().setBase(new File(JMeterUtils.getJMeterHome() + "/bin")); |
49 |
} |
50 |
|
51 |
@After |
52 |
public void tearDown() { |
53 |
FileServer.getFileServer().setBase(new File(defaultBase)); |
54 |
} |
55 |
|
56 |
@Test(expected = NoSuchFileException.class) |
39 |
public void testNull() throws Exception { |
57 |
public void testNull() throws Exception { |
40 |
new FileRowColContainer(findTestPath("testfiles/xyzxyz")); |
58 |
new FileRowColContainer(findTestPath("testfiles/xyzxyz")); |
41 |
} |
59 |
} |
Lines 55-60
Link Here
|
55 |
} |
73 |
} |
56 |
|
74 |
|
57 |
@Test |
75 |
@Test |
|
|
76 |
public void testRowNumRelative() throws Exception { |
77 |
FileRowColContainer f = new FileRowColContainer("testfiles/unit/TestFileRowColContainer.csv"); |
78 |
assertNotNull(f); |
79 |
assertEquals("Expected 4 lines", 4, f.getSize()); |
80 |
|
81 |
assertEquals(0, f.nextRow()); |
82 |
assertEquals(1, f.nextRow()); |
83 |
assertEquals(2, f.nextRow()); |
84 |
assertEquals(3, f.nextRow()); |
85 |
assertEquals(0, f.nextRow()); |
86 |
|
87 |
} |
88 |
|
89 |
@Test |
58 |
public void testColumns() throws Exception { |
90 |
public void testColumns() throws Exception { |
59 |
FileRowColContainer f = new FileRowColContainer(findTestPath("testfiles/unit/TestFileRowColContainer.csv")); |
91 |
FileRowColContainer f = new FileRowColContainer(findTestPath("testfiles/unit/TestFileRowColContainer.csv")); |
60 |
assertNotNull(f); |
92 |
assertNotNull(f); |