Package com.openshift.client.fakes

Examples of com.openshift.client.fakes.SystemConfigurationFake


  public OpenShiftTestConfiguration() throws IOException, OpenShiftException {
    super(new SystemPropertiesFake(
        new IntegrationTestConfiguration(
            new UserConfigurationFake(
                new SystemConfigurationFake(
                    new DefaultConfiguration())))));
  }
View Full Code Here


    assertEquals(ANOTHER_USERNAME, userConfiguration2.getRhlogin());
  }

  @Test
  public void canReadUsernameIfItsInSystemConfigurationOnly() throws OpenShiftException, IOException {
    SystemConfiguration systemConfiguration = new SystemConfigurationFake(new DefaultConfiguration()) {

      protected void init(Properties properties) {
        properties.put(KEY_RHLOGIN, USERNAME);
      }
View Full Code Here

    assertEquals(USERNAME, userConfiguration.getRhlogin());
  }

  @Test
  public void usernameInUserconfigOverridesUsernameInSystemconfig() throws OpenShiftException, IOException {
    SystemConfiguration systemConfiguration = new SystemConfigurationFake(new DefaultConfiguration()) {

      protected void init(Properties properties) {
        properties.put(KEY_RHLOGIN, USERNAME);
      }
View Full Code Here

    assertEquals(USERNAME2, userConfiguration.getRhlogin());
  }

  @Test
  public void quotedLibraServerIsReturnedWithoutQuotes() throws OpenShiftException, IOException {
    SystemConfiguration systemConfiguration = new SystemConfigurationFake(new DefaultConfiguration()) {

      protected void init(Properties properties) {
        properties.put(KEY_LIBRA_SERVER, SIGLEQUOTED_LIBRA_SERVER);
      }
View Full Code Here

    assertEquals(UrlUtils.SCHEME_HTTPS + LIBRA_SERVER, userConfiguration.getLibraServer());
  }

  @Test
  public void doubleQuotedLibraServerIsReturnedWithoutQuotes() throws OpenShiftException, IOException {
    SystemConfiguration systemConfiguration = new SystemConfigurationFake(new DefaultConfiguration()) {

      protected void init(Properties properties) {
        properties.put(KEY_LIBRA_SERVER, DOUBLEQUOTED_LIBRA_SERVER);
      }
View Full Code Here

    assertEquals(UrlUtils.SCHEME_HTTPS + LIBRA_SERVER, userConfiguration.getLibraServer());
  }

  @Test
  public void nonQuotedLibraServerIsReturnedAsIs() throws OpenShiftException, IOException {
    SystemConfiguration systemConfiguration = new SystemConfigurationFake(new DefaultConfiguration()) {

      protected void init(Properties properties) {
        properties.put(KEY_LIBRA_SERVER, LIBRA_SERVER);
      }
View Full Code Here

    assertEquals(UrlUtils.SCHEME_HTTPS + LIBRA_SERVER, userConfiguration.getLibraServer());
  }

  @Test
  public void nullLibraServerIsReturnedAsNull() throws OpenShiftException, IOException {
    SystemConfiguration systemConfiguration = new SystemConfigurationFake();
    assertNull(systemConfiguration.getLibraServer());
  }
View Full Code Here

    assertNull(systemConfiguration.getLibraServer());
  }

  @Test
  public void systemPropsOverrideSystemconfig() throws OpenShiftException, IOException {
    SystemConfiguration systemConfiguration = new SystemConfigurationFake(new DefaultConfiguration()) {

      @Override
      protected void init(Properties properties) {
        properties.put(KEY_RHLOGIN, USERNAME);
      }
View Full Code Here

    assertEquals(USERNAME3, configuration.getRhlogin());
  }

  @Test
  public void emptySystemPropertiesDefaultToUserConfig() throws OpenShiftException, IOException {
    SystemConfiguration systemConfiguration = new SystemConfigurationFake(new DefaultConfiguration()) {

      @Override
      protected void init(Properties properties) {
        properties.put(KEY_RHLOGIN, USERNAME);
      }
View Full Code Here

  }

  @Test
  public void fallsBackToDefaultUrl() throws OpenShiftException, IOException {
    IOpenShiftConfiguration configuration = new EmptySystemPropertiesFake(
        new UserConfigurationFake(new SystemConfigurationFake(new DefaultConfiguration())));
    assertNotNull(configuration.getLibraServer());
    assertTrue(configuration.getLibraServer().contains(DefaultConfiguration.LIBRA_SERVER));
    assertNull(configuration.getRhlogin());
  }
View Full Code Here

TOP

Related Classes of com.openshift.client.fakes.SystemConfigurationFake

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.