Package qubexplorer

Examples of qubexplorer.UserCredentials


        authentication=null;
        setVisible(false);
    }//GEN-LAST:event_cancelButtonActionPerformed

    private void acceptButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_acceptButtonActionPerformed
        authentication=new UserCredentials(usernameField.getText(), passwordField.getPassword());
        setVisible(false);
    }//GEN-LAST:event_acceptButtonActionPerformed
View Full Code Here


    public static UserCredentials showAuthDialog(Frame frame) {
        AuthDialog authDialog = new AuthDialog(frame, true);
        authDialog.setLocationRelativeTo(frame);
        authDialog.setVisible(true);
        UserCredentials auth = authDialog.getAuthentication();
        authDialog.dispose();
        return auth;
    }
View Full Code Here

public class AuthenticationRepositoryTest {
   
    @Test
    public void shouldContaintAuthentication(){
        AuthenticationRepository repo=AuthenticationRepository.getInstance();
        UserCredentials auth=new UserCredentials("one", "two".toCharArray());
        repo.saveAuthentication("url", "key", auth);
        assertThat(repo.getAuthentication("url", "key"), is(auth));
        assertThat(repo.getAuthentication("url", "key2"), is(auth));
        UserCredentials auth2=new UserCredentials("one", "two".toCharArray());
        repo.saveAuthentication("url2", null, auth2);
        assertThat(repo.getAuthentication("url2", "key"), is(auth2));
        assertThat(repo.getAuthentication("url2", "key2"), is(auth2));
        assertNull(repo.getAuthentication("url3", "key2"));
    }
View Full Code Here

    @Mock
    private AuthenticationRepository repository;

    @Before
    public void init() {
        when(repository.getAuthentication(anyString(), anyString())).thenReturn(new UserCredentials("username", new char[0]));
    }
View Full Code Here

                    assert task.getServerUrl() != null;
                    String resourceKey = null;
                    if (task.getProjectContext() != null) {
                        resourceKey = task.getProjectContext().getProjectKey();
                    }
                    UserCredentials auth = authenticationRepository.getAuthentication(task.getServerUrl(), resourceKey);
                    if (auth == null) {
                        auth = AuthDialog.showAuthDialog(WindowManager.getDefault().getMainWindow());
                    }
                    if (auth != null) {
                        willRetry = true;
View Full Code Here

TOP

Related Classes of qubexplorer.UserCredentials

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.