Package org.jacorb.notification.interfaces

Examples of org.jacorb.notification.interfaces.Message


    {
        DelegatingOverflowStrategy strategy = new DelegatingOverflowStrategy(EventQueueOverflowStrategy.FIFO);

        List _events = new ArrayList();

        Message e1 = newMessage();
        Message e2 = newMessage();
        Message e3 = newMessage();
        Message e4 = newMessage();
        Message e5 = newMessage();

        _events.add(e1);

        _events.add(e2);
View Full Code Here


        _events.add(newMessage());

        _events.add(newMessage());

        Message e1 = newMessage();

        Message e2 = newMessage();

        _events.add(e1);

        _events.add(e2);
View Full Code Here

   
    public void testGetAllClearsQueue() throws Exception
    {
        BoundedPriorityEventQueue queue = new BoundedPriorityEventQueue(10, EventQueueOverflowStrategy.LEAST_PRIORITY);
       
        Message m = newMessage();
       
        assertEquals(0, queue.getAllMessages(false).length);
       
        queue.put(m);
       
View Full Code Here

    }
   
    private Message newMessage(int priority)
    {
        MockControl controlMessage = MockControl.createControl(Message.class);
        Message mockMessage = (Message) controlMessage.getMock();
        mockMessage.getPriority();
        controlMessage.setDefaultReturnValue(priority);
       
        mockMessage.getReceiveTimestamp();
        try
        {
            // there should be at least 1ms difference between the timestamps
            Thread.sleep(1);
        } catch (InterruptedException e)
View Full Code Here

    }

    public void testReplaceNonEmpty() throws Exception
    {
        final MockControl controlMessage = MockControl.createControl(Message.class);
        final Message mockMessage = (Message) controlMessage.getMock();
        final Message[] mesgs = new Message[] { mockMessage };

        mockInitialQueue_.hasPendingMessages();
        controlInitialQueue_.setReturnValue(true);
View Full Code Here

       
        proxyConsumerControl.expectAndReturn(proxyConsumerMock.getStopTimeSupported(), true);
       
        proxyConsumerControl.replay();
       
        Message _event = messageFactory_.newMessage(testStructured_, proxyConsumerMock);
        assertTrue(_event.hasStopTime());
        assertEquals(_now.getTime(), _event.getStopTime());
       
        proxyConsumerControl.verify();
    }
View Full Code Here

    }

   
    public void testStructuredEventWithoutStopTimeProperty() throws Exception
    {
        Message _event = messageFactory_.newMessage(testStructured_);
        assertTrue(!_event.hasStopTime());
    }
View Full Code Here

        assertTrue(!_event.hasStopTime());
    }

    public void testAnyEventHasNoStopTime() throws Exception
    {
        Message _event = messageFactory_.newMessage(getORB().create_any());
        assertTrue(!_event.hasStopTime());
    }
View Full Code Here

        assertNotNull(messageFactory_.newMessage(testStructured_));
    }

    public void testStructuredToAny() throws Exception
    {
        Message _notifyEvent = messageFactory_.newMessage(testStructured_);
        assertNotNull(_notifyEvent);
        Any _any = _notifyEvent.toAny();
        StructuredEvent _event = StructuredEventHelper.extract(_any);
        assertNotNull(_event);
        assertEquals("domain", _event.header.fixed_header.event_type.domain_name);
        assertEquals("type", _event.header.fixed_header.event_type.type_name);
    }
View Full Code Here

        assertEquals("type", _event.header.fixed_header.event_type.type_name);
    }

    public void testStructuredToStructured() throws Exception
    {
        Message _notifyEvent = messageFactory_.newMessage(testStructured_);
        assertNotNull(_notifyEvent);
        StructuredEvent _event = _notifyEvent.toStructuredEvent();
        assertNotNull(_event);
        assertEquals("domain", _event.header.fixed_header.event_type.domain_name);
        assertEquals("type", _event.header.fixed_header.event_type.type_name);
    }
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.