Package rabbit.ui.internal.util

Examples of rabbit.ui.internal.util.ICategoryProvider


  @Test
  public void shouldPersistTheCategories() {
    final List<Category> expected = asList(DATE, FILE);
    final List<Category> actual = Lists.newArrayList();

    ICategoryProvider provider = mock(ICategoryProvider.class);
    doAnswer(new Answer<Void>() {
      @Override
      public Void answer(InvocationOnMock invocation) throws Throwable {
        for (Object obj : invocation.getArguments()) {
          actual.add((Category) obj);
View Full Code Here


  @Override
  public void shouldCorrectlyBuildASinglePath() {
    ICategory[] categories = {Category.DATE, Category.WORKSPACE};
    List<TreePath> expected = asList(newPath(date, ws, duration));

    ICategoryProvider provider = mock(ICategoryProvider.class);
    given(provider.getSelected()).willReturn(asList(categories));
    ITreePathBuilder builder = create(provider);

    ISessionDataProvider input = mock(ISessionDataProvider.class);
    given(input.get()).willReturn(asList(data));
    List<TreePath> actual = builder.build(input);
View Full Code Here

    ISessionData data2 = mock(ISessionData.class);
    given(data2.get(ISessionData.DATE)).willReturn(date2);
    given(data2.get(ISessionData.DURATION)).willReturn(duration2);
    given(data2.get(ISessionData.WORKSPACE)).willReturn(ws2);

    ICategoryProvider provider = mock(ICategoryProvider.class);
    given(provider.getSelected()).willReturn(asList(categories));
    ITreePathBuilder builder = create(provider);

    ISessionDataProvider input = mock(ISessionDataProvider.class);
    given(input.get()).willReturn(asList(data, data2));
    List<TreePath> actual = builder.build(input);
View Full Code Here

    ICategory[] categories = {Category.DATE, Category.WORKSPACE};
    List<TreePath> expected = asList(
        newPath(date, ws, duration),
        newPath(date, ws, duration));

    ICategoryProvider provider = mock(ICategoryProvider.class);
    given(provider.getSelected()).willReturn(asList(categories));
    ITreePathBuilder builder = create(provider);

    ISessionDataProvider input = mock(ISessionDataProvider.class);
    given(input.get()).willReturn(asList(data, data));
    List<TreePath> actual = builder.build(input);
View Full Code Here

    given(data.get(IPerspectiveData.DURATION)).willReturn(duration);
    given(data.get(IPerspectiveData.WORKSPACE)).willReturn(ws);
    given(data.get(IPerspectiveData.PERSPECTIVE_ID)).willReturn(
        undefined.getId());

    ICategoryProvider provider = mock(ICategoryProvider.class);
    given(provider.getSelected()).willReturn(asList(categories));
    ITreePathBuilder builder = create(provider);

    IPerspectiveDataProvider input = mock(IPerspectiveDataProvider.class);
    given(input.get()).willReturn(asList(data));
    List<TreePath> actual = builder.build(input);
View Full Code Here

  public void shouldCorrectlyBuildASinglePath() {
    ICategory[] categories = {
        Category.DATE, Category.WORKSPACE, Category.PERSPECTIVE};
    List<TreePath> expected = asList(newPath(date, ws, perspective, duration));

    ICategoryProvider provider = mock(ICategoryProvider.class);
    given(provider.getSelected()).willReturn(asList(categories));
    ITreePathBuilder builder = create(provider);

    IPerspectiveDataProvider input = mock(IPerspectiveDataProvider.class);
    given(input.get()).willReturn(asList(data));
    List<TreePath> actual = builder.build(input);
View Full Code Here

    given(data2.get(IPerspectiveData.DATE)).willReturn(date2);
    given(data2.get(IPerspectiveData.DURATION)).willReturn(duration2);
    given(data2.get(IPerspectiveData.WORKSPACE)).willReturn(ws2);
    given(data2.get(IPerspectiveData.PERSPECTIVE_ID)).willReturn(p2.getId());

    ICategoryProvider provider = mock(ICategoryProvider.class);
    given(provider.getSelected()).willReturn(asList(categories));
    ITreePathBuilder builder = create(provider);

    IPerspectiveDataProvider input = mock(IPerspectiveDataProvider.class);
    given(input.get()).willReturn(asList(data, data2));
    List<TreePath> actual = builder.build(input);
View Full Code Here

    ICategory[] categories = {Category.DATE, Category.WORKSPACE};
    List<TreePath> expected = asList(
        newPath(date, ws, duration),
        newPath(date, ws, duration));

    ICategoryProvider provider = mock(ICategoryProvider.class);
    given(provider.getSelected()).willReturn(asList(categories));
    ITreePathBuilder builder = create(provider);

    IPerspectiveDataProvider input = mock(IPerspectiveDataProvider.class);
    given(input.get()).willReturn(asList(data, data));
    List<TreePath> actual = builder.build(input);
View Full Code Here

        .createChildPath(fileHasNoParent);

    // Mocks:
    ILaunchDataProvider input = mock(ILaunchDataProvider.class);
    given(input.get()).willReturn(Arrays.asList(dataNode));
    ICategoryProvider provider = mock(ICategoryProvider.class);
    given(provider.getSelected()).willReturn(asList(categories));
    LaunchDataTreeBuilder builder = create(provider);

    // Test:
    Collection<TreePath> actual = builder.build(input);
    assertThat(actual, hasItems(expected1, expected2, expected3, expected4));
View Full Code Here

    TreePath p6 = base.createChildPath(duration);

    // Mocks:
    ILaunchDataProvider input = mock(ILaunchDataProvider.class);
    given(input.get()).willReturn(Arrays.asList(dataNode, dataNode2));
    ICategoryProvider provider = mock(ICategoryProvider.class);
    given(provider.getSelected()).willReturn(asList(categories));
    LaunchDataTreeBuilder builder = create(provider);

    // Test:
    Collection<TreePath> actual = builder.build(input);
    assertThat(actual, hasItems(p1, p2, p3, p4, p5, p6));
View Full Code Here

TOP

Related Classes of rabbit.ui.internal.util.ICategoryProvider

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.