implement tests in junit and move them out of python