public void onBatchResourceChanges(final @Observes ResourceBatchChangesEvent resourceBatchChangesEvent) { super.onBatchResourceChanges(resourceBatchChangesEvent); }
public void onBatchResourceChanges(final @Observes ResourceDeletedEvent event) { super.onBatchResourceChanges(event); }
@Test public void testResourceDeletedEventNonPomFile() { final Path path = mock(Path.class); final org.uberfire.java.nio.file.Path nioPath = mock(org.uberfire.java.nio.file.Path.class); when(path.getFileName()).thenReturn("cheese.drl"); when(path.toURI()).thenReturn("file://module1/cheese.drl"); when(ioService.get(any(URI.class))).thenReturn(nioPath); bridge.onBatchResourceChanges(new ResourceDeletedEvent(path, "message", sessionInfo)); verify(deleteModuleEvent, times(0)).fire(any(DeleteModuleEvent.class)); }
@Test public void testResourceDeletedEventNonPomFile() { final Path path = mock(Path.class); final org.uberfire.java.nio.file.Path nioPath = mock(org.uberfire.java.nio.file.Path.class); when(path.getFileName()).thenReturn("cheese.drl"); when(path.toURI()).thenReturn("file://module1/cheese.drl"); when(ioService.get(any(URI.class))).thenReturn(nioPath); bridge.onBatchResourceChanges(new ResourceDeletedEvent(path, "message", sessionInfo)); verify(deleteModuleEvent, times(0)).fire(any(DeleteModuleEvent.class)); }
@Test public void testResourceDeletedEventPomFile() { final Path path = mock(Path.class); final org.uberfire.java.nio.file.Path nioPath = mock(org.uberfire.java.nio.file.Path.class); when(path.getFileName()).thenReturn("pom.xml"); when(path.toURI()).thenReturn("file://module1/pom.xml"); when(ioService.get(any(URI.class))).thenReturn(nioPath); bridge.onBatchResourceChanges(new ResourceDeletedEvent(path, "message", sessionInfo)); verify(deleteModuleEvent, times(1)).fire(any(DeleteModuleEvent.class)); }
@Test public void testResourceDeletedEventPomFile() { final Path path = mock(Path.class); final org.uberfire.java.nio.file.Path nioPath = mock(org.uberfire.java.nio.file.Path.class); when(path.getFileName()).thenReturn("pom.xml"); when(path.toURI()).thenReturn("file://module1/pom.xml"); when(ioService.get(any(URI.class))).thenReturn(nioPath); bridge.onBatchResourceChanges(new ResourceDeletedEvent(path, "message", sessionInfo)); verify(deleteModuleEvent, times(1)).fire(any(DeleteModuleEvent.class)); }
@Test public void testResourceBatchChangesEventDeletePomFile() { final Path path = mock(Path.class); final org.uberfire.java.nio.file.Path nioPath = mock(org.uberfire.java.nio.file.Path.class); when(path.getFileName()).thenReturn("pom.xml"); when(path.toURI()).thenReturn("file://module1/pom.xml"); when(ioService.get(any(URI.class))).thenReturn(nioPath); final Map<Path, Collection<ResourceChange>> batch = new HashMap<Path, Collection<ResourceChange>>() {{ put(path, new ArrayList<ResourceChange>() {{ add(new ResourceDeleted("")); }}); }}; bridge.onBatchResourceChanges(new ResourceBatchChangesEvent(batch, "message", sessionInfo)); verify(deleteModuleEvent, times(1)).fire(any(DeleteModuleEvent.class)); }
@Test public void testResourceBatchChangesEventDeleteNonPomFile() { final Path path = mock(Path.class); final org.uberfire.java.nio.file.Path nioPath = mock(org.uberfire.java.nio.file.Path.class); when(path.getFileName()).thenReturn("cheese.drl"); when(path.toURI()).thenReturn("file://module1/cheese.drl"); when(ioService.get(any(URI.class))).thenReturn(nioPath); final Map<Path, Collection<ResourceChange>> batch = new HashMap<Path, Collection<ResourceChange>>() {{ put(path, new ArrayList<ResourceChange>() {{ add(new ResourceDeleted("")); }}); }}; bridge.onBatchResourceChanges(new ResourceBatchChangesEvent(batch, "message", sessionInfo)); verify(deleteModuleEvent, times(0)).fire(any(DeleteModuleEvent.class)); } }
@Test public void testResourceBatchChangesEventUpdatePomFile() { final Path path = mock(Path.class); final org.uberfire.java.nio.file.Path nioPath = mock(org.uberfire.java.nio.file.Path.class); when(path.getFileName()).thenReturn("pom.xml"); when(path.toURI()).thenReturn("file://module1/pom.xml"); when(ioService.get(any(URI.class))).thenReturn(nioPath); final Map<Path, Collection<ResourceChange>> batch = new HashMap<Path, Collection<ResourceChange>>() {{ put(path, new ArrayList<ResourceChange>() {{ add(new ResourceUpdated("")); }}); }}; bridge.onBatchResourceChanges(new ResourceBatchChangesEvent(batch, "message", sessionInfo)); verify(deleteModuleEvent, times(0)).fire(any(DeleteModuleEvent.class)); }
@Test public void testResourceBatchChangesEventUpdatePomFile() { final Path path = mock(Path.class); final org.uberfire.java.nio.file.Path nioPath = mock(org.uberfire.java.nio.file.Path.class); when(path.getFileName()).thenReturn("pom.xml"); when(path.toURI()).thenReturn("file://module1/pom.xml"); when(ioService.get(any(URI.class))).thenReturn(nioPath); final Map<Path, Collection<ResourceChange>> batch = new HashMap<Path, Collection<ResourceChange>>() {{ put(path, new ArrayList<ResourceChange>() {{ add(new ResourceUpdated("")); }}); }}; bridge.onBatchResourceChanges(new ResourceBatchChangesEvent(batch, "message", sessionInfo)); verify(deleteModuleEvent, times(0)).fire(any(DeleteModuleEvent.class)); }
@Test public void testResourceBatchChangesEventUpdateNonPomFile() { final Path path = mock(Path.class); final org.uberfire.java.nio.file.Path nioPath = mock(org.uberfire.java.nio.file.Path.class); when(path.getFileName()).thenReturn("cheese.drl"); when(path.toURI()).thenReturn("file://module1/cheese.drl"); when(ioService.get(any(URI.class))).thenReturn(nioPath); final Map<Path, Collection<ResourceChange>> batch = new HashMap<Path, Collection<ResourceChange>>() {{ put(path, new ArrayList<ResourceChange>() {{ add(new ResourceUpdated("")); }}); }}; bridge.onBatchResourceChanges(new ResourceBatchChangesEvent(batch, "message", sessionInfo)); verify(deleteModuleEvent, times(0)).fire(any(DeleteModuleEvent.class)); }
@Test public void testResourceBatchChangesEventUpdateNonPomFile() { final Path path = mock(Path.class); final org.uberfire.java.nio.file.Path nioPath = mock(org.uberfire.java.nio.file.Path.class); when(path.getFileName()).thenReturn("cheese.drl"); when(path.toURI()).thenReturn("file://module1/cheese.drl"); when(ioService.get(any(URI.class))).thenReturn(nioPath); final Map<Path, Collection<ResourceChange>> batch = new HashMap<Path, Collection<ResourceChange>>() {{ put(path, new ArrayList<ResourceChange>() {{ add(new ResourceUpdated("")); }}); }}; bridge.onBatchResourceChanges(new ResourceBatchChangesEvent(batch, "message", sessionInfo)); verify(deleteModuleEvent, times(0)).fire(any(DeleteModuleEvent.class)); }
@Test public void testResourceBatchChangesEventDeletePomFile() { final Path path = mock(Path.class); final org.uberfire.java.nio.file.Path nioPath = mock(org.uberfire.java.nio.file.Path.class); when(path.getFileName()).thenReturn("pom.xml"); when(path.toURI()).thenReturn("file://module1/pom.xml"); when(ioService.get(any(URI.class))).thenReturn(nioPath); final Map<Path, Collection<ResourceChange>> batch = new HashMap<Path, Collection<ResourceChange>>() {{ put(path, new ArrayList<ResourceChange>() {{ add(new ResourceDeleted("")); }}); }}; bridge.onBatchResourceChanges(new ResourceBatchChangesEvent(batch, "message", sessionInfo)); verify(deleteModuleEvent, times(1)).fire(any(DeleteModuleEvent.class)); }
@Test public void testResourceBatchChangesEventDeleteNonPomFile() { final Path path = mock(Path.class); final org.uberfire.java.nio.file.Path nioPath = mock(org.uberfire.java.nio.file.Path.class); when(path.getFileName()).thenReturn("cheese.drl"); when(path.toURI()).thenReturn("file://module1/cheese.drl"); when(ioService.get(any(URI.class))).thenReturn(nioPath); final Map<Path, Collection<ResourceChange>> batch = new HashMap<Path, Collection<ResourceChange>>() {{ put(path, new ArrayList<ResourceChange>() {{ add(new ResourceDeleted("")); }}); }}; bridge.onBatchResourceChanges(new ResourceBatchChangesEvent(batch, "message", sessionInfo)); verify(deleteModuleEvent, times(0)).fire(any(DeleteModuleEvent.class)); } }