3

For example, I am going to write an application. Its core requirement is simple. It keeps scanning a folder. If new files arrive, it will transfer it to a FTP site. It will be written in JAVA as a console application.

I am wondering if there is integration test framework, like open source one, for this kind of application? It should be capable of testing the following sameple test cases.

  1. Generate files, then check if these files are transferred to FTP.
  2. If FTP is down, can the application report corresponding warning logs?
  3. etc.

Thanks in advance.

razlebe
  • 7,134
  • 6
  • 42
  • 57
Smartmarkey
  • 1,979
  • 5
  • 22
  • 25

1 Answers1

2

JUnit combined with some mocking framework, like Mockito should get you a fair bit on your way. If you want to take it further, for instance having actual instances running of external service, you can use JUnit combined with, for instance, Cargo to start up Java EE containers as part of your test. Light-weight, in-memory databases like HSQLDB is often used as placeholder databases for integration tests.

I've heard some people using JBoss Arquillian, but haven't tried it myself. It's more for remote testing of Java EE components though, so might not fit your exact requirement.

Arjan Tijms
  • 37,782
  • 12
  • 108
  • 140
pap
  • 27,064
  • 6
  • 41
  • 46
  • +1 JUnit, Mockito, and HSQLDB should handle all that's mentioned here in this question. – Eric Wilson Aug 25 '11 at 14:03
  • But what? I think you only posted part of your comment. – pap Aug 26 '11 at 07:46
  • Wow... something wrong with Stackoverflow. It looks a little complicated for my scenario. Actually what I need is like below. 1. This ITF can launch my app. 2.before/after/during launching my app, I can write some custom code/script to do prepare/check things. – Smartmarkey Aug 26 '11 at 08:42
  • I would look at using some continuous integration platform, like Hudson or team city. I suspect this is what you're really after when you say "integration test framework". It's basically a central server that runs your build (and your JUnit tests, for instance). – pap Aug 26 '11 at 10:23
  • Thanks, pap. I am going to utilize testNG, mockito and CruiseControl to do my job. :) – Smartmarkey Aug 29 '11 at 05:16
  • Sounds like a fairly standard setup. Good luck! – pap Aug 29 '11 at 07:11