import org.junit.Test;
import org.unitils.dbunit.annotation.DataSet;
+import eu.etaxonomy.cdm.api.application.CdmApplicationState;
import eu.etaxonomy.cdm.api.service.ICommonService;
import eu.etaxonomy.cdm.api.service.IPolytomousKeyNodeService;
import eu.etaxonomy.cdm.api.service.IPolytomousKeyService;
import eu.etaxonomy.cdm.api.service.IUserService;
import eu.etaxonomy.cdm.api.service.IVocabularyService;
import eu.etaxonomy.cdm.model.agent.AgentBase;
+import eu.etaxonomy.cdm.model.agent.Person;
+import eu.etaxonomy.cdm.model.agent.TeamOrPersonBase;
import eu.etaxonomy.cdm.model.common.CdmBase;
import eu.etaxonomy.cdm.model.common.Credit;
import eu.etaxonomy.cdm.model.common.DefinedTermBase;
}
}
}
+
+ @Test
+ public void savePerson() {
+ TeamOrPersonBase teamOrPerson = Person.NewInstance();
+ teamOrPerson.setTitleCache("New Person", true);
+ teamOrPerson = (TeamOrPersonBase)CdmApplicationState.getCurrentAppConfig().getAgentService().merge(teamOrPerson);
+ //CdmApplicationState.getCurrentAppConfig().getAgentService().saveOrUpdate(teamOrPerson);
+
+ Person person = (Person)teamOrPerson;
+// person.setFirstname("Some");
+// CdmApplicationState.getCurrentAppConfig().getAgentService().merge(teamOrPerson);
+
+ person = (Person) CdmApplicationState.getCurrentAppConfig().getAgentService().find(person.getUuid());
+ person.setFirstname("Some");
+ CdmApplicationState.getCurrentAppConfig().getAgentService().merge(teamOrPerson);
+ }
}