Package org.apache.qpid.server.model

Examples of org.apache.qpid.server.model.Binding


       }
    }

    private Binding createBindingOnQueue(String bindingName, Queue queue)
    {
        Binding mockBinding = mock(Binding.class);
        when(mockBinding.getParent(Queue.class)).thenReturn(queue);
        when(mockBinding.getName()).thenReturn(bindingName);
        return mockBinding;
    }
View Full Code Here


        verify(_mockExchange, never()).createBinding(anyString(), any(Queue.class), anyMap(), anyMap());
    }

    public void testRemoveBinding() throws Exception
    {
        Binding mockBinding1 = createBindingOnQueue(BINDING1, _mockQueue1);
        Binding mockBinding2 = createBindingOnQueue(BINDING2, _mockQueue1);
        when(_mockExchange.getBindings()).thenReturn(Arrays.asList(new Binding[] {mockBinding1, mockBinding2}));

        _exchangeMBean.removeBinding(QUEUE1_NAME, BINDING1);
        verify(mockBinding1).delete();
    }
View Full Code Here

        verify(mockBinding1).delete();
    }

    public void testRemoveBindingWhereQueueIsUnknown() throws Exception
    {
        Binding mockBinding1 = createBindingOnQueue(BINDING1, _mockQueue1);
        when(_mockExchange.getBindings()).thenReturn(Arrays.asList(new Binding[] {mockBinding1}));

        try
        {
            _exchangeMBean.removeBinding("unknown", BINDING1);
View Full Code Here

        verify(mockBinding1, never()).delete();
    }

    public void testRemoveBindingWhereBindingNameIsUnknown() throws Exception
    {
        Binding mockBinding1 = createBindingOnQueue(BINDING1, _mockQueue1);
        when(_mockExchange.getBindings()).thenReturn(Arrays.asList(new Binding[] {mockBinding1}));

        try
        {
            _exchangeMBean.removeBinding(QUEUE1_NAME, "unknown");
View Full Code Here

       }
    }

    private Binding createBindingOnQueue(String bindingName, Queue queue)
    {
        Binding mockBinding = mock(Binding.class);
        when(mockBinding.getParent(Queue.class)).thenReturn(queue);
        when(mockBinding.getName()).thenReturn(bindingName);
        return mockBinding;
    }
View Full Code Here

     */
    private void validateBindingProperties(Collection<? extends Binding> bindings, boolean useSelectors)
    {
        assertEquals("Each queue should only be bound once.", 1, bindings.size());

        Binding binding = bindings.iterator().next();

        if (useSelectors)
        {
            assertTrue("Binding does not contain a Selector argument.",
                    binding.getArguments().containsKey(AMQPFilterTypes.JMS_SELECTOR.toString()));
            assertEquals("The binding selector argument is incorrect", SELECTOR_VALUE,
                    binding.getArguments().get(AMQPFilterTypes.JMS_SELECTOR.toString()).toString());
        }
    }
View Full Code Here

        verify(_mockExchange).createBinding(BINDING1, _mockQueue1, arguments, Collections.<String, Object>emptyMap());
    }

    public void testRemoveBinding() throws Exception
    {
        Binding mockBinding1 = createBindingOnQueue(BINDING1, _mockQueue1);
        Binding mockBinding2 = createBindingOnQueue(BINDING2, _mockQueue1);
        when(_mockExchange.getBindings()).thenReturn(Arrays.asList(new Binding[] {mockBinding1, mockBinding2}));

        _exchangeMBean.removeBinding(QUEUE1_NAME, BINDING1);
        verify(mockBinding1).delete();
    }
View Full Code Here

        verify(mockBinding1).delete();
    }

    public void testRemoveBindingWhereQueueIsUnknown() throws Exception
    {
        Binding mockBinding1 = createBindingOnQueue(BINDING1, _mockQueue1);
        when(_mockExchange.getBindings()).thenReturn(Arrays.asList(new Binding[] {mockBinding1}));

        try
        {
            _exchangeMBean.removeBinding("unknown", BINDING1);
View Full Code Here

        verify(mockBinding1, never()).delete();
    }

    public void testRemoveBindingWhereBindingNameIsUnknown() throws Exception
    {
        Binding mockBinding1 = createBindingOnQueue(BINDING1, _mockQueue1);
        when(_mockExchange.getBindings()).thenReturn(Arrays.asList(new Binding[] {mockBinding1}));

        try
        {
            _exchangeMBean.removeBinding(QUEUE1_NAME, "unknown");
View Full Code Here

       }
    }

    private Binding createBindingOnQueue(String bindingName, Queue queue)
    {
        Binding mockBinding = mock(Binding.class);
        when(mockBinding.getParent(Queue.class)).thenReturn(queue);
        when(mockBinding.getName()).thenReturn(bindingName);
        return mockBinding;
    }
View Full Code Here

TOP

Related Classes of org.apache.qpid.server.model.Binding

Copyright © 2018 www.massapicom. 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.