Package javax.jms

Examples of javax.jms.XASession.createQueue()


        XASession session = xaConnection.createXASession();
        XAResource resource = session.getXAResource();
        Xid tid = createXid();
        resource.start(tid, XAResource.TMNOFLAGS);

        MessageProducer producer = session.createProducer(session.createQueue(this.getClass().getName()));
        Message message = session.createTextMessage("Sample Message");
        producer.send(message);
        resource.end(tid, XAResource.TMSUCCESS);
        try {
            LOG.debug("Calling XA prepare(), expecting an exception");
View Full Code Here


            MessageConsumer messageConsumer = mock(MessageConsumer.class);
            when(mockXASession.createConsumer((Destination) anyObject())).thenReturn(messageConsumer);
            when(mockXASession.createConsumer((Destination) anyObject(), anyString())).thenReturn(messageConsumer);
            when(mockXASession.createConsumer((Destination) anyObject(), anyString(), anyBoolean())).thenReturn(messageConsumer);
            Queue queue = mock(Queue.class);
            when(mockXASession.createQueue(anyString())).thenReturn(queue);
            Topic topic = mock(Topic.class);
            when(mockXASession.createTopic(anyString())).thenReturn(topic);
            MockXAResource mockXAResource = new MockXAResource(null);
          when(mockXASession.getXAResource()).thenReturn(mockXAResource);         
            Answer<Session> sessionAnswer = new Answer<Session>() {
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.