Search in sources :

Example 21 with FolderItem

use of org.kie.workbench.common.screens.explorer.model.FolderItem in project kie-wb-common by kiegroup.

the class ClassifierTest method unsuccessfullyFindResourceTypeByFolderItemTest.

@Test(expected = IllegalArgumentException.class)
public void unsuccessfullyFindResourceTypeByFolderItemTest() {
    final FolderItem folderItem = mock(FolderItem.class);
    final Path path = mock(Path.class);
    doReturn(path).when(folderItem).getItem();
    doReturn(false).when(clientResourceType).accept(path);
    classifier.findResourceType(folderItem);
}
Also used : Path(org.uberfire.backend.vfs.Path) FolderItem(org.kie.workbench.common.screens.explorer.model.FolderItem) Test(org.junit.Test)

Example 22 with FolderItem

use of org.kie.workbench.common.screens.explorer.model.FolderItem in project kie-wb-common by kiegroup.

the class BaseViewPresenterTest method testDeleteNotification.

@Test
public void testDeleteNotification() {
    deletePopUpPresenterShowMock();
    final FolderItem item = mock(FolderItem.class);
    presenter.deleteItem(item);
    verify(notification, times(1)).fire(any(NotificationEvent.class));
}
Also used : FolderItem(org.kie.workbench.common.screens.explorer.model.FolderItem) NotificationEvent(org.uberfire.workbench.events.NotificationEvent) Test(org.junit.Test)

Example 23 with FolderItem

use of org.kie.workbench.common.screens.explorer.model.FolderItem in project kie-wb-common by kiegroup.

the class BaseViewPresenterTest method testRenameNotification.

@Test
public void testRenameNotification() {
    renamePopUpPresenterShowMock();
    when(renamePopUpPresenterMock.getView()).thenReturn(renamePopUpView);
    final FolderItem item = mock(FolderItem.class);
    presenter.renameItem(item);
    verify(notification, times(1)).fire(any(NotificationEvent.class));
}
Also used : FolderItem(org.kie.workbench.common.screens.explorer.model.FolderItem) NotificationEvent(org.uberfire.workbench.events.NotificationEvent) Test(org.junit.Test)

Example 24 with FolderItem

use of org.kie.workbench.common.screens.explorer.model.FolderItem in project kie-wb-common by kiegroup.

the class BaseViewPresenterTest method testCopyNotification.

@Test
public void testCopyNotification() {
    copyPopUpPresenterShowMock();
    when(copyPopUpPresenterMock.getView()).thenReturn(copyPopUpView);
    final FolderItem item = mock(FolderItem.class);
    presenter.copyItem(item);
    verify(notification, times(1)).fire(any(NotificationEvent.class));
}
Also used : FolderItem(org.kie.workbench.common.screens.explorer.model.FolderItem) NotificationEvent(org.uberfire.workbench.events.NotificationEvent) Test(org.junit.Test)

Example 25 with FolderItem

use of org.kie.workbench.common.screens.explorer.model.FolderItem in project kie-wb-common by kiegroup.

the class BaseBreadcrumbNavigatorTest method testLoadContentOnlyFile.

@Test
public void testLoadContentOnlyFile() {
    final BreadcrumbNavigator navigator = spy(new BreadcrumbNavigator(activeOptions, hiddenTypeDef, user));
    final FolderItem item = new FolderItem(path, "item1", FolderItemType.FILE);
    final List<FolderItem> content = new ArrayList<FolderItem>() {

        {
            add(new FolderItem(mock(Path.class), "File1", FolderItemType.FILE));
        }
    };
    final List<FolderItem> segments = new ArrayList<FolderItem>();
    final FolderListing listing = new FolderListing(item, content, segments);
    navigator.loadContent(listing);
    verify(navigator).setupBreadcrumb(listing);
    verify(navigator).setupUpFolder(listing);
    verify(navigator).setupContent(listing);
    verifyNavigatorPanelVisibility(navigator);
}
Also used : FolderItem(org.kie.workbench.common.screens.explorer.model.FolderItem) ArrayList(java.util.ArrayList) FolderListing(org.kie.workbench.common.screens.explorer.model.FolderListing) Test(org.junit.Test)

Aggregations

FolderItem (org.kie.workbench.common.screens.explorer.model.FolderItem)31 ArrayList (java.util.ArrayList)15 Path (org.uberfire.backend.vfs.Path)14 Test (org.junit.Test)13 Package (org.guvnor.common.services.project.model.Package)8 FolderListing (org.kie.workbench.common.screens.explorer.model.FolderListing)8 NotificationEvent (org.uberfire.workbench.events.NotificationEvent)5 List (java.util.List)4 Set (java.util.Set)3 Inject (javax.inject.Inject)3 Module (org.guvnor.common.services.project.model.Module)3 FolderItemType (org.kie.workbench.common.screens.explorer.model.FolderItemType)3 ClientResourceType (org.uberfire.client.workbench.type.ClientResourceType)3 Window (com.google.gwt.user.client.Window)2 Collection (java.util.Collection)2 HashMap (java.util.HashMap)2 Map (java.util.Map)2 TreeSet (java.util.TreeSet)2 PostConstruct (javax.annotation.PostConstruct)2 Event (javax.enterprise.event.Event)2