@Test(expected = NetworkReactiveAuditException.class) public void getInputStream_use() throws IOException { Assume.assumeTrue(IOTestTools.isNetworkConnected()); ReactiveAudit.off.commit(); URLConnection conn = new URL("http://" + HOST + ":" + PORT).openConnection(); InputStream in = conn.getInputStream(); TestTools.strict.commit(); in.read(); }
@Test(expected = ReactiveAuditException.class) public void append() throws InterruptedException, IOException { TestTools.strict.commit(); Appendable app = new FileWriter(IOTestTools.getTempFile()); app.append("a"); } }
@Test(expected = FileReactiveAuditException.class) public void renameTo() throws IOException { File newName = new File("toto"); TestTools.strict.commit(); IOTestTools.getTempFile().renameTo(newName); }
@Test public void close_Interruptible() throws IOException { try (Channel w = channel.get()) { TestTools.strict.commit(); w.close(); } }
@Test(expected = NetworkReactiveAuditException.class) public void getContentLength() throws IOException { Assume.assumeTrue(IOTestTools.isNetworkConnected()); ReactiveAudit.off.commit(); URLConnection conn = new URL("http://" + HOST + ":" + PORT).openConnection(); TestTools.strict.commit(); conn.getContentLength(); }
@Test(expected = FileReactiveAuditException.class) public void getFreeSpace() throws IOException { TestTools.strict.commit(); IOTestTools.getTempFile().getFreeSpace(); }