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);
}
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());
}
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;
}
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());
}
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;
}
Aggregations