move configure xml file, add unit test

Move servlet-context.xml, database.properties to resources file. Try to
add unit test, but tests always can't load the beans.