Package org.sonar.core.properties

Examples of org.sonar.core.properties.PropertyDto


    // Project without modules
    when(componentDao.getNullableRootProjectByKey(project.key(), session)).thenReturn(project);
    when(componentDao.findModulesByProject(project.key(), session)).thenReturn(Collections.<ComponentDto>emptyList());

    when(propertiesDao.selectProjectProperties(project.key(), session)).thenReturn(newArrayList(
      new PropertyDto().setKey("sonar.jira.project.key").setValue("SONAR"),
      new PropertyDto().setKey("sonar.jira.login.secured").setValue("john")
      ));

    WsTester.TestRequest request = tester.newGetRequest("batch", "project").setParam("key", project.key());
    request.execute().assertJson(getClass(), "return_project_settings.json");
  }
View Full Code Here


    // Project without modules
    when(componentDao.getNullableRootProjectByKey(project.key(), session)).thenReturn(project);
    when(componentDao.findModulesByProject(project.key(), session)).thenReturn(Collections.<ComponentDto>emptyList());

    when(propertiesDao.selectProjectProperties(project.key(), session)).thenReturn(newArrayList(
      new PropertyDto().setKey("sonar.jira.project.key").setValue("SONAR"),
      new PropertyDto().setKey("sonar.jira.login.secured").setValue("john")
      ));

    WsTester.TestRequest request = tester.newGetRequest("batch", "project").setParam("key", project.key()).setParam("preview", "true");
    request.execute().assertJson(getClass(), "not_returned_secured_settings_with_only_preview_permission.json");
  }
View Full Code Here

    when(componentDao.getNullableRootProjectByKey(project.key(), session)).thenReturn(project);
    when(componentDao.findModulesByProject(project.key(), session)).thenReturn(newArrayList(module));

    when(propertiesDao.selectProjectProperties(project.key(), session)).thenReturn(newArrayList(
      new PropertyDto().setKey("sonar.jira.project.key").setValue("SONAR"),
      new PropertyDto().setKey("sonar.jira.login.secured").setValue("john")
      ));

    when(propertiesDao.selectProjectProperties(module.key(), session)).thenReturn(newArrayList(
      new PropertyDto().setKey("sonar.jira.project.key").setValue("SONAR-SERVER"),
      new PropertyDto().setKey("sonar.coverage.exclusions").setValue("**/*.java")
      ));

    WsTester.TestRequest request = tester.newGetRequest("batch", "project").setParam("key", project.key());
    request.execute().assertJson(getClass(), "return_project_with_module_settings.json");
  }
View Full Code Here

    when(componentDao.getNullableRootProjectByKey(project.key(), session)).thenReturn(project);
    when(componentDao.findModulesByProject(project.key(), session)).thenReturn(newArrayList(module));

    when(propertiesDao.selectProjectProperties(project.key(), session)).thenReturn(newArrayList(
      new PropertyDto().setKey("sonar.jira.project.key").setValue("SONAR"),
      new PropertyDto().setKey("sonar.jira.login.secured").setValue("john")
      ));
    // No property on module -> should have the same than project

    WsTester.TestRequest request = tester.newGetRequest("batch", "project").setParam("key", project.key());
    request.execute().assertJson(getClass(), "return_project_with_module_settings_inherited_from_project.json");
View Full Code Here

    when(componentDao.getNullableRootProjectByKey(project.key(), session)).thenReturn(project);
    when(componentDao.findModulesByProject(project.key(), session)).thenReturn(newArrayList(module));
    when(componentDao.findModulesByProject(module.key(), session)).thenReturn(newArrayList(subModule));

    when(propertiesDao.selectProjectProperties(project.key(), session)).thenReturn(newArrayList(
      new PropertyDto().setKey("sonar.jira.project.key").setValue("SONAR"),
      new PropertyDto().setKey("sonar.jira.login.secured").setValue("john")
      ));

    when(propertiesDao.selectProjectProperties(module.key(), session)).thenReturn(newArrayList(
      new PropertyDto().setKey("sonar.jira.project.key").setValue("SONAR-SERVER"),
      new PropertyDto().setKey("sonar.coverage.exclusions").setValue("**/*.java")
      ));

    when(propertiesDao.selectProjectProperties(subModule.key(), session)).thenReturn(newArrayList(
      new PropertyDto().setKey("sonar.jira.project.key").setValue("SONAR-SERVER-DAO")
      ));

    WsTester.TestRequest request = tester.newGetRequest("batch", "project").setParam("key", project.key());
    request.execute().assertJson(getClass(), "return_project_with_module_with_sub_module.json");
  }
View Full Code Here

    when(componentDao.getNullableRootProjectByKey(project.key(), session)).thenReturn(project);
    when(componentDao.findModulesByProject(project.key(), session)).thenReturn(newArrayList(module, module2));

    when(propertiesDao.selectProjectProperties(project.key(), session)).thenReturn(newArrayList(
      new PropertyDto().setKey("sonar.jira.project.key").setValue("SONAR"),
      new PropertyDto().setKey("sonar.jira.login.secured").setValue("john")
      ));

    when(propertiesDao.selectProjectProperties(module.key(), session)).thenReturn(newArrayList(
      new PropertyDto().setKey("sonar.jira.project.key").setValue("SONAR-SERVER"),
      // This property should not be found on the other module
      new PropertyDto().setKey("sonar.coverage.exclusions").setValue("**/*.java")
      ));

    when(propertiesDao.selectProjectProperties(module2.key(), session)).thenReturn(newArrayList(
      new PropertyDto().setKey("sonar.jira.project.key").setValue("SONAR-APPLICATION")
      ));

    WsTester.TestRequest request = tester.newGetRequest("batch", "project").setParam("key", project.key());
    request.execute().assertJson(getClass(), "return_project_with_two_modules.json");
  }
View Full Code Here

    // No root project will be found on provisioned project
    when(componentDao.getNullableRootProjectByKey(project.key(), session)).thenReturn(null);

    when(propertiesDao.selectProjectProperties(project.key(), session)).thenReturn(newArrayList(
      new PropertyDto().setKey("sonar.jira.project.key").setValue("SONAR"),
      new PropertyDto().setKey("sonar.jira.login.secured").setValue("john")
      ));

    WsTester.TestRequest request = tester.newGetRequest("batch", "project").setParam("key", project.key());
    request.execute().assertJson(getClass(), "return_project_settings.json");
  }
View Full Code Here

    when(componentDao.getNullableRootProjectByKey(subModule.key(), session)).thenReturn(project);
    when(componentDao.getParentModuleByKey(module.key(), session)).thenReturn(project);
    when(componentDao.getParentModuleByKey(subModule.key(), session)).thenReturn(module);

    when(propertiesDao.selectProjectProperties(subModule.key(), session)).thenReturn(newArrayList(
      new PropertyDto().setKey("sonar.jira.project.key").setValue("SONAR"),
      new PropertyDto().setKey("sonar.jira.login.secured").setValue("john"),
      new PropertyDto().setKey("sonar.coverage.exclusions").setValue("**/*.java")
      ));

    WsTester.TestRequest request = tester.newGetRequest("batch", "project").setParam("key", subModule.key());
    request.execute().assertJson(getClass(), "return_sub_module_settings.json");
  }
View Full Code Here

    when(componentDao.getNullableRootProjectByKey(subModule.key(), session)).thenReturn(project);
    when(componentDao.getParentModuleByKey(module.key(), session)).thenReturn(project);
    when(componentDao.getParentModuleByKey(subModule.key(), session)).thenReturn(module);

    when(propertiesDao.selectProjectProperties(project.key(), session)).thenReturn(newArrayList(
      new PropertyDto().setKey("sonar.jira.project.key").setValue("SONAR")
      ));

    when(propertiesDao.selectProjectProperties(module.key(), session)).thenReturn(newArrayList(
      new PropertyDto().setKey("sonar.jira.login.secured").setValue("john")
      ));

    when(propertiesDao.selectProjectProperties(subModule.key(), session)).thenReturn(newArrayList(
      new PropertyDto().setKey("sonar.coverage.exclusions").setValue("**/*.java")
      ));

    WsTester.TestRequest request = tester.newGetRequest("batch", "project").setParam("key", subModule.key());
    request.execute().assertJson(getClass(), "return_sub_module_settings_including_settings_from_parent_modules.json");
  }
View Full Code Here

    when(componentDao.getNullableRootProjectByKey(subModule.key(), session)).thenReturn(project);
    when(componentDao.getParentModuleByKey(module.key(), session)).thenReturn(project);
    when(componentDao.getParentModuleByKey(subModule.key(), session)).thenReturn(module);

    when(propertiesDao.selectProjectProperties(project.key(), session)).thenReturn(newArrayList(
      new PropertyDto().setKey("sonar.jira.project.key").setValue("SONAR"),
      new PropertyDto().setKey("sonar.jira.login.secured").setValue("john"),
      new PropertyDto().setKey("sonar.coverage.exclusions").setValue("**/*.java")
      ));
    // No settings on module or sub module -> All setting should come from the project

    WsTester.TestRequest request = tester.newGetRequest("batch", "project").setParam("key", subModule.key());
    request.execute().assertJson(getClass(), "return_sub_module_settings_inherited_from_project.json");
View Full Code Here

TOP

Related Classes of org.sonar.core.properties.PropertyDto

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.