@Test public void testReadFile() throws Exception { assertEquals( "This is my test file.\n\t\nIt has lots of whitespace in it!", SharedFileResource.readFile(new File(getClass().getResource("test.txt").toURI()))); try { SharedFileResource.readFile(new File("missing.txt")); fail("Expected an exception"); } catch (IOException ioe) { // Test passed, we expected an error } }