add unit test.
fix build path of cache directory.