Examples of uuid()


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

      .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

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

      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

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

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

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

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

    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

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

    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

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

      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

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

    MockUserSession.set().setLogin("admin").addProjectPermissions(UserRole.ADMIN, "org.sample.Sample");

    service.removePermission(params);

    verify(permissionFacade).deleteGroupPermission(eq(10L), eq(2L), eq("codeviewer"), eq(session));
    verify(issueAuthorizationDao).synchronizeAfter(eq(session), any(Date.class), eq(ImmutableMap.of("project", project.uuid())));
  }

  @Test
  public void remove_global_permission_from_anyone_group() throws Exception {
    params = buildPermissionChangeParams(null, DefaultGroups.ANYONE, GlobalPermissions.QUALITY_PROFILE_ADMIN);
View Full Code Here

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

    MockUserSession.set().setLogin("admin").addProjectPermissions(UserRole.ADMIN, "org.sample.Sample");

    service.removePermission(params);

    verify(permissionFacade).deleteGroupPermission(eq(10L), eq((Long) null), eq("codeviewer"), eq(session));
    verify(issueAuthorizationDao).synchronizeAfter(eq(session), any(Date.class), eq(ImmutableMap.of("project", project.uuid())));
  }

  @Test
  public void skip_redundant_add_global_user_permission_change() throws Exception {
    params = buildPermissionChangeParams("user", null, GlobalPermissions.QUALITY_PROFILE_ADMIN);
View Full Code Here

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

    verify(permissionFacade).applyPermissionTemplate(session, "my_template_key", 2L);
    verify(permissionFacade).applyPermissionTemplate(session, "my_template_key", 3L);

    verify(issueAuthorizationDao).synchronizeAfter(eq(session), any(Date.class), eq(ImmutableMap.of("project", project1.uuid())));
    verify(issueAuthorizationDao).synchronizeAfter(eq(session), any(Date.class), eq(ImmutableMap.of("project", project2.uuid())));
    verify(issueAuthorizationDao).synchronizeAfter(eq(session), any(Date.class), eq(ImmutableMap.of("project", project3.uuid())));
  }

  @Test(expected = ForbiddenException.class)
  public void apply_permission_template_on_many_projects_without_permission() {
    MockUserSession.set().setLogin("admin").setGlobalPermissions();
View Full Code Here

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

    when(componentDao.getByKey(session, "org.sample.Sample")).thenReturn(project);

    service.applyPermissionTemplate(params);

    verify(permissionFacade).applyPermissionTemplate(session, "my_template_key", 1L);
    verify(issueAuthorizationDao).synchronizeAfter(eq(session), any(Date.class), eq(ImmutableMap.of("project", project.uuid())));
  }

  @Test(expected = ForbiddenException.class)
  public void apply_permission_template_on_one_project_without_permission() {
    MockUserSession.set().setLogin("admin").addProjectPermissions(UserRole.ADMIN);
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.