@Test public void writeToList1() throws Exception { CountDownPVReaderListener listener = new CountDownPVReaderListener(1, PVReaderEvent.VALUE_MASK); File filename = File.createTempFile("file.", ".list"); PrintWriter writer = new PrintWriter(filename); writer.println("A"); writer.println("B"); writer.println("C"); writer.close(); PV<VType, Object> fullPv = PVManager.readAndWrite(vType(filename.toURI().getPath())).from(file) .readListener(listener) .synchWriteAndMaxReadRate(ofMillis(10)); pv = fullPv; listener.await(ofMillis(700)); assertThat(listener.getCount(), equalTo(0)); assertThat(pv.getValue(), instanceOf(VStringArray.class)); VStringArray array = (VStringArray) pv.getValue(); assertThat(array.getData(), equalTo(Arrays.asList("A", "B", "C"))); listener.resetCount(1); fullPv.write(ValueFactory.toVType(Arrays.asList("A", "B", "C", "D"))); listener.await(ofMillis(2000)); assertThat(listener.getCount(), equalTo(0)); assertThat(pv.getValue(), instanceOf(VStringArray.class)); array = (VStringArray) pv.getValue(); assertThat(array.getData(), equalTo(Arrays.asList("A", "B", "C", "D"))); try (BufferedReader reader = new BufferedReader(new FileReader(filename))) { String line = reader.readLine(); assertThat(line, equalTo("A")); line = reader.readLine(); assertThat(line, equalTo("B")); line = reader.readLine(); assertThat(line, equalTo("C")); line = reader.readLine(); assertThat(line, equalTo("D")); line = reader.readLine(); assertThat(line, nullValue()); } }
@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();  }