Package org.apache.oodt.cas.protocol.auth

Examples of org.apache.oodt.cas.protocol.auth.BasicAuthentication


        }

        // try connecting Protocol
        protocol.connect(
            remoteSite.getURL().getHost(),
            new BasicAuthentication(remoteSite.getUsername(), remoteSite
                .getPassword()));

        // check connection
        if (protocol.connected()
            && (!test || isOkProtocol(protocol, remoteSite))) {
View Full Code Here


    gMail.setUser("bfoster@google.com", "password");
    gMail.start();
    ImapsProtocol.port = gMail.getImaps().getPort();
    imapsProtocol = new ImapsProtocol();
    try {
      imapsProtocol.connect("localhost", new BasicAuthentication("bfoster@google.com", "password"));
    } catch (ProtocolException e) {
      fail("Failed to connect to GreenMail IMAPS server : " + e.getMessage());
    }
    assertEquals(1, ImapsProtocol.connectCalls);
  }
View Full Code Here

   }

   private Authentication getAuthentication(URI uri) {
      if (uri.getUserInfo() != null) {
         String[] userInfo = uri.getUserInfo().split("\\:");
         return new BasicAuthentication(userInfo[0], userInfo[1]);
      } else {
         return new NoAuthentication();
      }
   }
View Full Code Here

  }
 
  public void testLSandCDandPWD() throws ProtocolException {

        CogJGlobusFtpProtocol ftpProtocol = spy(new CogJGlobusFtpProtocol(PORT));
        BasicAuthentication auth = new BasicAuthentication("anonymous", "password");

        /** Mocking server responses to prevent server failure **/

        Mockito.doReturn("testdata").when(ftpProtocol).getCurentDir();

View Full Code Here

   public Authentication getAuthentication() {
      if (user == null || pass == null) {
         return new NoAuthentication();
      } else {
         return new BasicAuthentication(user, pass);
      }
   }
View Full Code Here

        }

        // try connecting Protocol
        protocol.connect(
            remoteSite.getURL().getHost(),
            new BasicAuthentication(remoteSite.getUsername(), remoteSite
                .getPassword()));

        // check connection
        if (protocol.connected()
            && (!test || isOkProtocol(protocol, remoteSite))) {
View Full Code Here

    server.stop();
  }
 
  public void testLSandCDandPWD() throws ProtocolException {
    CogJGlobusFtpProtocol ftpProtocol = new CogJGlobusFtpProtocol(PORT);
    ftpProtocol.connect("localhost", new BasicAuthentication("anonymous", "password"));
    ftpProtocol.cd(new ProtocolFile("testdata", true));
    List<ProtocolFile> lsResults = ftpProtocol.ls();
    assertTrue(lsResults.contains(new ProtocolFile(ftpProtocol.pwd(), "users.properties", false)));
  }
View Full Code Here

        }

        // try connecting Protocol
        protocol.connect(
            remoteSite.getURL().getHost(),
            new BasicAuthentication(remoteSite.getUsername(), remoteSite
                .getPassword()));

        // check connection
        if (protocol.connected()
            && (!test || isOkProtocol(protocol, remoteSite))) {
View Full Code Here

TOP

Related Classes of org.apache.oodt.cas.protocol.auth.BasicAuthentication

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.