use of org.pentaho.di.ui.repository.repositoryexplorer.model.UIRepositoryDirectories in project pentaho-kettle by pentaho.
the class UIEERepositoryDirectoryTest method testDelete.
@Test
public void testDelete() throws Exception {
UIRepositoryDirectories mockUIRepositoryDirectories = mock(UIRepositoryDirectories.class);
when(mockUIRepositoryDirectories.contains(uiRepDir)).thenReturn(true);
when(mockParent.getChildren()).thenReturn(mockUIRepositoryDirectories);
UIRepositoryObjects mockUIRepositoryObjects = mock(UIRepositoryObjects.class);
when(mockUIRepositoryObjects.contains(uiRepDir)).thenReturn(true);
when(mockParent.getRepositoryObjects()).thenReturn(mockUIRepositoryObjects);
uiRepDir.delete(false);
verify(mockRepository).deleteRepositoryDirectory(mockRepositoryDirectory);
verify(mockUIRepositoryDirectories, times(1)).remove(uiRepDir);
verify(mockUIRepositoryObjects, times(1)).remove(uiRepDir);
verify(mockParent, times(1)).refresh();
uiPurRepDir.delete(false);
verify(mockPurRepository).deleteRepositoryDirectory(mockRepositoryDirectory, false);
verify(mockUIRepositoryDirectories, times(2)).remove(uiPurRepDir);
verify(mockUIRepositoryObjects, times(2)).remove(uiPurRepDir);
verify(mockParent, times(2)).refresh();
}
use of org.pentaho.di.ui.repository.repositoryexplorer.model.UIRepositoryDirectories in project pdi-dataservice-server-plugin by pentaho.
the class DeleteRepositoryObjectExtensionPointPluginTest method setUp.
@Before
public void setUp() throws Exception {
when(context.getMetaStoreUtil()).thenReturn(metaStoreUtil);
plugin = new DeleteRepositoryObjectExtensionPointPlugin(context);
repoObjects = new UIRepositoryObjects(asList(repositoryObject));
repoDirectories = new UIRepositoryDirectories();
repoDirectories.add(repositorySubDirectory);
}
Aggregations