Initial refactoring of invoice tests
meter: move the module to osgi bundle

Even though usage should be part of Killbill core, the metering piece
can be extracted as a plugin (metering could be handled in an external
system).

Signed-off-by: Pierre-Alexandre Meyer <pierre@ning.com>
healthchecks: don't scan full tables

Make sure to only return 1 row from the tables. That should be enough to
check the connection to the db is working and the table is present.

Signed-off-by: Pierre-Alexandre Meyer <pierre@ning.com>
invoice: add index on invoice_payments.invoice_id

This is especially useful for analytics.

Signed-off-by: Pierre-Alexandre Meyer <pierre@ning.com>
Merge remote-tracking branch 'origin/testinvoice' into meter-as-osgi-bundle
account: update tests to new conventions

See #38.

Signed-off-by: Pierre-Alexandre Meyer <pierre@ning.com>
util: add ConfigSource in constructor of BusModule

This is useful for tests to override properties without having to
override System-wide properties.

Signed-off-by: Pierre-Alexandre Meyer <pierre@ning.com>
util: add ConfigSource in constructor of CacheModule

This is useful for tests to override properties without having to
override System-wide properties.

Signed-off-by: Pierre-Alexandre Meyer <pierre@ning.com>
util: fix race condition in PersistentQueueBase

On shutdown, make sure to decrement the number of active threads before
calling notify(). Otherwise, we may end up with the following scenario:

    Thread A             Thread B

                         curActiveThreads > 0 == true
                         wait(1000)
    notify
                         curActiveThreads > 0 == true
                         wait(1000)
    curActiveThreads--
                         wait timeout
                         curActiveThreads > 0 == false

This change speeds up account tests by 25s (from 1m10s down to
45s).

Signed-off-by: Pierre-Alexandre Meyer <pierre@ning.com>
account: tweak properties in test

Tests now take about 45s.

Signed-off-by: Pierre-Alexandre Meyer <pierre@ning.com>
catalog: remove MockPlan

It wasn't used and didn't do much.

Signed-off-by: Pierre-Alexandre Meyer <pierre@ning.com>
catalog: update tests to new conventions

See #38.

Signed-off-by: Pierre-Alexandre Meyer <pierre@ning.com>
catalog: move CreateCatalogSchema under catalog/util

It's not a test.

Signed-off-by: Pierre-Alexandre Meyer <pierre@ning.com>
catalog: small cleanups in tests

* Make sure to use the Guice injected VersionedCatalogLoader
* Update copyright
* Optimize imports

Signed-off-by: Pierre-Alexandre Meyer <pierre@ning.com>
jaxrs: update tests to new conventions

See #38.

Signed-off-by: Pierre-Alexandre Meyer <pierre@ning.com>
jaxrs: update copyright in tests

Signed-off-by: Pierre-Alexandre Meyer <pierre@ning.com>
Invoice tests refactoring to use InvoiceTestSuiteWithEmbeddedDB and InvoiceTestSuiteNoDB
Refactor payment tests to use PaymentTestSuiteNoDB and PaymentTestSuiteWithEmbeddedDB
junction: update tests to new conventions

See #38.

Signed-off-by: Pierre-Alexandre Meyer <pierre@ning.com>
junction: update copyright in tests

Signed-off-by: Pierre-Alexandre Meyer <pierre@ning.com>