Package org.jclouds.config

Examples of org.jclouds.config.ValueOfConfigurationKeyOrNull


   public void testWhenCredentialsNotPresentReturnsNull() {
      @SuppressWarnings("unchecked")
      Map<String, Credentials> credstore = createMock(Map.class);
      Credentials expected = null;

      ValueOfConfigurationKeyOrNull config = createMock(ValueOfConfigurationKeyOrNull.class);

      expect(credstore.containsKey("image")).andReturn(false);
      expect(config.apply("provider.image.login-user")).andReturn(null);
      expect(config.apply("jclouds.image.login-user")).andReturn(null);
      expect(config.apply("provider.image.authenticate-sudo")).andReturn(null);
      expect(config.apply("jclouds.image.authenticate-sudo")).andReturn(null);

      replay(config);
      replay(credstore);

      GetLoginForProviderFromPropertiesAndStoreCredentialsOrReturnNull fn = new GetLoginForProviderFromPropertiesAndStoreCredentialsOrReturnNull(
View Full Code Here


   public void testWhenCredentialsNotPresentAndProviderPropertyHasUser() {
      @SuppressWarnings("unchecked")
      Map<String, Credentials> credstore = createMock(Map.class);
      Credentials expected = new Credentials("ubuntu", null);

      ValueOfConfigurationKeyOrNull config = createMock(ValueOfConfigurationKeyOrNull.class);

      expect(credstore.containsKey("image")).andReturn(false);
      expect(config.apply("provider.image.login-user")).andReturn("ubuntu");
      expect(config.apply("provider.image.authenticate-sudo")).andReturn(null);
      expect(config.apply("jclouds.image.authenticate-sudo")).andReturn(null);
      expect(credstore.put("image", expected)).andReturn(null);

      replay(config);
      replay(credstore);
View Full Code Here

   public void testWhenCredentialsNotPresentAndJcloudsPropertyHasUser() {
      @SuppressWarnings("unchecked")
      Map<String, Credentials> credstore = createMock(Map.class);
      Credentials expected = new Credentials("ubuntu", null);

      ValueOfConfigurationKeyOrNull config = createMock(ValueOfConfigurationKeyOrNull.class);

      expect(credstore.containsKey("image")).andReturn(false);
      expect(config.apply("provider.image.login-user")).andReturn(null);
      expect(config.apply("jclouds.image.login-user")).andReturn("ubuntu");
      expect(config.apply("provider.image.authenticate-sudo")).andReturn(null);
      expect(config.apply("jclouds.image.authenticate-sudo")).andReturn(null);
      expect(credstore.put("image", expected)).andReturn(null);

      replay(config);
      replay(credstore);
View Full Code Here

   public void testWhenCredentialsAlreadyPresentReturnsSame() {
      @SuppressWarnings("unchecked")
      Map<String, Credentials> credstore = createMock(Map.class);
      Credentials expected = new Credentials("root", null);

      ValueOfConfigurationKeyOrNull config = createMock(ValueOfConfigurationKeyOrNull.class);

      expect(credstore.containsKey("image")).andReturn(true);
      expect(credstore.get("image")).andReturn(expected);

      replay(config);
View Full Code Here

   public void testWhenCredentialsNotPresentAndProviderPropertyHasUserAndPassword() {
      @SuppressWarnings("unchecked")
      Map<String, Credentials> credstore = createMock(Map.class);
      Credentials expected = new Credentials("ubuntu", "password");

      ValueOfConfigurationKeyOrNull config = createMock(ValueOfConfigurationKeyOrNull.class);

      expect(credstore.containsKey("image")).andReturn(false);
      expect(config.apply("provider.image.login-user")).andReturn("ubuntu:password");
      expect(config.apply("provider.image.authenticate-sudo")).andReturn(null);
      expect(config.apply("jclouds.image.authenticate-sudo")).andReturn(null);
      expect(credstore.put("image", expected)).andReturn(null);

      replay(config);
      replay(credstore);
View Full Code Here

   public void testWhenCredentialsNotPresentAndJcloudsPropertyHasUserAndPassword() {
      @SuppressWarnings("unchecked")
      Map<String, Credentials> credstore = createMock(Map.class);
      Credentials expected = new Credentials("ubuntu", "password");

      ValueOfConfigurationKeyOrNull config = createMock(ValueOfConfigurationKeyOrNull.class);

      expect(credstore.containsKey("image")).andReturn(false);
      expect(config.apply("provider.image.login-user")).andReturn(null);
      expect(config.apply("jclouds.image.login-user")).andReturn("ubuntu:password");
      expect(config.apply("provider.image.authenticate-sudo")).andReturn(null);
      expect(config.apply("jclouds.image.authenticate-sudo")).andReturn(null);
      expect(credstore.put("image", expected)).andReturn(null);

      replay(config);
      replay(credstore);
View Full Code Here

      @SuppressWarnings("unchecked")
      Map<String, Credentials> credstore = createMock(Map.class);
      LoginCredentials expected = LoginCredentials.builder().user("ubuntu").password("password").authenticateSudo(true)
            .build();

      ValueOfConfigurationKeyOrNull config = createMock(ValueOfConfigurationKeyOrNull.class);

      expect(credstore.containsKey("image")).andReturn(false);
      expect(config.apply("provider.image.login-user")).andReturn(null);
      expect(config.apply("jclouds.image.login-user")).andReturn("ubuntu:password");
      expect(config.apply("provider.image.authenticate-sudo")).andReturn(null);
      expect(config.apply("jclouds.image.authenticate-sudo")).andReturn("true");
      expect(credstore.put("image", expected)).andReturn(null);

      replay(config);
      replay(credstore);
View Full Code Here

      @SuppressWarnings("unchecked")
      Map<String, Credentials> credstore = createMock(Map.class);
      LoginCredentials expected = LoginCredentials.builder().user("ubuntu").password("password").authenticateSudo(true)
            .build();

      ValueOfConfigurationKeyOrNull config = createMock(ValueOfConfigurationKeyOrNull.class);

      expect(credstore.containsKey("image")).andReturn(false);
      expect(config.apply("provider.image.login-user")).andReturn("ubuntu:password");
      expect(config.apply("provider.image.authenticate-sudo")).andReturn("true");
      expect(credstore.put("image", expected)).andReturn(null);

      replay(config);
      replay(credstore);
View Full Code Here

   public void testWhenCredentialsNotPresentReturnsNull() {
      @SuppressWarnings("unchecked")
      Map<String, Credentials> credstore = createMock(Map.class);
      Credentials expected = null;

      ValueOfConfigurationKeyOrNull config = createMock(ValueOfConfigurationKeyOrNull.class);

      expect(credstore.containsKey("image")).andReturn(false);
      expect(config.apply("provider.image.login-user")).andReturn(null);
      expect(config.apply("jclouds.image.login-user")).andReturn(null);
      expect(config.apply("provider.image.authenticate-sudo")).andReturn(null);
      expect(config.apply("jclouds.image.authenticate-sudo")).andReturn(null);

      replay(config);
      replay(credstore);

      GetLoginForProviderFromPropertiesAndStoreCredentialsOrReturnNull fn = new GetLoginForProviderFromPropertiesAndStoreCredentialsOrReturnNull(
View Full Code Here

   public void testWhenCredentialsNotPresentAndProviderPropertyHasUser() {
      @SuppressWarnings("unchecked")
      Map<String, Credentials> credstore = createMock(Map.class);
      Credentials expected = new Credentials("ubuntu", null);

      ValueOfConfigurationKeyOrNull config = createMock(ValueOfConfigurationKeyOrNull.class);

      expect(credstore.containsKey("image")).andReturn(false);
      expect(config.apply("provider.image.login-user")).andReturn("ubuntu");
      expect(config.apply("provider.image.authenticate-sudo")).andReturn(null);
      expect(config.apply("jclouds.image.authenticate-sudo")).andReturn(null);
      expect(credstore.put("image", expected)).andReturn(null);

      replay(config);
      replay(credstore);
View Full Code Here

TOP

Related Classes of org.jclouds.config.ValueOfConfigurationKeyOrNull

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.