Package org.jacorb.notification.interfaces

Examples of org.jacorb.notification.interfaces.Message


    public void testFailedDeliveryToConsumerDoesNotDisposeMessage() throws Exception
    {
        StructuredEvent event = new StructuredEvent();

        MockControl controlMessage = MockControl.createControl(Message.class);
        Message mockMessage = (Message) controlMessage.getMock();

        mockMessage.clone();
        controlMessage.setReturnValue(mockMessage, 2);

        mockMessage.toStructuredEvent();
        controlMessage.setReturnValue(event);

        mockMessage.dispose();

        controlMessage.replay();

        controlTaskExecutor_.replay();
View Full Code Here


    public void testDeliverMessage_Error() throws Exception
    {
        Any any = getORB().create_any();

        MockControl controlMessage = MockControl.createControl(Message.class);
        Message mockMessage = (Message) controlMessage.getMock();

        mockMessage.toAny();
        controlMessage.setReturnValue(any);

        mockMessage.clone();
        controlMessage.setReturnValue(mockMessage, 2);

        mockMessage.dispose();

        controlMessage.replay();

        MockControl controlPushConsumer = MockControl.createControl(PushConsumer.class);
        PushConsumer mockPushConsumer = (PushConsumer) controlPushConsumer.getMock();
View Full Code Here

    public void testMaximumBatchSize() throws Exception
    {
        StructuredEvent event = new StructuredEvent();

        MockControl controlMessage = MockControl.createNiceControl(Message.class);
        Message mockMessage = (Message) controlMessage.getMock();

        controlMessage.expectAndReturn(mockMessage.clone(), mockMessage, MockControl.ONE_OR_MORE);
       
        mockMessage.toStructuredEvent();
        controlMessage.setReturnValue(event);

        controlMessage.replay();

        replayAll();
View Full Code Here

    }
   
    public void testConnectedSupplierDoesQueueClonedMessage() throws Exception
    {
        MockControl controlClonedMessage = MockControl.createControl(Message.class);
        Message mockClonedMessage = (Message) controlClonedMessage.getMock();
       
        mockMessage_.clone();
        controlMessage_.setReturnValue(mockClonedMessage);
       
        controlClonedMessage.expectAndReturn(mockClonedMessage.getReceiveTimestamp(), 0, MockControl.ZERO_OR_MORE);
        mockMessage_.dispose();
       
        mockClient_._is_a(null);
        controlClient_.setDefaultMatcher(MockControl.ALWAYS_MATCHER);
        controlClient_.setDefaultReturnValue(false);

        controlClonedMessage.expectAndReturn(mockClonedMessage.getPriority(), 0, MockControl.ZERO_OR_MORE);
        mockClonedMessage.dispose();
       
        controlClonedMessage.replay();
        replayAll();

        objectUnderTest_.connectClient(mockClient_);
        objectUnderTest_.queueMessage(mockMessage_);
        mockMessage_.dispose();
       
        assertEquals(1, objectUnderTest_.getPendingMessagesCount());
       
        Message queuedMessage = objectUnderTest_.getMessageBlocking();
        assertSame(mockClonedMessage, queuedMessage);
        queuedMessage.dispose();

        assertEquals(0, objectUnderTest_.getPendingMessagesCount());
       
        controlClonedMessage.verify();
        verifyAll();
View Full Code Here

        structuredEvent_.header.variable_header[0] = new Property(StopTime.value, _any);

        StructuredEventMessage mesg = new StructuredEventMessage();
        mesg.setStructuredEvent(structuredEvent_, true, true);
        final Message _event = mesg.getHandle();

        final HashSet _received = new HashSet();

        final Object lock = new Object();
View Full Code Here

    }

    public void testCreateDispose()
    {
        MockControl controlMessage = MockControl.createControl(Message.class);
        Message mockMessage = (Message) controlMessage.getMock();

        MockControl controlMessage2 = MockControl.createControl(Message.class);
        Message mockMessage2 = (Message) controlMessage2.getMock();

        mockMessage.clone();
        controlMessage.setReturnValue(mockMessage2);

        mockMessage2.dispose();
        controlMessage2.setVoidCallable();
       
        controlMessage2.replay();
        controlMessage.replay();
View Full Code Here

        structuredEvent_.remainder_of_body = getORB().create_any();
    }

    public void testStructuredEventWithoutStartTimeProperty() throws Exception
    {
        Message _event = messageFactory_.newMessage(structuredEvent_);

        assertTrue(!_event.hasStartTime());
    }
View Full Code Here

        assertTrue(!_event.hasStartTime());
    }

    public void testAnyEventHasNoStartTime() throws Exception
    {
        Message _event = messageFactory_.newMessage(getORB().create_any());

        assertTrue(!_event.hasStartTime());
    }
View Full Code Here

        UtcT _startTime = Time.corbaTime(_now);
        UtcTHelper.insert(_startTimeAny, _startTime);

        structuredEvent_.header.variable_header[0] = new Property(StartTime.value, _startTimeAny);

        Message _event = messageFactory_.newMessage(structuredEvent_, proxyConsumerMock_);

        assertTrue(_event.hasStartTime());
        assertEquals(_now.getTime(), _event.getStartTime());
    }
View Full Code Here

        Any _startTimeAny = getORB().create_any();
        UtcTHelper.insert(_startTimeAny, Time.corbaTime(_startTime));

        structuredEvent_.header.variable_header[0] = new Property(StartTime.value, _startTimeAny);

        final Message _event = messageFactory_.newMessage(structuredEvent_, proxyConsumerMock_);

        final CountDownLatch _latch = new CountDownLatch(1);

        // TODO check if MockTaskProcessor can be used here
        final DefaultTaskFactory _defaultTaskFactory = new DefaultTaskFactory(getConfiguration());
View Full Code Here

TOP

Related Classes of org.jacorb.notification.interfaces.Message

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.