refactored test code.

also changed line length for Eclipsesource code formatter