Package io.netty.util

Examples of io.netty.util.AttributeMap.attr()


    public void testNewRequestId() throws Exception {
        RequestIdProvider provider = new HttpRequestIdProvider("request_id", CORRELATOR);
        ContextKeySupplier keySupplier = new MapBackedKeySupplier(new HashMap<String, String>());
        AttributeMap attributeMap = new DefaultAttributeMap();
        String requestId = provider.newRequestId(keySupplier, attributeMap);
        ConcurrentLinkedQueue<String> ids = attributeMap.attr(HttpRequestIdProvider.REQUEST_IDS_KEY).get();
        Assert.assertNotNull("Request Id not added to context.", ids);
        Assert.assertNotNull("Request Id not added to context.", ids.peek());
        Assert.assertSame("Unexpected request Id in the context.", requestId, ids.poll());
    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.