public void processResourceDelete(@Observes final ResourceDeletedEvent resourceDeletedEvent) { processResourceChange(resourceDeletedEvent.getSessionInfo(), resourceDeletedEvent.getPath(), ResourceChangeType.DELETE); incrementalBuilder.deleteResource(resourceDeletedEvent.getPath()); }
@Override public String toString() { return "ResourceDeletedEvent{" + "path=" + path + ", message=" + getMessage() + ", sessionInfo=" + sessionInfo + '}'; } }
private void verifyResourceDeletedEvent(String file, String sessionId, String userId, String commitMessage) { verify(resourceDeletedEvent, times(1)).fire(resourceDeletedEventCaptor.capture()); assertEquals(file, resourceDeletedEventCaptor.getValue().getPath().toURI()); assertEquals(sessionId, resourceDeletedEventCaptor.getValue().getSessionInfo().getId()); assertEquals(userId, resourceDeletedEventCaptor.getValue().getSessionInfo().getIdentity().getIdentifier()); assertEquals(commitMessage, resourceDeletedEventCaptor.getValue().getMessage()); }
@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)); }
private void verifyResourceDeletedEvent(String file, String sessionId, String userId, String commitMessage) { verify(resourceDeletedEvent, times(1)).fire(resourceDeletedEventCaptor.capture()); assertEquals(file, resourceDeletedEventCaptor.getValue().getPath().toURI()); assertEquals(sessionId, resourceDeletedEventCaptor.getValue().getSessionInfo().getId()); assertEquals(userId, resourceDeletedEventCaptor.getValue().getSessionInfo().getIdentity().getIdentifier()); assertEquals(commitMessage, resourceDeletedEventCaptor.getValue().getMessage()); }
@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)); }
public void processResourceDelete(@Observes final ResourceDeletedEvent resourceDeletedEvent) { processResourceChange(resourceDeletedEvent.getSessionInfo(), resourceDeletedEvent.getPath(), ResourceChangeType.DELETE); incrementalBuilder.deleteResource(resourceDeletedEvent.getPath()); }
@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)); }
public void onResourceDelete( @Observes final ResourceDeletedEvent resourceDeletedEvent ) { if ( defChangeHandler != null && isProcessable( resourceDeletedEvent.getPath( ) ) ) { defChangeHandler.processResourceDelete( resourceDeletedEvent.getPath( ), resourceDeletedEvent.getSessionInfo( ) ); } }
@SuppressWarnings("unused") private void onResourceDeleted(@Observes ResourceDeletedEvent res) { maybeDeleteLock(res.getPath()); }
@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://project1/cheese.drl"); when(ioService.get(any(URI.class))).thenReturn(nioPath); bridge.onBatchResourceChanges(new ResourceDeletedEvent(path, "message", sessionInfo)); verify(deleteProjectEvent, times(0)).fire(any(DeleteProjectEvent.class)); }
public void processResourceDelete(@Observes final ResourceDeletedEvent resourceDeletedEvent) { processResourceChange(resourceDeletedEvent.getSessionInfo(), resourceDeletedEvent.getPath(), ResourceChangeType.DELETE); incrementalBuilder.deleteResource(resourceDeletedEvent.getPath()); }
public void onResourceDeleted(@Observes final ResourceDeletedEvent event) { refreshView(event.getPath()); }
@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://project1/pom.xml"); when(ioService.get(any(URI.class))).thenReturn(nioPath); bridge.onBatchResourceChanges(new ResourceDeletedEvent(path, "message", sessionInfo)); verify(deleteProjectEvent, times(1)).fire(any(DeleteProjectEvent.class)); }
void onResourceDeleted(@Observes final ResourceDeletedEvent deletedEvent) { if (path != null && path.equals(deletedEvent.getPath())) { if (sessionInfo.getId().equals(deletedEvent.getSessionInfo().getId())) { executeDeleteCommands(); } else { executeConcurrentDeleteCommand(deletedEvent.getPath(), deletedEvent.getSessionInfo().getId(), deletedEvent.getSessionInfo().getIdentity()); } } }
public void onResourceDeleted(@Observes final ResourceDeletedEvent event) { refresh(event.getPath()); }
@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)); }