Package org.sonar.wsclient

Examples of org.sonar.wsclient.Sonar.findAll()


  private static void testGetResources() {
    Sonar sonar = Sonar.create("https://sonar.corp.mobile.de/sonar");
    ResourceQuery projectResourceQuery = new ResourceQuery();
    projectResourceQuery.setQualifiers(Resource.QUALIFIER_PROJECT);
//        projectResourceQuery.
    List<Resource> projectResourceList = sonar.findAll(projectResourceQuery);
    for (Resource projectResource : projectResourceList) {
      System.out.println("##################################################");
      System.out.println(projectResource.toString() + " ::: " + projectResource.getQualifier());
      ResourceQuery moduleResourceQuery = new ResourceQuery(projectResource.getId());
      moduleResourceQuery.setDepth(-1);
View Full Code Here


      System.out.println("##################################################");
      System.out.println(projectResource.toString() + " ::: " + projectResource.getQualifier());
      ResourceQuery moduleResourceQuery = new ResourceQuery(projectResource.getId());
      moduleResourceQuery.setDepth(-1);
      moduleResourceQuery.setQualifiers(Resource.QUALIFIER_MODULE);
      List<Resource> moduleResourceList = sonar.findAll(moduleResourceQuery);
      for (Resource moduleResource : moduleResourceList) {
        System.out.println("     " + moduleResource.toString() + " ::: " + moduleResource.getQualifier());
      }
      System.out.println("##################################################");
    }
View Full Code Here

                if(userCredentials == null) {
                    sonar=Sonar.create(serverUrl);
                }else {
                    sonar=Sonar.create(serverUrl, userCredentials.getUsername(), PassEncoder.decodeAsString(userCredentials.getPassword()));
                }
                List<Rule> rules = sonar.findAll(ruleQuery);
                for(Rule rule:rules) {
                    if(rule.getKey().equals(ruleKey)) {
                        return rule;
                    }
                }
View Full Code Here

            if(userCredentials == null) {
                sonar=Sonar.create(serverUrl);
            }else {
                sonar=Sonar.create(serverUrl, userCredentials.getUsername(), PassEncoder.decodeAsString(userCredentials.getPassword()));
            }
            List<Resource> resources = sonar.findAll(new ResourceQuery());
            List<String> keys=new ArrayList<>(resources.size());
            for(Resource r:resources) {
                keys.add(r.getKey());
            }
            return keys;
View Full Code Here

            if(userCredentials == null) {
                sonar=Sonar.create(serverUrl);
            }else {
                sonar=Sonar.create(serverUrl, userCredentials.getUsername(), PassEncoder.decodeAsString(userCredentials.getPassword()));
            }
            List<Resource> resources = sonar.findAll(new ResourceQuery());
            List<SonarProject> projects=new ArrayList<>(resources.size());
            for(Resource r:resources) {
                projects.add(new SonarProject(r.getKey(), r.getName()));
            }
            return projects;
View Full Code Here

    @Override
    protected List<Rule> doInBackground() throws Exception {
        SonarProjectComponent component = project.getComponent(SonarProjectComponent.class);
        Sonar sonar = component.getSonar();
        return sonar.findAll(new RuleQuery("java"));
    }

    @Override
    protected void done() {
        try {
View Full Code Here

            return new ArrayList<T>();
        }
        Sonar sonar = getSonar();

        Query<T> query = getQuery(resourceKey);
        return sonar.findAll(query);
    }

    protected void notifyListeners(List<T> results) {
        for (RefreshListener<T> listener : this.listeners) {
            listener.doneRefresh(this.virtualFile, results);
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.