### Question:
FileReader implements Iterable<Elements> { void refresh() throws FileReaderException { this.headings = null; getTable(); } FileReader( Source source, String selector, Integer index );  FileReader( Source source, String selector );  FileReader( Source source ); @Override FileReaderIterator iterator(); void close();  }### Answer:
@Test public void testFileReaderUrlNoPath() throws FileReaderException { Assume.assumeTrue( FileSuite.hazNetwork() ); final String r = System.getProperty( "java.runtime.name" ); Assume.assumeTrue( "Java 10+ should have root certificates (JEP 319). Runtime is " + r + ", Jave major version is " + TestUtil.getJavaMajorVersion(), !r.equals( "OpenJDK Runtime Environment" ) || TestUtil.getJavaMajorVersion() > 10 ); FileReader t = new FileReader( STATES_SOURCE ); t.refresh(); }
@Ignore("Wikipedia format change breaks file adapter test") @Test public void testFileReaderUrlWithPath() throws FileReaderException { Assume.assumeTrue( FileSuite.hazNetwork() ); FileReader t = new FileReader( CITIES_SOURCE, "#mw-content-text > table.wikitable.sortable", 0 ); t.refresh(); }
@Test(expected = FileReaderException.class) public void testFileReaderBadUrl() throws FileReaderException { final String uri = "http: FileReader t = new FileReader( Sources.url( uri ), "table:eq(4)" ); t.refresh(); }
@Test(expected = FileReaderException.class) public void testFileReaderBadSelector() throws FileReaderException { final Source source = Sources.file( null, file( "build/test-classes/tableOK.html" ) ); FileReader t = new FileReader( source, "table:eq(1)" ); t.refresh(); }