factorise code; make DBTestBase a UnoApiTest

Change-Id: I29c131f60caa36c464d99b9b86a59e2e16ce94e3