Search in sources :

Example 1 with REST_PORT

use of io.pravega.test.system.framework.Utils.REST_PORT in project pravega by pravega.

the class PravegaControllerTest method controllerTest.

/**
 * Invoke the controller test.
 * The test fails in case controller is not running on given ports.
 */
@Test
public void controllerTest() {
    log.debug("Start execution of controllerTest");
    Service con = Utils.createPravegaControllerService(null);
    List<URI> conUri = con.getServiceDetails();
    log.debug("Controller Service URI details: {} ", conUri);
    assertTrue(conUri.stream().map(URI::getPort).allMatch(port -> {
        switch(Utils.EXECUTOR_TYPE) {
            case REMOTE_SEQUENTIAL:
                return port == PravegaControllerService.CONTROLLER_PORT || port == PravegaControllerService.REST_PORT;
            case DOCKER:
                return port == CONTROLLER_GRPC_PORT || port == REST_PORT;
            case KUBERNETES:
            default:
                return port == CONTROLLER_GRPC_PORT || port == CONTROLLER_REST_PORT;
        }
    }));
    log.debug("ControllerTest  execution completed");
}
Also used : Environment(io.pravega.test.system.framework.Environment) MarathonException(mesosphere.marathon.client.MarathonException) CONTROLLER_GRPC_PORT(io.pravega.test.system.framework.services.kubernetes.AbstractService.CONTROLLER_GRPC_PORT) RunWith(org.junit.runner.RunWith) Assert.assertTrue(org.junit.Assert.assertTrue) Test(org.junit.Test) PravegaControllerService(io.pravega.test.system.framework.services.marathon.PravegaControllerService) Service(io.pravega.test.system.framework.services.Service) CONTROLLER_REST_PORT(io.pravega.test.system.framework.services.kubernetes.AbstractService.CONTROLLER_REST_PORT) Slf4j(lombok.extern.slf4j.Slf4j) List(java.util.List) Rule(org.junit.Rule) Timeout(org.junit.rules.Timeout) URI(java.net.URI) Utils(io.pravega.test.system.framework.Utils) SystemTestRunner(io.pravega.test.system.framework.SystemTestRunner) REST_PORT(io.pravega.test.system.framework.Utils.REST_PORT) PravegaControllerService(io.pravega.test.system.framework.services.marathon.PravegaControllerService) Service(io.pravega.test.system.framework.services.Service) URI(java.net.URI) Test(org.junit.Test)

Aggregations

Environment (io.pravega.test.system.framework.Environment)1 SystemTestRunner (io.pravega.test.system.framework.SystemTestRunner)1 Utils (io.pravega.test.system.framework.Utils)1 REST_PORT (io.pravega.test.system.framework.Utils.REST_PORT)1 Service (io.pravega.test.system.framework.services.Service)1 CONTROLLER_GRPC_PORT (io.pravega.test.system.framework.services.kubernetes.AbstractService.CONTROLLER_GRPC_PORT)1 CONTROLLER_REST_PORT (io.pravega.test.system.framework.services.kubernetes.AbstractService.CONTROLLER_REST_PORT)1 PravegaControllerService (io.pravega.test.system.framework.services.marathon.PravegaControllerService)1 URI (java.net.URI)1 List (java.util.List)1 Slf4j (lombok.extern.slf4j.Slf4j)1 MarathonException (mesosphere.marathon.client.MarathonException)1 Assert.assertTrue (org.junit.Assert.assertTrue)1 Rule (org.junit.Rule)1 Test (org.junit.Test)1 Timeout (org.junit.rules.Timeout)1 RunWith (org.junit.runner.RunWith)1