Alfresco is a very good open source content management system, however there is only one problem with Alfresco, testing. It is a complete headache, writing an integration test, forget it! You will end up with functional tests;
- fire up an Alfresco instance
- use one of the existing interfaces to setup some test data
- and finally do your test
Unfortunately, starting from version 3.2 you cannot even do that and why?
Because starting from version 3.2 the sql scripts are out-dated and Alfresco is not working with any of the memory databases, not with Derby, not with hsqldb…
To see the related issue on this matter click here.
Luckily we have h2database and it can impersonate –thanks to compatibility mode– other databases that Alfresco has support for.
All you have to do is to add h2database to your classpath and change your driver, jdbc url and dialect. I did not test Oracle or MySQL compatibility modes but it is working with PostgreSQL.
db.driver=org.h2.Driver db.url=jdbc:h2:alf_data/h2_data/alfresco;MODE=PostgreSQL hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect
By this way you can still do your automated tests.