added junit testcases and corrected build errors