Simulating JMS - jUnit

2019-05-07 02:39发布

I need to simulate JMS behavior while performing automated tests via maven/hudson. I was thinking about using some mock framework i.e. Mockito to achieve that goal but maybe there is some easier tool which can accomplish this task? I have read a little bit about ActiveMQ but from what I have found out it requires to install broker prior using it. In my case it is important to have everything run by maven only because I don't have any privileges to install anything on the build server.

1条回答
贼婆χ
2楼-- · 2019-05-07 03:11

You can run ActiveMQ in embedded mode - the broker starts within your application and queues are created on the fly. You just need to add activemq.jar and run few lines of code.

On the other hand there is a Mockrunner library that has support for JMS - although it was designed mainly for unit tests, not integration.

查看更多
登录 后发表回答