Package qubexplorer

Examples of qubexplorer.AuthorizationException


            query.setMetrics(VIOLATIONS_DENSITY_METRICS);
            Resource r = sonar.find(query);
            return r.getMeasure(VIOLATIONS_DENSITY_METRICS).getValue();
        } catch(ConnectionException ex) {
            if(isError401(ex)){
                throw new AuthorizationException(ex);
            }else{
                throw ex;
            }
        }
    }
View Full Code Here


                pageIndex++;
            }while(pageIndex <= result.paging().pages());
            return issues;
        }catch(HttpException ex) {
            if(ex.status() == UNAUTHORIZED_RESPONSE_STATUS){
                throw new AuthorizationException(ex);
            }else{
                throw ex;
            }
        }
    }
View Full Code Here

                client=SonarClient.builder().url(serverUrl).login(userCredentials.getUsername()).password(PassEncoder.decodeAsString(userCredentials.getPassword())).build();
            }
            return client.actionPlanClient().find(resource);
        }catch(HttpException ex) {
            if(ex.status() == UNAUTHORIZED_RESPONSE_STATUS){
                throw new AuthorizationException(ex);
            }else{
                throw ex;
            }
        }
    }
View Full Code Here

                        return rule;
                    }
                }
                return null;
            }else if(ex.status() == UNAUTHORIZED_RESPONSE_STATUS){
                throw new AuthorizationException(ex);
            }
            throw ex;
        }
    }
View Full Code Here

                keys.add(r.getKey());
            }
            return keys;
        }catch(ConnectionException ex) {
            if(isError401(ex)){
                throw new AuthorizationException(ex);
            }else{
                throw ex;
            }
        }
    }
View Full Code Here

                projects.add(new SonarProject(r.getKey(), r.getName()));
            }
            return projects;
        }catch(ConnectionException ex) {
            if(isError401(ex)){
                throw new AuthorizationException(ex);
            }else{
                throw ex;
            }
        }
    }
View Full Code Here

        Runner runner = createForProject(token, processMonitor);
        try {
            runner.execute();
        } catch (Exception ex) {
            if (wrapper.isUnauthorized()) {
                throw new AuthorizationException();
            } else {
                throw new SonarRunnerException(ex);
            }
        }
        if(processMonitor.stop()) {
View Full Code Here

    }

    @Test(timeout = 5000)
    public void shouldCallReset() throws Exception {
        when(task.execute())
                .thenThrow(new AuthorizationException())
                .thenReturn(Boolean.TRUE);
        TaskExecutor.execute(repository, task);
        task.waitForDestruction();
        verify(task).reset();
    }
View Full Code Here

    }

    @Test(timeout = 5000)
    public void shouldCallSuccessAfterAuthFailed() throws Exception {
        when(task.execute())
                .thenThrow(new AuthorizationException())
                .thenReturn(Boolean.TRUE);
        TaskExecutor.execute(repository, task);
        task.waitForDestruction();
        verify(task).success(Boolean.TRUE);
    }
View Full Code Here

TOP

Related Classes of qubexplorer.AuthorizationException

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.