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.
- Generate files, then check if these files are transferred to FTP.
- If FTP is down, can the application report corresponding warning logs?
- etc.
Thanks in advance.
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.