Example usage for java.nio.file WatchEvent WatchEvent

List of usage examples for java.nio.file WatchEvent WatchEvent

Introduction

In this page you can find the example usage for java.nio.file WatchEvent WatchEvent.

Prototype

WatchEvent

Source Link

Usage

From source file:com.facebook.buck.util.ProjectFilesystemTest.java

@Test
public void testCreateContextStringForOverflowEvent() {
    WatchEvent<Object> overflowEvent = new WatchEvent<Object>() {
        @Override/*from  w ww  . j  av  a  2s .c o  m*/
        public Kind<Object> kind() {
            return StandardWatchEventKinds.OVERFLOW;
        }

        @Override
        public int count() {
            return 0;
        }

        @Override
        public Object context() {
            return new Object() {
                @Override
                public String toString() {
                    return "I am the context string.";
                }
            };
        }
    };
    assertEquals("I am the context string.", filesystem.createContextString(overflowEvent));
}