Skip to content
Snippets Groups Projects
Commit 44520368 authored by Richard Schmidt's avatar Richard Schmidt
Browse files

Handle exceptions in csv parser tests

parent d018a766
No related branches found
No related tags found
1 merge request!18Feat/csvparser tests
......@@ -21,14 +21,14 @@ public class CsvDotParserTest {
public static CsvParser parser;
@BeforeAll
public static void initialize() {
public static void initialize() throws Exception {
ClassLoader classloader = Thread.currentThread().getContextClassLoader();
InputStream csvStream = classloader.getResourceAsStream("examples/csv/1_scatter_plot.csv");
Reader csvReader = new BufferedReader(new InputStreamReader(csvStream));
try {
parser = new CsvParser(csvReader, ',', '\"');
} catch (Exception e) {
throw new Exception();
}
}
......
......@@ -21,14 +21,14 @@ public class CsvXAlignedCategoriesParserTest {
public static CsvParser parser;
@BeforeAll
public static void initialize() {
public static void initialize() throws Exception {
ClassLoader classloader = Thread.currentThread().getContextClassLoader();
InputStream csvStream = classloader.getResourceAsStream("examples/csv/0_bar_chart_categorical.csv");
Reader csvReader = new BufferedReader(new InputStreamReader(csvStream));
try {
parser = new CsvParser(csvReader, ',', '\"');
} catch (Exception e) {
throw new Exception();
}
}
......
......@@ -21,14 +21,14 @@ public class CsvXAlignedParserTest {
public static CsvParser parser;
@BeforeAll
public static void initialize() {
public static void initialize() throws Exception {
ClassLoader classloader = Thread.currentThread().getContextClassLoader();
InputStream csvStream = classloader.getResourceAsStream("examples/csv/0_bar_chart.csv");
Reader csvReader = new BufferedReader(new InputStreamReader(csvStream));
try {
parser = new CsvParser(csvReader, ',', '\"');
} catch (Exception e) {
throw new Exception();
}
}
......
......@@ -16,17 +16,17 @@ public class Point2DValuedTest {
Assertions.assertThrows(NullPointerException.class, () -> {new Point2DValued(a, b, null);});
Point2DValued point = new Point2DValued(a, b, value);
Point2DValued<Integer, Integer> point = new Point2DValued(a, b, value);
Assertions.assertEquals(value, point.getVal());
}
@Test
public void testEquals () {
Point2DValued point_1 = new Point2DValued(1, 2, 3);
Point2DValued point_2 = new Point2DValued(1, 2, 3);
Point2DValued point_3 = new Point2DValued(2, 2, 3);
Point2DValued point_4 = new Point2DValued(1, 1, 3);
Point2DValued point_5 = new Point2DValued(1, 2, 2);
Point2DValued<Integer, Integer> point_1 = new Point2DValued(1, 2, 3);
Point2DValued<Integer, Integer> point_2 = new Point2DValued(1, 2, 3);
Point2DValued<Integer, Integer> point_3 = new Point2DValued(2, 2, 3);
Point2DValued<Integer, Integer> point_4 = new Point2DValued(1, 1, 3);
Point2DValued<Integer, Integer> point_5 = new Point2DValued(1, 2, 2);
String string = "test";
Assertions.assertEquals(true, point_1.equals(point_2));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment