Package com.openshift.client.utils

Examples of com.openshift.client.utils.MessageAssert


      // 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


    } catch (OpenShiftEndpointException e) {
      RestResponse restResponse = e.getRestResponse();
      assertThat(restResponse).isNotNull();
      assertThat(restResponse.getMessages().size()).isEqualTo(1);
      Message message = restResponse.getMessages().getAll().iterator().next();
      assertThat(new MessageAssert(message))
          .hasText("Namespace 'foobar' is already in use. Please choose another.")
          .hasSeverity(Severity.ERROR)
          .hasExitCode(103)
          .hasField(new Field("id"));
    }
View Full Code Here

    assertThat(messages.getAll()).hasSize(3);
    List<Message> defaultMessages = messages.getBy(IField.DEFAULT);
    assertThat(defaultMessages).hasSize(3);
    List<Message> infoSeverityMessages = messages.getBy(IField.DEFAULT, ISeverity.INFO);
    assertThat(infoSeverityMessages).hasSize(1);
    new MessageAssert(infoSeverityMessages.get(0))
      .hasExitCode(0)
      .hasText("Application jekyll was created.");
    List<Message> debugSeverityMessages = app.getMessages().getBy(IField.DEFAULT, ISeverity.DEBUG);
    assertThat(debugSeverityMessages).hasSize(1);
    new MessageAssert(debugSeverityMessages.get(0))
      .hasExitCode(0)
      .hasText("The cartridge jenkins deployed a template application");
    List<Message> resultSeverityMessages = messages.getBy(IField.DEFAULT, ISeverity.RESULT);
    assertThat(resultSeverityMessages).hasSize(1);
    new MessageAssert(resultSeverityMessages.get(0))
        .hasExitCode(0)
        .hasText("Jenkins created successfully.  "
            + "Please make note of these credentials:\n   User: admin\n   Password: wLwSzJPh6dqN\n"
            + "Note:  You can change your password at: https://jekyll-foobarz.rhcloud.com/me/configure\n");
  }
View Full Code Here

    new EmbeddedCartridgeAssert(mySqlCartridge)
        .hasMessages()
        .hasDescription()
        .hasName(MYSQL_51_NAME);

    new MessageAssert(mySqlCartridge.getMessages().getFirstBy(IField.DEFAULT))
        .hasExitCode(-1)
        .hasText("Added mysql-5.1 to application springeap6");
    new MessageAssert(mySqlCartridge.getMessages().getFirstBy(IField.RESULT))
        .hasExitCode(0)
        .hasText(
            "\nMySQL 5.1 database added.  Please make note of these credentials:\n\n"
                + "       Root User: adminnFC22YQ\n   Root Password: U1IX8AIlrEcl\n   Database Name: springeap6\n\n"
                + "Connection URL: mysql://$OPENSHIFT_MYSQL_DB_HOST:$OPENSHIFT_MYSQL_DB_PORT/\n\n"
                + "You can manage your new MySQL database by also embedding phpmyadmin-3.4.\n"
                + "The phpmyadmin username and password will be the same as the MySQL credentials above.\n");
    new MessageAssert(mySqlCartridge.getMessages().getFirstBy(IField.APPINFO))
        .hasExitCode(0)
        .hasText("Connection URL: mysql://127.13.125.1:3306/\n");

  }
View Full Code Here

    // verifications
    Messages messages = response.getMessages();
    assertThat(messages.size()).isEqualTo(3);
    Collection<Message> defaultMessages = messages.getBy(IField.DEFAULT);
    assertThat(defaultMessages).isNotEmpty();
    new MessageAssert(defaultMessages.iterator().next())
        .hasField(IField.DEFAULT)
        .hasExitCode(-1)
        .hasText("Added mysql-5.1 to application springeap6");
    Collection<Message> resultMessages = messages.getBy(IField.RESULT);
    assertThat(resultMessages).isNotEmpty();
    new MessageAssert(resultMessages.iterator().next())
        .hasField(IField.RESULT)
        .hasExitCode(0)
        .hasText(
            "\nMySQL 5.1 database added.  Please make note of these credentials:\n\n"
                + "       Root User: adminnFC22YQ\n   Root Password: U1IX8AIlrEcl\n   Database Name: springeap6\n\n"
                + "Connection URL: mysql://$OPENSHIFT_MYSQL_DB_HOST:$OPENSHIFT_MYSQL_DB_PORT/\n\n"
                + "You can manage your new MySQL database by also embedding phpmyadmin-3.4.\n"
                + "The phpmyadmin username and password will be the same as the MySQL credentials above.\n");
    Collection<Message> appInfoMessages = messages.getBy(IField.APPINFO);
    assertThat(appInfoMessages).isNotEmpty();
    new MessageAssert(appInfoMessages.iterator().next())
        .hasField(IField.APPINFO)
        .hasExitCode(0)
        .hasText("Connection URL: mysql://127.13.125.1:3306/\n");

    assertThat(response.getDataType()).isEqualTo(EnumDataType.cartridge);
View Full Code Here

      fail("OpenShiftEndpointException did not occurr");
    } catch (OpenShiftEndpointException e) {
      // verification
      assertThat(e.getRestResponseMessages().size()).isEqualTo(1);
      List<Message> messages = e.getRestResponseMessage(IField.DEFAULT);
      new MessageAssert(messages.get(0))
          .hasExitCode(128)
          .hasSeverity(ISeverity.ERROR)
          .hasText();
    }
  }
View Full Code Here

TOP

Related Classes of com.openshift.client.utils.MessageAssert

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.