Package org.sonar.core.component

Examples of org.sonar.core.component.ResourceComponent


      .setFieldChange(context, "resolution", null, "FIXED")
      .setSendNotifications(true)
      .setComponentKey("struts:Action.java")
      .setProjectKey("struts");
    Notification notification = issueNotifications.sendChanges(issue, context, null, new Project("struts"),
      new ResourceComponent(File.create("Action.java", "Action.java", null, false).setEffectiveKey("struts:Action.java"))).get(0);

    assertThat(notification.getFieldValue("message")).isEqualTo("the message");
    assertThat(notification.getFieldValue("key")).isEqualTo("ABCDE");
    assertThat(notification.getFieldValue("componentKey")).isEqualTo("struts:Action.java");
    assertThat(notification.getFieldValue("componentName")).isEqualTo("Action.java");
View Full Code Here


  ComponentDataCache cache = mock(ComponentDataCache.class);

  @Test
  public void should_load_default_perspective() throws Exception {
    Resource file = new File("foo.c").setEffectiveKey("myproject:path/to/foo.c");
    Component component = new ResourceComponent(file);

    HighlightableBuilder builder = new HighlightableBuilder(cache);
    Highlightable perspective = builder.loadPerspective(Highlightable.class, component);

    assertThat(perspective).isNotNull().isInstanceOf(DefaultHighlightable.class);
View Full Code Here

    assertThat(perspective.component()).isSameAs(component);
  }

  @Test
  public void project_should_not_be_highlightable() {
    Component component = new ResourceComponent(new Project("struts").setEffectiveKey("org.struts"));

    HighlightableBuilder builder = new HighlightableBuilder(cache);
    Highlightable perspective = builder.loadPerspective(Highlightable.class, component);

    assertThat(perspective).isNull();
View Full Code Here

  ProjectTree projectTree = mock(ProjectTree.class);

  @Test
  public void file_should_be_issuable() throws Exception {
    IssuableFactory factory = new IssuableFactory(moduleIssues, cache, projectTree);
    Component component = new ResourceComponent(new File("foo/bar.c").setEffectiveKey("foo/bar.c"));
    Issuable issuable = factory.loadPerspective(Issuable.class, component);

    assertThat(issuable).isNotNull();
    assertThat(issuable.component()).isSameAs(component);
    assertThat(issuable.issues()).isEmpty();
View Full Code Here

  }

  @Test
  public void project_should_be_issuable() throws Exception {
    IssuableFactory factory = new IssuableFactory(moduleIssues, cache, projectTree);
    Component component = new ResourceComponent(new Project("Foo").setEffectiveKey("foo"));
    Issuable issuable = factory.loadPerspective(Issuable.class, component);

    assertThat(issuable).isNotNull();
    assertThat(issuable.component()).isSameAs(component);
    assertThat(issuable.issues()).isEmpty();
View Full Code Here

TOP

Related Classes of org.sonar.core.component.ResourceComponent

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.