@Test
public void testTailPermissionDenied() throws IOException,
FlumeSpecException, InterruptedException {
File f;
final EventSource eventSource;
final CompositeSink eventSink;
final AtomicBoolean workerFailed;
Thread workerThread;
FileWriter writer;
long sleepTime;
long eventCount;
f = File.createTempFile("temp", ".tmp");
f.setReadable(false, false);
f.deleteOnExit();
eventSource = TailSource.builder().build(f.getAbsolutePath());
eventSink = new CompositeSink(new ReportTestingContext(),
"{ delay(50) => counter(\"count\") }");
workerFailed = new AtomicBoolean(false);
workerThread = new Thread() {
@Override
public void run() {
try {
eventSource.open();
eventSink.open();
EventUtil.dumpN(10, eventSource, eventSink);
Clock.sleep(500);
eventSource.close();
eventSink.close();
} catch (Exception e) {
LOG.error("Unexpected exception", e);
}
}