@@ -0,0 +1,1623 @@
+/**%0D%0A * The contents of this file are subject to the OpenMRS Public License%0D%0A * Version 1.0 (the %22License%22); you may not use this file except in%0D%0A * compliance with the License. You may obtain a copy of the License at%0D%0A * http://license.openmrs.org%0D%0A *%0D%0A * Software distributed under the License is distributed on an %22AS IS%22%0D%0A * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the%0D%0A * License for the specific language governing rights and limitations%0D%0A * under the License.%0D%0A *%0D%0A * Copyright (C) OpenMRS, LLC.  All Rights Reserved.%0D%0A */%0D%0Apackage org.openmrs.serialization.xstream;%0D%0A%0D%0Aimport static org.junit.Assert.assertEquals;%0D%0A%0D%0Aimport java.util.Set;%0D%0Aimport org.junit.Test;%0D%0Aimport org.openmrs.PersonName;%0D%0Aimport org.openmrs.User;%0D%0Aimport org.openmrs.api.context.Context;%0D%0Aimport org.openmrs.test.BaseContextSensitiveTest;%0D%0A%0D%0Apublic class SerializationTest extends BaseContextSensitiveTest %7B%0D%0A%09%0D%0A%09@Test%0D%0A%09public void shouldReturnSameClassName()%7B%0D%0A%09%09User admin = Context.getAuthenticatedUser();%0D%0A%09%09Set%3CPersonName%3E set = admin.getNames();%0D%0A%09%09/*%0D%0A%09%09 * You can see the %22standardTestDataSet.xml%22 file, admin's personName only have one record%0D%0A%09%09 * and that recode's person_name_id is %229348%22.%0D%0A%09%09 * %0D%0A%09%09 * Besides, both %22person_id%22 and %22creator%22 of that record are equal.%0D%0A%09%09 */%0D%0A%09%09for(PersonName pn : set)%7B%0D%0A%09%09%09String classNameOfCreator = pn.getCreator().getClass().getName();%0D%0A%09%09%09String classNameOfPerson = pn.getPerson().getClass().getName();%0D%0A%09%09%09System.out.println(classNameOfCreator);%0D%0A%09%09%09System.out.println(classNameOfPerson);%0D%0A%09%09%09assertEquals(classNameOfCreator, classNameOfPerson);%0D%0A%09%09%7D%0D%0A%09%7D%0D%0A%7D%0D%0A

add a unit test relative to ticket#1588