Package org.sonar.api.component

Examples of org.sonar.api.component.Perspective


    GraphPerspectiveLoader perspectiveLoader = mock(GraphPerspectiveLoader.class);

    GraphPerspectiveBuilder perspectiveBuilder =
            new GraphPerspectiveBuilder(graph, MutablePerspective.class, null, perspectiveLoader) {};

    Perspective loadedPerspective = perspectiveBuilder.loadPerspective(MutablePerspective.class, component);

    assertThat(loadedPerspective).isNull();
  }
View Full Code Here


    when(perspectiveLoader.load(fileComponent)).thenReturn(expectedPerspective);

    GraphPerspectiveBuilder perspectiveBuilder =
            new GraphPerspectiveBuilder(graph, MutablePerspective.class, null, perspectiveLoader) {};

    Perspective loadedPerspective = perspectiveBuilder.loadPerspective(MutablePerspective.class, fileComponent);

    assertThat(loadedPerspective).isEqualTo(expectedPerspective);
  }
View Full Code Here

            };

    GraphPerspectiveBuilder perspectiveBuilder =
            new GraphPerspectiveBuilder(graph, MutablePerspective.class, null, perspectiveLoader) {};

    Perspective loadedPerspective = perspectiveBuilder.loadPerspective(MutablePerspective.class, fileComponent);

    assertThat(loadedPerspective).isNotNull();
    assertThat(loadedPerspective).isInstanceOf(DefaultMutablePerspective.class);
  }
View Full Code Here

  private void persistComponentGraph(GraphDtoMapper mapper, ComponentVertex component) {
    Long snapshotId = (Long) component.element().getProperty("sid");
    if (snapshotId != null) {
      for (PerspectiveBuilder builder : builders) {
        GraphPerspectiveBuilder graphPerspectiveBuilder = (GraphPerspectiveBuilder) builder;
        Perspective perspective = graphPerspectiveBuilder.getPerspectiveLoader().load(component);
        if (perspective != null) {
          serializePerspectiveData(mapper, component, snapshotId, graphPerspectiveBuilder);
        }
      }
    }
View Full Code Here

  @Test
  public void should_load_perspective() throws Exception {
    Component component = mock(Component.class);

    SymbolizableBuilder perspectiveBuilder = new SymbolizableBuilder(dataCache);
    Perspective perspective = perspectiveBuilder.loadPerspective(Symbolizable.class, component);

    assertThat(perspective).isInstanceOf(Symbolizable.class);
    assertThat(perspective.component()).isEqualTo(component);
  }
View Full Code Here

TOP

Related Classes of org.sonar.api.component.Perspective

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.