Package org.sonar.api.resources

Examples of org.sonar.api.resources.Project


    verify(issueDao).selectNonClosedIssuesByModule(eq(1), any(ResultHandler.class));
  }

  @Test
  public void should_select_module_open_issues_changelog() {
    Project project = new Project("key");
    project.setId(1);
    sensor.analyse(project, null);

    verify(issueChangeDao).selectChangelogOnNonClosedIssuesByModuleAndType(eq(1), any(ResultHandler.class));
  }
View Full Code Here


  }

  @Test
  public void should_add_measure() throws Exception {
    MeasureCache cache = new MeasureCache(caches, metricFinder, techDebtModel);
    Project p = new Project("struts");

    assertThat(cache.entries()).hasSize(0);

    assertThat(cache.byResource(p)).hasSize(0);
View Full Code Here

  }

  @Test
  public void should_add_measure_with_big_data() throws Exception {
    MeasureCache cache = new MeasureCache(caches, metricFinder, techDebtModel);
    Project p = new Project("struts");

    assertThat(cache.entries()).hasSize(0);

    assertThat(cache.byResource(p)).hasSize(0);
View Full Code Here

   * This test fails with stock PersisitIt.
   */
  @Test
  public void should_add_measure_with_too_big_data_for_persistit_pre_patch() throws Exception {
    MeasureCache cache = new MeasureCache(caches, metricFinder, techDebtModel);
    Project p = new Project("struts");

    assertThat(cache.entries()).hasSize(0);

    assertThat(cache.byResource(p)).hasSize(0);

View Full Code Here

  }

  @Test
  public void should_add_measure_with_too_big_data_for_persistit() throws Exception {
    MeasureCache cache = new MeasureCache(caches, metricFinder, techDebtModel);
    Project p = new Project("struts");

    assertThat(cache.entries()).hasSize(0);

    assertThat(cache.byResource(p)).hasSize(0);
View Full Code Here

  }

  @Test
  public void should_add_measure_with_same_metric() throws Exception {
    MeasureCache cache = new MeasureCache(caches, metricFinder, techDebtModel);
    Project p = new Project("struts");

    assertThat(cache.entries()).hasSize(0);
    assertThat(cache.byResource(p)).hasSize(0);

    Measure m1 = new Measure(CoreMetrics.NCLOC, 1.0);
View Full Code Here

  }

  @Test
  public void should_get_measures() throws Exception {
    MeasureCache cache = new MeasureCache(caches, metricFinder, techDebtModel);
    Project p = new Project("struts");
    Resource dir = new Directory("foo/bar").setEffectiveKey("struts:foo/bar");
    Resource file1 = new File("foo/bar/File1.txt").setEffectiveKey("struts:foo/bar/File1.txt");
    Resource file2 = new File("foo/bar/File2.txt").setEffectiveKey("struts:foo/bar/File2.txt");

    assertThat(cache.entries()).hasSize(0);
View Full Code Here

    when(handler1.getArtifactId()).thenReturn("myartifact1");

    MavenPluginHandler handler2 = mock(MavenPluginHandler.class);
    when(handler2.getArtifactId()).thenReturn("myartifact2");

    Project project = MavenTestUtils.loadProjectFromPom(getClass(), "pom.xml");

    newConfigurator(handler1, handler2).execute(project);

    verify(handler1).configure(eq(project), argThat(new IsMavenPlugin("myartifact1")));
    verify(handler2).configure(eq(project), argThat(new IsMavenPlugin("myartifact2")));
View Full Code Here

    assertThat(results.paging()).isNull();
    assertThat(results.components().size()).isEqualTo(3);
  }

  private Component createProject(String key, String name) {
    return new Project(key, null, name);
  }
View Full Code Here

public class MavenSurefireUtilsTest {

  @Test
  public void shouldConfigureProject() {
    Project prj = mock(Project.class);
    when(prj.getPom()).thenReturn(MavenTestUtils.loadPom("/org/sonar/api/batch/maven/MavenSurefireUtilsTest/MavenPom.xml"));

    MavenPlugin configuredPlugin = MavenSurefireUtils.configure(prj);
    assertEquals("true", configuredPlugin.getParameter("testFailureIgnore"));
    assertEquals("false", configuredPlugin.getParameter("disableXmlReport"));
    assertEquals(MavenSurefireUtils.VERSION, configuredPlugin.getPlugin().getVersion());
View Full Code Here

TOP

Related Classes of org.sonar.api.resources.Project

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.