Class RabbitMQSingletons

  • All Implemented Interfaces:
    com.oneandone.iocunit.jms.JmsSingletonsIntf

    @Singleton
    public class RabbitMQSingletons
    extends Object
    implements com.oneandone.iocunit.jms.JmsSingletonsIntf
    Manages the singleton used to mock JMS in CDI-Unit using rabbitmq.
    Author:
    aschoerk
    • Constructor Detail

      • RabbitMQSingletons

        public RabbitMQSingletons()
    • Method Detail

      • getConnection

        public jakarta.jms.Connection getConnection()
        Specified by:
        getConnection in interface com.oneandone.iocunit.jms.JmsSingletonsIntf
      • destroy

        @PreDestroy
        public void destroy()
        make sure a new weld-container can be created without residue
        Specified by:
        destroy in interface com.oneandone.iocunit.jms.JmsSingletonsIntf
      • createQueue

        public jakarta.jms.Queue createQueue​(String name)
        Specified by:
        createQueue in interface com.oneandone.iocunit.jms.JmsSingletonsIntf
      • createTopic

        public jakarta.jms.Topic createTopic​(String name)
        Specified by:
        createTopic in interface com.oneandone.iocunit.jms.JmsSingletonsIntf
      • getConnectionFactory

        public jakarta.jms.ConnectionFactory getConnectionFactory()
                                                           throws Exception
        creates the jms-connectionfactory which is injected anywhere during the tests.
        Specified by:
        getConnectionFactory in interface com.oneandone.iocunit.jms.JmsSingletonsIntf
        Returns:
        one ConnectionFactory able to create mockrunner-jms-objects
        Throws:
        Exception - should not occur since mockrunner uses the main memory for jms.
      • jms2OnMessage

        public void jms2OnMessage​(jakarta.jms.MessageListener listener,
                                  jakarta.jms.Message message)
        Specified by:
        jms2OnMessage in interface com.oneandone.iocunit.jms.JmsSingletonsIntf