test case for serialize