Search in sources :

Example 1 with ProtonServerImpl

use of io.vertx.proton.impl.ProtonServerImpl in project vertx-proton by vert-x3.

the class ProtonClientTest method testAnonymousRelayIsNotSupported.

@Test(timeout = 20000)
public void testAnonymousRelayIsNotSupported(TestContext context) {
    ((ProtonServerImpl) server.getProtonServer()).setAdvertiseAnonymousRelayCapability(false);
    Async async = context.async();
    connect(context, connection -> {
        context.assertFalse(connection.isAnonymousRelaySupported(), "Connection not yet open, so result should be false");
        connection.openHandler(x -> {
            context.assertFalse(connection.isAnonymousRelaySupported(), "Connection now open, server does not support relay, should be false");
            connection.disconnect();
            async.complete();
        }).open();
    });
}
Also used : TestContext(io.vertx.ext.unit.TestContext) Async(io.vertx.ext.unit.Async) Arrays(java.util.Arrays) RunWith(org.junit.runner.RunWith) AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) LoggerFactory(io.vertx.core.logging.LoggerFactory) LinkedHashMap(java.util.LinkedHashMap) Symbol(org.apache.qpid.proton.amqp.Symbol) AmqpValue(org.apache.qpid.proton.amqp.messaging.AmqpValue) AtomicInteger(java.util.concurrent.atomic.AtomicInteger) ProtonHelper.message(io.vertx.proton.ProtonHelper.message) Target(org.apache.qpid.proton.amqp.transport.Target) Map(java.util.Map) UnsignedLong(org.apache.qpid.proton.amqp.UnsignedLong) Message(org.apache.qpid.proton.message.Message) AsyncResult(io.vertx.core.AsyncResult) AmqpError(org.apache.qpid.proton.amqp.transport.AmqpError) Logger(io.vertx.core.logging.Logger) ProtonServerImpl(io.vertx.proton.impl.ProtonServerImpl) ProtonMetaDataSupportImpl(io.vertx.proton.impl.ProtonMetaDataSupportImpl) Test(org.junit.Test) VertxUnitRunner(io.vertx.ext.unit.junit.VertxUnitRunner) Future(io.vertx.core.Future) Proton(org.apache.qpid.proton.Proton) ExecutionException(java.util.concurrent.ExecutionException) TimeUnit(java.util.concurrent.TimeUnit) Source(org.apache.qpid.proton.amqp.messaging.Source) ErrorCondition(org.apache.qpid.proton.amqp.transport.ErrorCondition) Section(org.apache.qpid.proton.amqp.messaging.Section) NetServer(io.vertx.core.net.NetServer) ProtonConnectionImpl(io.vertx.proton.impl.ProtonConnectionImpl) Handler(io.vertx.core.Handler) Collections(java.util.Collections) Async(io.vertx.ext.unit.Async) ProtonServerImpl(io.vertx.proton.impl.ProtonServerImpl) Test(org.junit.Test)

Aggregations

AsyncResult (io.vertx.core.AsyncResult)1 Future (io.vertx.core.Future)1 Handler (io.vertx.core.Handler)1 Logger (io.vertx.core.logging.Logger)1 LoggerFactory (io.vertx.core.logging.LoggerFactory)1 NetServer (io.vertx.core.net.NetServer)1 Async (io.vertx.ext.unit.Async)1 TestContext (io.vertx.ext.unit.TestContext)1 VertxUnitRunner (io.vertx.ext.unit.junit.VertxUnitRunner)1 ProtonHelper.message (io.vertx.proton.ProtonHelper.message)1 ProtonConnectionImpl (io.vertx.proton.impl.ProtonConnectionImpl)1 ProtonMetaDataSupportImpl (io.vertx.proton.impl.ProtonMetaDataSupportImpl)1 ProtonServerImpl (io.vertx.proton.impl.ProtonServerImpl)1 Arrays (java.util.Arrays)1 Collections (java.util.Collections)1 LinkedHashMap (java.util.LinkedHashMap)1 Map (java.util.Map)1 ExecutionException (java.util.concurrent.ExecutionException)1 TimeUnit (java.util.concurrent.TimeUnit)1 AtomicBoolean (java.util.concurrent.atomic.AtomicBoolean)1