Every time there are changes in the source code, we need to do a sanity test. This is a set of tests that go over the main functions of jBilling, making sure that they are still doing what they should do. An experienced user can do these tests in less than 10 minutes. This sanity test is just an addition to the actual unit test that you would conduct to check the specific behavior that your code changes have created.
There are two sets of tests. One is done by using the web based graphic user interface (GUI testing). Here you test as if you were a customer clicking on menu options and manually entering values. The second test is an automated process that is included in the build scripts and based on JUnit.
Before you begin, read the Getting Started guide. You only need to do this once to familiarize yourself with jBilling. It takes about 20 minutes and it will save you time, since you won’t have to wander around the menu options later on.
Start up jBilling. Login as an administrator.
Create an order for this customer. Make it monthly and pre-paid. Add the item you created in step 4.
Click on Process -> Latest. You probably won’t see any information yet. You have to wait until the scheduled billing process is triggered. This should be a minute or two, since you configured the billing process to run every five minutes in step 1. Refresh this screen until you see some data.
Only one invoice should be generated in the billing process. Click on it and make sure the total corresponds to the order you created in step 6.
Install postgres and create a database called 'jbilling_test' with a user 'jbilling' (no password) that has all privileges in this database.
Configure your jBilling installation to use postgres instead of the default HSQL. To do this, edit the configuration file jbilling-database.xml and copy the postgres JDBC driver to the lib directory (there are more details on this page, but not all of the configuration needs to be completed).
Run jbilling/src/ant test-ws. This is the fast automated test. You should conduct this one often because it touches many components and can be completed in a few minutes.
Run jbilling/src/ant test. This should be done only when you think you are finished. It does a full billing process and mediation test and it takes over an hour. The message you are looking for is ‘BUILD SUCCESSFUL.’ Note that the file server.log will have plenty of exceptions even when you have a successful test.