@Test public void udpateFile() throws Exception { CountDownPVReaderListener listener = new CountDownPVReaderListener(1, PVReaderEvent.VALUE_MASK); File filename = File.createTempFile("file.", ".csv"); PrintWriter writer = new PrintWriter(filename); writer.println("Name,Value"); writer.println("Andrew,34"); writer.println("Bob,12"); writer.close(); pv = PVManager.read(vType(filename.toURI().getPath())).from(file) .readListener(listener) .maxRate(ofMillis(10)); listener.await(ofMillis(1500)); assertThat(listener.getCount(), equalTo(0)); assertThat(pv.getValue(), instanceOf(VTable.class)); VTable vTable = (VTable) pv.getValue(); assertThat(vTable.getRowCount(), equalTo(2)); assertThat(vTable.getColumnCount(), equalTo(2)); assertThat(vTable.getColumnName(0), equalTo("Name")); assertThat(vTable.getColumnName(1), equalTo("Value")); assertThat(vTable.getColumnData(0), equalTo((Object) Arrays.asList("Andrew", "Bob"))); assertThat(vTable.getColumnData(1), equalTo((Object) new ArrayDouble(34,12))); listener.resetCount(1); writer = new PrintWriter(new BufferedWriter(new FileWriter(filename, true))); writer.println("Charlie,71"); writer.close(); listener.await(ofMillis(3000)); assertThat(listener.getCount(), equalTo(0)); assertThat(pv.getValue(), instanceOf(VTable.class)); vTable = (VTable) pv.getValue(); assertThat(vTable.getRowCount(), equalTo(3)); assertThat(vTable.getColumnCount(), equalTo(2)); assertThat(vTable.getColumnName(0), equalTo("Name")); assertThat(vTable.getColumnName(1), equalTo("Value")); assertThat(vTable.getColumnData(0), equalTo((Object) Arrays.asList("Andrew", "Bob", "Charlie"))); assertThat(vTable.getColumnData(1), equalTo((Object) new ArrayDouble(34,12,71))); }
@Override public void close() { exec.shutdownNow(); super.close(); }
FileDataSource extends DataSource { @Override public void close() { exec.shutdownNow(); super.close(); } }
FileDataSource extends DataSource { @Override public void close() { exec.shutdownNow(); super.close(); } FileDataSource(FileDataSourceConfiguration conf); }
FileDataSource extends DataSource { @Override public void close() { exec.shutdownNow(); super.close(); } FileDataSource(FileDataSourceConfiguration conf); @Override void close(); }
FileDataSource extends DataSource { @Override public void close() { exec.shutdownNow(); super.close(); } FileDataSource(FileDataSourceConfiguration conf); @Override void close();  }