0

I have implemented a QuickFIX/J application (the J stands for Java). Now I consider how to set up fixed test cases.

I am a little bit familiar with JUnit but I don't know if it's the right one for that issue, because QuickFIX/J has callbacks (fromApp-method of the Application class for example).

Maybe there is someone out there who has had the same problem and found a nice solution for that issue. ;)

mrbela
  • 4,477
  • 9
  • 44
  • 79

2 Answers2

1

I have used JUnit with QuickFIX/J tests. For call backs you can use a BlockingQueue<Message> so you can check in your main thread that you get the messages you expect. Or you can use a BlockingQueue of a data type of your choice.

Peter Lawrey
  • 525,659
  • 79
  • 751
  • 1,130
1

If you're testing the responses of a QuickFix application, then you're really into integration testing rather than unit testing.

So as you've already written one QuickfixJ application, you could write a testing application that connects to it. So if your application is a Fix acceptor, write one that is an initiator.

Now you can send messages from your test application to your real application. Any responses from your real application will call onMessage() in your test application.

You can capture these callbacks and then you can verify that they match certain patterns (e.g., the application returns the same Client order id that the test sent). You can certainly use JUnit for this.

user1717259
  • 2,717
  • 6
  • 30
  • 44