Search in sources :

Example 1 with ActiveOptions

use of org.kie.workbench.common.screens.explorer.service.ActiveOptions in project kie-wb-common by kiegroup.

the class ProjectExplorerContentResolverTest method testResolveWithOUWithRepositoryNullQueryBusinessView.

@Test
public void testResolveWithOUWithRepositoryNullQueryBusinessView() throws Exception {
    final ProjectExplorerContentQuery query = new ProjectExplorerContentQuery(repository, masterBranch);
    final ActiveOptions options = new ActiveOptions();
    options.add(Option.TREE_NAVIGATOR);
    options.add(Option.EXCLUDE_HIDDEN_ITEMS);
    options.add(Option.BUSINESS_CONTENT);
    query.setOptions(options);
    resolver.resolve(query);
}
Also used : ActiveOptions(org.kie.workbench.common.screens.explorer.service.ActiveOptions) ProjectExplorerContentQuery(org.kie.workbench.common.screens.explorer.service.ProjectExplorerContentQuery) Test(org.junit.Test)

Example 2 with ActiveOptions

use of org.kie.workbench.common.screens.explorer.service.ActiveOptions in project kie-wb-common by kiegroup.

the class ProjectExplorerContentResolverTest method testChangeModuleOnTechnicalViewWhenThereIsAFolderItemButNoActiveModuleOrganizationalUnitOrRepository.

@Test
public void testChangeModuleOnTechnicalViewWhenThereIsAFolderItemButNoActiveModuleOrganizationalUnitOrRepository() {
    resolver.resolve(getContentQuery(masterBranch, createModule("master", masterBranch, "module 1"), Option.TECHNICAL_CONTENT));
    helperWrapper.reset();
    ProjectExplorerContentQuery projectExplorerContentQuery = new ProjectExplorerContentQuery(null, null, null, null, getFileItem());
    ActiveOptions options = new ActiveOptions();
    options.add(Option.TECHNICAL_CONTENT);
    projectExplorerContentQuery.setOptions(options);
    helperWrapper.excludePackage();
    Content content = resolver.setupSelectedItems(projectExplorerContentQuery);
    helperWrapper.reset();
    assertEquals("master", content.getSelectedProject().getBranch().getName());
    assertEquals("master@module 1", content.getSelectedModule().getRootPath().toURI());
    assertNotNull(content.getSelectedItem());
    assertNull(content.getSelectedPackage());
}
Also used : ActiveOptions(org.kie.workbench.common.screens.explorer.service.ActiveOptions) ProjectExplorerContent(org.kie.workbench.common.screens.explorer.model.ProjectExplorerContent) ProjectExplorerContentQuery(org.kie.workbench.common.screens.explorer.service.ProjectExplorerContentQuery) Test(org.junit.Test)

Example 3 with ActiveOptions

use of org.kie.workbench.common.screens.explorer.service.ActiveOptions in project kie-wb-common by kiegroup.

the class ProjectExplorerContentResolverTest method getContentQuery.

private ProjectExplorerContentQuery getContentQuery(final Branch branch, final Module module, final Option content, final Package pkg, final FolderItem item) {
    final ProjectExplorerContentQuery projectExplorerContentQuery = new ProjectExplorerContentQuery(repository, branch, module, pkg, item);
    final ActiveOptions options = new ActiveOptions();
    options.add(Option.TREE_NAVIGATOR);
    options.add(Option.EXCLUDE_HIDDEN_ITEMS);
    options.add(content);
    projectExplorerContentQuery.setOptions(options);
    return projectExplorerContentQuery;
}
Also used : ActiveOptions(org.kie.workbench.common.screens.explorer.service.ActiveOptions) ProjectExplorerContentQuery(org.kie.workbench.common.screens.explorer.service.ProjectExplorerContentQuery)

Example 4 with ActiveOptions

use of org.kie.workbench.common.screens.explorer.service.ActiveOptions in project kie-wb-common by kiegroup.

the class BaseViewPresenterUpdateTest method setup.

@Before
public void setup() {
    when(view.getExplorer()).thenReturn(mock(Explorer.class));
    when(explorerServiceActual.getContent(any(ProjectExplorerContentQuery.class))).thenReturn(content);
    when(activeContextOptions.getOptions()).thenReturn(new ActiveOptions());
}
Also used : ActiveOptions(org.kie.workbench.common.screens.explorer.service.ActiveOptions) ProjectExplorerContentQuery(org.kie.workbench.common.screens.explorer.service.ProjectExplorerContentQuery) Explorer(org.kie.workbench.common.screens.explorer.client.widgets.navigator.Explorer) Before(org.junit.Before)

Example 5 with ActiveOptions

use of org.kie.workbench.common.screens.explorer.service.ActiveOptions in project kie-wb-common by kiegroup.

the class ProjectExplorerContentResolverDefaultSelectionsTest method getContentQuery.

private ProjectExplorerContentQuery getContentQuery(final Repository repository, final String branchName, final Module module) {
    final Branch branch = new Branch(branchName, mock(Path.class));
    final ProjectExplorerContentQuery moduleExplorerContentQuery = new ProjectExplorerContentQuery(repository, branch, module);
    doReturn(new WorkspaceProject(mock(OrganizationalUnit.class), repository, branch, module)).when(projectService).resolveProject(repository.getSpace(), branch);
    final ActiveOptions options = new ActiveOptions();
    options.add(Option.TREE_NAVIGATOR);
    options.add(Option.EXCLUDE_HIDDEN_ITEMS);
    options.add(Option.BUSINESS_CONTENT);
    moduleExplorerContentQuery.setOptions(options);
    return moduleExplorerContentQuery;
}
Also used : Path(org.uberfire.backend.vfs.Path) ActiveOptions(org.kie.workbench.common.screens.explorer.service.ActiveOptions) Branch(org.guvnor.structure.repositories.Branch) WorkspaceProject(org.guvnor.common.services.project.model.WorkspaceProject) ProjectExplorerContentQuery(org.kie.workbench.common.screens.explorer.service.ProjectExplorerContentQuery)

Aggregations

ActiveOptions (org.kie.workbench.common.screens.explorer.service.ActiveOptions)7 ProjectExplorerContentQuery (org.kie.workbench.common.screens.explorer.service.ProjectExplorerContentQuery)7 Test (org.junit.Test)3 Before (org.junit.Before)2 Explorer (org.kie.workbench.common.screens.explorer.client.widgets.navigator.Explorer)2 WorkspaceProject (org.guvnor.common.services.project.model.WorkspaceProject)1 Branch (org.guvnor.structure.repositories.Branch)1 ProjectExplorerContent (org.kie.workbench.common.screens.explorer.model.ProjectExplorerContent)1 Path (org.uberfire.backend.vfs.Path)1