TODO fix the test bug and DBAdapter problems