Search in sources :

Example 1 with WebSocketProxyConfiguration

use of com.yahoo.pulsar.websocket.service.WebSocketProxyConfiguration in project pulsar by yahoo.

the class ProxyAuthenticationTest method setup.

@BeforeClass
public void setup() throws Exception {
    super.internalSetup();
    super.producerBaseSetup();
    WebSocketProxyConfiguration config = new WebSocketProxyConfiguration();
    config.setWebServicePort(TEST_PORT);
    config.setClusterName("use");
    config.setAuthenticationEnabled(true);
    config.setAuthenticationProviders(Sets.newHashSet("com.yahoo.pulsar.websocket.proxy.MockAuthenticationProvider"));
    service = spy(new WebSocketService(config));
    doReturn(mockZooKeeperClientFactory).when(service).getZooKeeperClientFactory();
    proxyServer = new ProxyServer(config);
    WebSocketServiceStarter.start(proxyServer, service);
    log.info("Proxy Server Started");
}
Also used : WebSocketProxyConfiguration(com.yahoo.pulsar.websocket.service.WebSocketProxyConfiguration) WebSocketService(com.yahoo.pulsar.websocket.WebSocketService) ProxyServer(com.yahoo.pulsar.websocket.service.ProxyServer) BeforeClass(org.testng.annotations.BeforeClass)

Example 2 with WebSocketProxyConfiguration

use of com.yahoo.pulsar.websocket.service.WebSocketProxyConfiguration in project pulsar by yahoo.

the class ProxyAuthorizationTest method setup.

@BeforeClass
@Override
protected void setup() throws Exception {
    conf.setClusterName("c1");
    internalSetup();
    WebSocketProxyConfiguration config = new WebSocketProxyConfiguration();
    Set<String> superUser = Sets.newHashSet("");
    config.setAuthorizationEnabled(true);
    config.setGlobalZookeeperServers("dummy-zk-servers");
    config.setSuperUserRoles(superUser);
    config.setClusterName("c1");
    config.setWebServicePort(TEST_PORT);
    service = spy(new WebSocketService(config));
    doReturn(mockZooKeeperClientFactory).when(service).getZooKeeperClientFactory();
    service.start();
}
Also used : WebSocketProxyConfiguration(com.yahoo.pulsar.websocket.service.WebSocketProxyConfiguration) WebSocketService(com.yahoo.pulsar.websocket.WebSocketService) BeforeClass(org.testng.annotations.BeforeClass)

Example 3 with WebSocketProxyConfiguration

use of com.yahoo.pulsar.websocket.service.WebSocketProxyConfiguration in project pulsar by yahoo.

the class ProxyPublishConsumeTest method setup.

@BeforeClass
public void setup() throws Exception {
    super.internalSetup();
    super.producerBaseSetup();
    WebSocketProxyConfiguration config = new WebSocketProxyConfiguration();
    config.setWebServicePort(TEST_PORT);
    config.setClusterName("use");
    config.setGlobalZookeeperServers("dummy-zk-servers");
    service = spy(new WebSocketService(config));
    doReturn(mockZooKeeperClientFactory).when(service).getZooKeeperClientFactory();
    proxyServer = new ProxyServer(config);
    WebSocketServiceStarter.start(proxyServer, service);
    log.info("Proxy Server Started");
}
Also used : WebSocketProxyConfiguration(com.yahoo.pulsar.websocket.service.WebSocketProxyConfiguration) WebSocketService(com.yahoo.pulsar.websocket.WebSocketService) ProxyServer(com.yahoo.pulsar.websocket.service.ProxyServer) BeforeClass(org.testng.annotations.BeforeClass)

Example 4 with WebSocketProxyConfiguration

use of com.yahoo.pulsar.websocket.service.WebSocketProxyConfiguration in project pulsar by yahoo.

the class ProxyPublishConsumeTls method setup.

@BeforeClass
public void setup() throws Exception {
    super.internalSetup();
    super.producerBaseSetup();
    WebSocketProxyConfiguration config = new WebSocketProxyConfiguration();
    config.setWebServicePort(TEST_PORT);
    config.setWebServicePortTls(TLS_TEST_PORT);
    config.setTlsEnabled(true);
    config.setTlsKeyFilePath(TLS_SERVER_KEY_FILE_PATH);
    config.setTlsCertificateFilePath(TLS_SERVER_CERT_FILE_PATH);
    config.setClusterName("use");
    config.setGlobalZookeeperServers("dummy-zk-servers");
    service = spy(new WebSocketService(config));
    doReturn(mockZooKeeperClientFactory).when(service).getZooKeeperClientFactory();
    proxyServer = new ProxyServer(config);
    WebSocketServiceStarter.start(proxyServer, service);
    log.info("Proxy Server Started");
}
Also used : WebSocketProxyConfiguration(com.yahoo.pulsar.websocket.service.WebSocketProxyConfiguration) WebSocketService(com.yahoo.pulsar.websocket.WebSocketService) ProxyServer(com.yahoo.pulsar.websocket.service.ProxyServer) BeforeClass(org.testng.annotations.BeforeClass)

Example 5 with WebSocketProxyConfiguration

use of com.yahoo.pulsar.websocket.service.WebSocketProxyConfiguration in project pulsar by yahoo.

the class ProxyPublishConsumeWithoutZKTest method setup.

@BeforeClass
public void setup() throws Exception {
    super.internalSetup();
    super.producerBaseSetup();
    WebSocketProxyConfiguration config = new WebSocketProxyConfiguration();
    config.setWebServicePort(TEST_PORT);
    config.setClusterName("use");
    config.setServiceUrl(pulsar.getWebServiceAddress());
    config.setServiceUrlTls(pulsar.getWebServiceAddressTls());
    service = spy(new WebSocketService(config));
    doReturn(mockZooKeeperClientFactory).when(service).getZooKeeperClientFactory();
    proxyServer = new ProxyServer(config);
    WebSocketServiceStarter.start(proxyServer, service);
    log.info("Proxy Server Started");
}
Also used : WebSocketProxyConfiguration(com.yahoo.pulsar.websocket.service.WebSocketProxyConfiguration) WebSocketService(com.yahoo.pulsar.websocket.WebSocketService) ProxyServer(com.yahoo.pulsar.websocket.service.ProxyServer) BeforeClass(org.testng.annotations.BeforeClass)

Aggregations

WebSocketService (com.yahoo.pulsar.websocket.WebSocketService)5 WebSocketProxyConfiguration (com.yahoo.pulsar.websocket.service.WebSocketProxyConfiguration)5 BeforeClass (org.testng.annotations.BeforeClass)5 ProxyServer (com.yahoo.pulsar.websocket.service.ProxyServer)4