Package org.sonar.core.component

Examples of org.sonar.core.component.ComponentDto.uuid()


      .setKey("org.sonar.server.issue.IssueClient")
      .setLongName("SonarQube :: Issue Client")
      .setName("SonarQube :: Issue Client")
      .setQualifier("FIL")
      .setSubProjectId(1L);
    when(componentDao.getByUuid(session, file.uuid())).thenReturn(file);

    DefaultIssue issue = createIssue()
      .setComponentUuid(file.uuid())
      .setProjectUuid(project.uuid());
    when(issueService.getByKey(issueKey)).thenReturn(issue);
View Full Code Here


      .setQualifier("FIL")
      .setSubProjectId(1L);
    when(componentDao.getByUuid(session, file.uuid())).thenReturn(file);

    DefaultIssue issue = createIssue()
      .setComponentUuid(file.uuid())
      .setProjectUuid(project.uuid());
    when(issueService.getByKey(issueKey)).thenReturn(issue);

    MockUserSession.set();
    WsTester.TestRequest request = tester.newGetRequest("api/issues", "show").setParam("key", issueKey);
View Full Code Here

    ComponentDto project = ComponentTesting.newProjectDto()
      .setId(1L)
      .setKey("org.sonar.Sonar")
      .setLongName("SonarQube")
      .setName("SonarQube");
    when(componentDao.getByUuid(session, project.uuid())).thenReturn(project);

    ComponentDto file = ComponentTesting.newFileDto(project)
      .setId(10L)
      .setKey("org.sonar.server.issue.IssueClient")
      .setLongName("SonarQube :: Issue Client")
View Full Code Here

      .setKey("org.sonar.server.issue.IssueClient")
      .setLongName("SonarQube :: Issue Client")
      .setName("SonarQube :: Issue Client")
      .setQualifier("FIL")
      .setSubProjectId(1L);
    when(componentDao.getByUuid(session, file.uuid())).thenReturn(file);

    return createIssue()
      .setComponentUuid(file.uuid())
      .setProjectUuid(project.uuid());
  }
View Full Code Here

      .setQualifier("FIL")
      .setSubProjectId(1L);
    when(componentDao.getByUuid(session, file.uuid())).thenReturn(file);

    return createIssue()
      .setComponentUuid(file.uuid())
      .setProjectUuid(project.uuid());
  }

  private DefaultIssue createIssue() {
    return new DefaultIssue()
View Full Code Here

      ComponentDto project = dbClient.componentDao().getByKey(dbSession, projectKey);
      if (!Scopes.PROJECT.equals(project.scope())) {
        throw new IllegalArgumentException("Only project can be deleted");
      }
      purgeDao.deleteResourceTree(project.getId());
      deletePermissionIndexes(dbSession, project.uuid());
      dbSession.commit();

      deleteIssuesFromIndex(project.uuid());
    } finally {
      MyBatis.closeQuietly(dbSession);
View Full Code Here

      }
      purgeDao.deleteResourceTree(project.getId());
      deletePermissionIndexes(dbSession, project.uuid());
      dbSession.commit();

      deleteIssuesFromIndex(project.uuid());
    } finally {
      MyBatis.closeQuietly(dbSession);
    }
  }
View Full Code Here

    Result<Issue> result = issueIndex.search(IssueQuery.builder().build(), new QueryContext());
    LOGGER.info("Search for all issues : returned {} issues in {} ms", result.getTotal(), System.currentTimeMillis() - start);

    start = System.currentTimeMillis();
    ComponentDto project = componentsByProject.keySet().iterator().next();
    result = issueIndex.search(IssueQuery.builder().projectUuids(newArrayList(project.uuid())).build(), new QueryContext());
    LOGGER.info("Search for issues from one project : returned {} issues in {} ms", result.getTotal(), System.currentTimeMillis() - start);

    start = System.currentTimeMillis();
    ComponentDto file = componentsByProject.get(project).get(0);
    result = issueIndex.search(IssueQuery.builder().componentUuids(newArrayList(file.uuid())).build(), new QueryContext());
View Full Code Here

    result = issueIndex.search(IssueQuery.builder().projectUuids(newArrayList(project.uuid())).build(), new QueryContext());
    LOGGER.info("Search for issues from one project : returned {} issues in {} ms", result.getTotal(), System.currentTimeMillis() - start);

    start = System.currentTimeMillis();
    ComponentDto file = componentsByProject.get(project).get(0);
    result = issueIndex.search(IssueQuery.builder().componentUuids(newArrayList(file.uuid())).build(), new QueryContext());
    LOGGER.info("Search for issues from one file : returned {} issues in {} ms", result.getTotal(), System.currentTimeMillis() - start);
  }

  private void generateData() {
    long ids = 1;
View Full Code Here

      projects.add(project);

      // All project are visible by anyone
      // TODO set different groups/users to test search issues queries with more realistic data
      batchSession.enqueue(new InsertDto<IssueAuthorizationDto>(IndexDefinition.ISSUES_AUTHORIZATION.getIndexType(),
        new IssueAuthorizationDto().setProjectUuid(project.uuid()).setGroups(newArrayList(DefaultGroups.ANYONE)), false));

      for (int fileIndex = 0; fileIndex < NUMBER_FILES_PER_PROJECT; fileIndex++) {
        String index = projectIndex * PROJECTS_NUMBER + fileIndex + "";
        ComponentDto file = ComponentTesting.newFileDto(project)
          .setId(ids++)
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.