Skip to content

Commit

Permalink
forgot about the test classes...
Browse files Browse the repository at this point in the history
  • Loading branch information
mrieser committed Oct 13, 2023
1 parent 6ab6503 commit 3840dfc
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package org.matsim.contrib.shared_mobility;

import java.io.UncheckedIOException;
import java.net.URISyntaxException;
import java.net.URL;
import java.util.ArrayList;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import java.io.BufferedWriter;
import java.io.File;
import java.io.IOException;
import java.io.UncheckedIOException;

/**
* @author thibautd
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import static org.junit.Assert.fail;

import java.io.IOException;
import java.io.UncheckedIOException;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.UncheckedIOException;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.List;
Expand Down Expand Up @@ -207,7 +208,8 @@ public void endTag(String name, String content, Stack<String> context) {
}.parse(stream);
Assert.fail("expected exception.");
} catch (UncheckedIOException e) {
Assert.assertTrue(e.getCause() instanceof SAXParseException); // expected
Assert.assertTrue(e.getCause() instanceof IOException); // expected
Assert.assertTrue(e.getCause().getCause() instanceof SAXParseException); // expected
}

Assert.assertEquals(3, log.size());
Expand Down Expand Up @@ -282,7 +284,8 @@ public void endTag(String name, String content, Stack<String> context) {
}.parse(stream);
Assert.fail("expected exception.");
} catch (UncheckedIOException e) {
Assert.assertTrue(e.getCause() instanceof SAXParseException); // expected
Assert.assertTrue(e.getCause() instanceof IOException); // expected
Assert.assertTrue(e.getCause().getCause() instanceof SAXParseException); // expected
}

Assert.assertEquals(5, log.size());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
import java.io.BufferedReader;
import java.io.File;
import java.io.IOException;
import java.io.UncheckedIOException;
import java.lang.reflect.Method;
import java.net.MalformedURLException;
import java.net.URL;
Expand Down Expand Up @@ -150,7 +151,7 @@ public URL packageInputResourcePath() {
private URL getResourceNotNull(String pathString) {
URL resource = this.testClass.getResource(pathString);
if (resource == null) {
throw new UncheckedIOException("Not found: "+pathString);
throw new UncheckedIOException(new IOException("Not found: "+pathString));
}
return resource;
}
Expand Down

0 comments on commit 3840dfc

Please sign in to comment.