Search in sources :

Example 41 with ConnectionPool

use of io.pravega.client.connection.impl.ConnectionPool in project pravega by pravega.

the class ControllerStreamMetadataTest method streamManagerImpltest.

@Test(timeout = 10000)
public void streamManagerImpltest() {
    ClientConfig config = ClientConfig.builder().build();
    @Cleanup ConnectionPool cp = new ConnectionPoolImpl(config, new SocketConnectionFactoryImpl(config));
    @Cleanup StreamManager streamManager = new StreamManagerImpl(controller, cp);
    // Create and delete scope
    assertTrue(streamManager.createScope(SCOPE));
    assertTrue(streamManager.deleteScope(SCOPE));
    // Create scope twice
    assertTrue(streamManager.createScope(SCOPE));
    assertFalse(streamManager.createScope(SCOPE));
    assertTrue(streamManager.deleteScope(SCOPE));
    // Delete twice
    assertFalse(streamManager.deleteScope(SCOPE));
}
Also used : ConnectionPool(io.pravega.client.connection.impl.ConnectionPool) StreamManager(io.pravega.client.admin.StreamManager) ConnectionPoolImpl(io.pravega.client.connection.impl.ConnectionPoolImpl) StreamManagerImpl(io.pravega.client.admin.impl.StreamManagerImpl) ClientConfig(io.pravega.client.ClientConfig) SocketConnectionFactoryImpl(io.pravega.client.connection.impl.SocketConnectionFactoryImpl) Cleanup(lombok.Cleanup) Test(org.junit.Test)

Aggregations

ConnectionPool (io.pravega.client.connection.impl.ConnectionPool)41 Cleanup (lombok.Cleanup)22 ConnectionPoolImpl (io.pravega.client.connection.impl.ConnectionPoolImpl)19 SocketConnectionFactoryImpl (io.pravega.client.connection.impl.SocketConnectionFactoryImpl)19 ClientConfig (io.pravega.client.ClientConfig)17 CompletableFuture (java.util.concurrent.CompletableFuture)17 Test (org.junit.Test)16 UUID (java.util.UUID)14 StreamManager (io.pravega.client.admin.StreamManager)13 StreamManagerImpl (io.pravega.client.admin.impl.StreamManagerImpl)13 List (java.util.List)13 ScheduledExecutorService (java.util.concurrent.ScheduledExecutorService)12 VisibleForTesting (com.google.common.annotations.VisibleForTesting)11 ScalingPolicy (io.pravega.client.stream.ScalingPolicy)11 PravegaNodeUri (io.pravega.shared.protocol.netty.PravegaNodeUri)11 ConnectionFactory (io.pravega.client.connection.impl.ConnectionFactory)10 Exceptions (io.pravega.common.Exceptions)10 HostControllerStore (io.pravega.controller.store.host.HostControllerStore)10 ConnectionFailedException (io.pravega.shared.protocol.netty.ConnectionFailedException)10 WireCommands (io.pravega.shared.protocol.netty.WireCommands)10