Package com.openshift.client

Examples of com.openshift.client.Messages


    }
    LOGGER.trace("Unmarshalling response\n{}", json);
    final ModelNode rootNode = getModelNode(json);
    final String type = rootNode.get(IOpenShiftJsonConstants.PROPERTY_TYPE).asString();
    final String status = rootNode.get(IOpenShiftJsonConstants.PROPERTY_STATUS).asString();
    final Messages messages = createMessages(rootNode.get(IOpenShiftJsonConstants.PROPERTY_MESSAGES));

    final EnumDataType dataType = EnumDataType.safeValueOf(type);
    // the response is after an error, only the messages are relevant
   
View Full Code Here


        }
        messages.add(message);
        messagesByField.put(message.getField(), messages);
      }
    }
    return new Messages(messagesByField);
  }
View Full Code Here

  private String getMessage(RestResponse restResponse, HttpClientException e) {
    if (restResponse == null) {
      return e.getMessage();
    }
    Messages messages = restResponse.getMessages();
    if (messages == null) {
      return "";
    }
    return messages.toString();
  }
View Full Code Here

    }
    LOGGER.trace("Unmarshalling response\n{}", content);
    final ModelNode rootNode = getModelNode(content);
    final String type = rootNode.get(IOpenShiftJsonConstants.PROPERTY_TYPE).asString();
    final String status = rootNode.get(IOpenShiftJsonConstants.PROPERTY_STATUS).asString();
    final Messages messages = createMessages(rootNode.get(IOpenShiftJsonConstants.PROPERTY_MESSAGES));

    final EnumDataType dataType = EnumDataType.safeValueOf(type);
    // the response is after an error, only the messages are relevant
   
View Full Code Here

        }
        messages.add(message);
        messagesByField.put(message.getField(), messages);
      }
    }
    return new Messages(messagesByField);
  }
View Full Code Here

  private String getMessage(RestResponse restResponse, HttpClientException e) {
    if (restResponse == null) {
      return e.getMessage();
    }
    Messages messages = restResponse.getMessages();
    if (messages == null) {
      return "";
    }
    return messages.toString();
  }
View Full Code Here

    }
    LOGGER.trace("Unmarshalling response\n{}", json);
    final ModelNode rootNode = getModelNode(json);
    final String type = getAsString(rootNode, IOpenShiftJsonConstants.PROPERTY_TYPE);
    final String status = getAsString(rootNode, IOpenShiftJsonConstants.PROPERTY_STATUS);
    final Messages messages = createMessages(rootNode.get(IOpenShiftJsonConstants.PROPERTY_MESSAGES));
    final EnumDataType dataType = EnumDataType.safeValueOf(type);
    final ModelNode dataNode = rootNode.get(IOpenShiftJsonConstants.PROPERTY_DATA);
    Object data = null;
    if (dataNode.isDefined()) {
      data = createData(dataType, messages, rootNode.get(IOpenShiftJsonConstants.PROPERTY_DATA));
View Full Code Here

        }
        messages.add(message);
        messagesByField.put(message.getField(), messages);
      }
    }
    return new Messages(messagesByField);
  }
View Full Code Here

      // verification
      fail("exception expected");
    } catch (OpenShiftEndpointException e) {
      // verification
      assertThat(e.getRestResponse()).isNotNull();
      Messages messages = e.getRestResponse().getMessages();
      assertThat(messages.size()).isGreaterThan(0);
      Message firstMessage = messages.getAll().iterator().next();
      new MessageAssert(firstMessage)
          .hasExitCode(128)
          .hasSeverity(Severity.ERROR)
          .hasText("Domain contains applications. Delete applications first or set force to true.");
    }
View Full Code Here

    assertThat(content).contains(contains);
    return this;
  }

  public ApplicationAssert hasMessage(IField field, ISeverity severity) throws IOException {
    Messages messages = application.getMessages();
    assertThat(messages).isNotNull();
    List<Message> matchingMessages = messages.getBy(field, severity);
    assertThat(matchingMessages).isNotEmpty();
    return this;
  }
View Full Code Here

TOP

Related Classes of com.openshift.client.Messages

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.