From: <eri...@us...> - 2008-12-22 09:55:00
|
Revision: 1872 http://geonetwork.svn.sourceforge.net/geonetwork/?rev=1872&view=rev Author: erikvaningen Date: 2008-12-22 09:54:53 +0000 (Mon, 22 Dec 2008) Log Message: ----------- refactoring packages Modified Paths: -------------- sandbox/3.0.x/geonetwork-persistence-ebrim/src/test/resources/applicationContext-hibernate-test.xml Added Paths: ----------- sandbox/3.0.x/geonetwork-persistence-ebrim/src/main/java/org/geonetwork/dao/ebrim/informationmodel/AssociationDao.java sandbox/3.0.x/geonetwork-persistence-ebrim/src/main/java/org/geonetwork/dao/ebrim/informationmodel/CoreDao.java sandbox/3.0.x/geonetwork-persistence-ebrim/src/test/java/org/geonetwork/dao/ebrim/informationmodel/CoreDaoTest.java Removed Paths: ------------- sandbox/3.0.x/geonetwork-persistence-ebrim/src/main/java/org/geonetwork/dao/ebrim/informationmodel/core/CoreDao.java sandbox/3.0.x/geonetwork-persistence-ebrim/src/test/java/org/geonetwork/dao/ebrim/informationmodel/core/CoreDaoTest.java Added: sandbox/3.0.x/geonetwork-persistence-ebrim/src/main/java/org/geonetwork/dao/ebrim/informationmodel/AssociationDao.java =================================================================== --- sandbox/3.0.x/geonetwork-persistence-ebrim/src/main/java/org/geonetwork/dao/ebrim/informationmodel/AssociationDao.java (rev 0) +++ sandbox/3.0.x/geonetwork-persistence-ebrim/src/main/java/org/geonetwork/dao/ebrim/informationmodel/AssociationDao.java 2008-12-22 09:54:53 UTC (rev 1872) @@ -0,0 +1,5 @@ +package org.geonetwork.dao.ebrim.informationmodel; + +public class AssociationDao { + +} Copied: sandbox/3.0.x/geonetwork-persistence-ebrim/src/main/java/org/geonetwork/dao/ebrim/informationmodel/CoreDao.java (from rev 1870, sandbox/3.0.x/geonetwork-persistence-ebrim/src/main/java/org/geonetwork/dao/ebrim/informationmodel/core/CoreDao.java) =================================================================== --- sandbox/3.0.x/geonetwork-persistence-ebrim/src/main/java/org/geonetwork/dao/ebrim/informationmodel/CoreDao.java (rev 0) +++ sandbox/3.0.x/geonetwork-persistence-ebrim/src/main/java/org/geonetwork/dao/ebrim/informationmodel/CoreDao.java 2008-12-22 09:54:53 UTC (rev 1872) @@ -0,0 +1,195 @@ +package org.geonetwork.dao.ebrim.informationmodel; + +import java.util.List; + +import org.geonetwork.domain.ebrim.informationmodel.core.ExternalIdentifier; +import org.geonetwork.domain.ebrim.informationmodel.core.ExternalLink; +import org.geonetwork.domain.ebrim.informationmodel.core.ExtrinsicObject; +import org.geonetwork.domain.ebrim.informationmodel.core.ObjectRef; +import org.geonetwork.domain.ebrim.informationmodel.core.RegistryObject; +import org.geonetwork.domain.ebrim.informationmodel.core.RegistryPackage; +import org.geonetwork.domain.ebrim.informationmodel.core.Slot; +import org.springframework.orm.hibernate3.support.HibernateDaoSupport; +import org.springframework.transaction.annotation.Transactional; + +/** + * Dao for ExternalIdentifier ExternalLink ExtrinsicObject Identifiable ObjectRef RegistryObject + * RegistryPackage Slot + * + * VersionInfo is not an entity and therefore not directly implemented on Dao level. + * + * + * @author Erik van Ingen + */ +@Transactional +public class CoreDao extends HibernateDaoSupport { + + /** + * ExternalIdentifier + */ + public void saveExternalIdentifier(ExternalIdentifier emailAddress) { + this.getHibernateTemplate().save(emailAddress); + } + + public void mergeExternalIdentifier(ExternalIdentifier emailAddress) { + this.getHibernateTemplate().merge(emailAddress); + } + + public void deleteExternalIdentifier(ExternalIdentifier emailAddress) { + this.getHibernateTemplate().delete(emailAddress); + } + + @SuppressWarnings("unchecked") + public List<ExternalIdentifier> loadAllExternalIdentifier() { + return this.getHibernateTemplate().loadAll(ExternalIdentifier.class); + } + + public ExternalIdentifier findExternalIdentifierById(long id) { + return (ExternalIdentifier) this.getHibernateTemplate().load(ExternalIdentifier.class, id); + } + + /** + * ExternalLink + */ + public void saveExternalLink(ExternalLink emailAddress) { + this.getHibernateTemplate().save(emailAddress); + } + + public void mergeExternalLink(ExternalLink emailAddress) { + this.getHibernateTemplate().merge(emailAddress); + } + + public void deleteExternalLink(ExternalLink emailAddress) { + this.getHibernateTemplate().delete(emailAddress); + } + + @SuppressWarnings("unchecked") + public List<ExternalLink> loadAllExternalLink() { + return this.getHibernateTemplate().loadAll(ExternalLink.class); + } + + public ExternalLink findExternalLinkById(long id) { + return (ExternalLink) this.getHibernateTemplate().load(ExternalLink.class, id); + } + + /** + * ExtrinsicObject + */ + public void saveExtrinsicObject(ExtrinsicObject extrinsicObject) { + this.getHibernateTemplate().save(extrinsicObject); + } + + public void mergeExtrinsicObject(ExtrinsicObject extrinsicObject) { + this.getHibernateTemplate().merge(extrinsicObject); + } + + public void deleteExtrinsicObject(ExtrinsicObject extrinsicObject) { + this.getHibernateTemplate().delete(extrinsicObject); + } + + @SuppressWarnings("unchecked") + public List<ExtrinsicObject> loadAllExtrinsicObject() { + return this.getHibernateTemplate().loadAll(ExtrinsicObject.class); + } + + public ExtrinsicObject findExtrinsicObjectById(long id) { + return (ExtrinsicObject) this.getHibernateTemplate().load(ExtrinsicObject.class, id); + } + + /** + * ObjectRef + */ + public void saveObjectRef(ObjectRef objectRef) { + this.getHibernateTemplate().save(objectRef); + } + + public void mergeObjectRef(ObjectRef objectRef) { + this.getHibernateTemplate().merge(objectRef); + } + + public void deleteObjectRef(ObjectRef objectRef) { + this.getHibernateTemplate().delete(objectRef); + } + + @SuppressWarnings("unchecked") + public List<ObjectRef> loadAllObjectRef() { + return this.getHibernateTemplate().loadAll(ObjectRef.class); + } + + public ObjectRef findObjectRefById(long id) { + return (ObjectRef) this.getHibernateTemplate().load(ObjectRef.class, id); + } + + /** + * RegistryObject + */ + public void saveRegistryObject(RegistryObject registryObject) { + this.getHibernateTemplate().save(registryObject); + } + + public void mergeRegistryObject(RegistryObject registryObject) { + this.getHibernateTemplate().merge(registryObject); + } + + public void deleteRegistryObject(RegistryObject registryObject) { + this.getHibernateTemplate().delete(registryObject); + } + + @SuppressWarnings("unchecked") + public List<RegistryObject> loadAllRegistryObject() { + return this.getHibernateTemplate().loadAll(RegistryObject.class); + } + + public RegistryObject findRegistryObjectById(long id) { + return (RegistryObject) this.getHibernateTemplate().load(RegistryObject.class, id); + } + + /** + * RegistryPackage + */ + public void saveRegistryPackage(RegistryPackage registryPackage) { + this.getHibernateTemplate().save(registryPackage); + } + + public void mergeRegistryPackage(RegistryPackage registryPackage) { + this.getHibernateTemplate().merge(registryPackage); + } + + public void deleteRegistryPackage(RegistryPackage registryPackage) { + this.getHibernateTemplate().delete(registryPackage); + } + + @SuppressWarnings("unchecked") + public List<RegistryPackage> loadAllRegistryPackage() { + return this.getHibernateTemplate().loadAll(RegistryPackage.class); + } + + public RegistryPackage findRegistryPackageById(long id) { + return (RegistryPackage) this.getHibernateTemplate().load(RegistryPackage.class, id); + } + + /** + * Slot + */ + public void saveSlot(Slot slot) { + this.getHibernateTemplate().save(slot); + } + + public void mergeSlot(Slot slot) { + this.getHibernateTemplate().merge(slot); + } + + public void deleteSlot(Slot slot) { + this.getHibernateTemplate().delete(slot); + } + + @SuppressWarnings("unchecked") + public List<Slot> loadAllSlot() { + return this.getHibernateTemplate().loadAll(Slot.class); + } + + public Slot findSlotById(long id) { + return (Slot) this.getHibernateTemplate().load(Slot.class, id); + } + +} \ No newline at end of file Property changes on: sandbox/3.0.x/geonetwork-persistence-ebrim/src/main/java/org/geonetwork/dao/ebrim/informationmodel/CoreDao.java ___________________________________________________________________ Added: svn:mergeinfo + Deleted: sandbox/3.0.x/geonetwork-persistence-ebrim/src/main/java/org/geonetwork/dao/ebrim/informationmodel/core/CoreDao.java =================================================================== --- sandbox/3.0.x/geonetwork-persistence-ebrim/src/main/java/org/geonetwork/dao/ebrim/informationmodel/core/CoreDao.java 2008-12-22 09:47:29 UTC (rev 1871) +++ sandbox/3.0.x/geonetwork-persistence-ebrim/src/main/java/org/geonetwork/dao/ebrim/informationmodel/core/CoreDao.java 2008-12-22 09:54:53 UTC (rev 1872) @@ -1,195 +0,0 @@ -package org.geonetwork.dao.ebrim.informationmodel.core; - -import java.util.List; - -import org.geonetwork.domain.ebrim.informationmodel.core.ExternalIdentifier; -import org.geonetwork.domain.ebrim.informationmodel.core.ExternalLink; -import org.geonetwork.domain.ebrim.informationmodel.core.ExtrinsicObject; -import org.geonetwork.domain.ebrim.informationmodel.core.ObjectRef; -import org.geonetwork.domain.ebrim.informationmodel.core.RegistryObject; -import org.geonetwork.domain.ebrim.informationmodel.core.RegistryPackage; -import org.geonetwork.domain.ebrim.informationmodel.core.Slot; -import org.springframework.orm.hibernate3.support.HibernateDaoSupport; -import org.springframework.transaction.annotation.Transactional; - -/** - * Dao for ExternalIdentifier ExternalLink ExtrinsicObject Identifiable ObjectRef RegistryObject - * RegistryPackage Slot - * - * VersionInfo is not an entity and therefore not directly implemented on Dao level. - * - * - * @author Erik van Ingen - */ -@Transactional -public class CoreDao extends HibernateDaoSupport { - - /** - * ExternalIdentifier - */ - public void saveExternalIdentifier(ExternalIdentifier emailAddress) { - this.getHibernateTemplate().save(emailAddress); - } - - public void mergeExternalIdentifier(ExternalIdentifier emailAddress) { - this.getHibernateTemplate().merge(emailAddress); - } - - public void deleteExternalIdentifier(ExternalIdentifier emailAddress) { - this.getHibernateTemplate().delete(emailAddress); - } - - @SuppressWarnings("unchecked") - public List<ExternalIdentifier> loadAllExternalIdentifier() { - return this.getHibernateTemplate().loadAll(ExternalIdentifier.class); - } - - public ExternalIdentifier findExternalIdentifierById(long id) { - return (ExternalIdentifier) this.getHibernateTemplate().load(ExternalIdentifier.class, id); - } - - /** - * ExternalLink - */ - public void saveExternalLink(ExternalLink emailAddress) { - this.getHibernateTemplate().save(emailAddress); - } - - public void mergeExternalLink(ExternalLink emailAddress) { - this.getHibernateTemplate().merge(emailAddress); - } - - public void deleteExternalLink(ExternalLink emailAddress) { - this.getHibernateTemplate().delete(emailAddress); - } - - @SuppressWarnings("unchecked") - public List<ExternalLink> loadAllExternalLink() { - return this.getHibernateTemplate().loadAll(ExternalLink.class); - } - - public ExternalLink findExternalLinkById(long id) { - return (ExternalLink) this.getHibernateTemplate().load(ExternalLink.class, id); - } - - /** - * ExtrinsicObject - */ - public void saveExtrinsicObject(ExtrinsicObject extrinsicObject) { - this.getHibernateTemplate().save(extrinsicObject); - } - - public void mergeExtrinsicObject(ExtrinsicObject extrinsicObject) { - this.getHibernateTemplate().merge(extrinsicObject); - } - - public void deleteExtrinsicObject(ExtrinsicObject extrinsicObject) { - this.getHibernateTemplate().delete(extrinsicObject); - } - - @SuppressWarnings("unchecked") - public List<ExtrinsicObject> loadAllExtrinsicObject() { - return this.getHibernateTemplate().loadAll(ExtrinsicObject.class); - } - - public ExtrinsicObject findExtrinsicObjectById(long id) { - return (ExtrinsicObject) this.getHibernateTemplate().load(ExtrinsicObject.class, id); - } - - /** - * ObjectRef - */ - public void saveObjectRef(ObjectRef objectRef) { - this.getHibernateTemplate().save(objectRef); - } - - public void mergeObjectRef(ObjectRef objectRef) { - this.getHibernateTemplate().merge(objectRef); - } - - public void deleteObjectRef(ObjectRef objectRef) { - this.getHibernateTemplate().delete(objectRef); - } - - @SuppressWarnings("unchecked") - public List<ObjectRef> loadAllObjectRef() { - return this.getHibernateTemplate().loadAll(ObjectRef.class); - } - - public ObjectRef findObjectRefById(long id) { - return (ObjectRef) this.getHibernateTemplate().load(ObjectRef.class, id); - } - - /** - * RegistryObject - */ - public void saveRegistryObject(RegistryObject registryObject) { - this.getHibernateTemplate().save(registryObject); - } - - public void mergeRegistryObject(RegistryObject registryObject) { - this.getHibernateTemplate().merge(registryObject); - } - - public void deleteRegistryObject(RegistryObject registryObject) { - this.getHibernateTemplate().delete(registryObject); - } - - @SuppressWarnings("unchecked") - public List<RegistryObject> loadAllRegistryObject() { - return this.getHibernateTemplate().loadAll(RegistryObject.class); - } - - public RegistryObject findRegistryObjectById(long id) { - return (RegistryObject) this.getHibernateTemplate().load(RegistryObject.class, id); - } - - /** - * RegistryPackage - */ - public void saveRegistryPackage(RegistryPackage registryPackage) { - this.getHibernateTemplate().save(registryPackage); - } - - public void mergeRegistryPackage(RegistryPackage registryPackage) { - this.getHibernateTemplate().merge(registryPackage); - } - - public void deleteRegistryPackage(RegistryPackage registryPackage) { - this.getHibernateTemplate().delete(registryPackage); - } - - @SuppressWarnings("unchecked") - public List<RegistryPackage> loadAllRegistryPackage() { - return this.getHibernateTemplate().loadAll(RegistryPackage.class); - } - - public RegistryPackage findRegistryPackageById(long id) { - return (RegistryPackage) this.getHibernateTemplate().load(RegistryPackage.class, id); - } - - /** - * Slot - */ - public void saveSlot(Slot slot) { - this.getHibernateTemplate().save(slot); - } - - public void mergeSlot(Slot slot) { - this.getHibernateTemplate().merge(slot); - } - - public void deleteSlot(Slot slot) { - this.getHibernateTemplate().delete(slot); - } - - @SuppressWarnings("unchecked") - public List<Slot> loadAllSlot() { - return this.getHibernateTemplate().loadAll(Slot.class); - } - - public Slot findSlotById(long id) { - return (Slot) this.getHibernateTemplate().load(Slot.class, id); - } - -} \ No newline at end of file Copied: sandbox/3.0.x/geonetwork-persistence-ebrim/src/test/java/org/geonetwork/dao/ebrim/informationmodel/CoreDaoTest.java (from rev 1870, sandbox/3.0.x/geonetwork-persistence-ebrim/src/test/java/org/geonetwork/dao/ebrim/informationmodel/core/CoreDaoTest.java) =================================================================== --- sandbox/3.0.x/geonetwork-persistence-ebrim/src/test/java/org/geonetwork/dao/ebrim/informationmodel/CoreDaoTest.java (rev 0) +++ sandbox/3.0.x/geonetwork-persistence-ebrim/src/test/java/org/geonetwork/dao/ebrim/informationmodel/CoreDaoTest.java 2008-12-22 09:54:53 UTC (rev 1872) @@ -0,0 +1,181 @@ +package org.geonetwork.dao.ebrim.informationmodel; + +import org.geonetwork.dao.ebrim.AbstractDaoTest; +import org.geonetwork.dao.ebrim.informationmodel.CoreDao; +import org.geonetwork.dao.ebrim.provenance.DaoTestDelegate; +import org.geonetwork.domain.ebrim.informationmodel.core.ExternalIdentifier; +import org.geonetwork.domain.ebrim.informationmodel.core.ExternalLink; +import org.geonetwork.domain.ebrim.informationmodel.core.ExtrinsicObject; +import org.geonetwork.domain.ebrim.informationmodel.core.ObjectRef; +import org.geonetwork.domain.ebrim.informationmodel.core.RegistryObject; +import org.geonetwork.domain.ebrim.informationmodel.core.Slot; +import org.geonetwork.domain.ebrim.informationmodel.core.VersionInfo; +import org.geonetwork.domain.ebrim.informationmodel.core.datatype.LongName; +import org.geonetwork.domain.ebrim.informationmodel.core.datatype.String16; +import org.geonetwork.domain.ebrim.test.utilities.core.ObjectRefFactory; + +/** + * TestDao for ExternalIdentifier ExternalLink ExtrinsicObject ObjectRef RegistryObject + * RegistryPackage Slot VersionInfo + * + * @author Erik van Ingen + */ +public class CoreDaoTest extends AbstractDaoTest { + + CoreDao coreDao; + + public void setCoreDao(CoreDao coreDao) { + this.coreDao = coreDao; + } + + /** + * ExternalIdentifier + */ + public void testSaveExternalIdentifier() { + new DaoTestDelegate(coreDao).testSave(ExternalIdentifier.class); + } + + public void testMergeExternalIdentifier() { + new DaoTestDelegate(coreDao).testMerge(ExternalIdentifier.class, "identificationScheme"); + } + + public void testDeleteExternalIdentifier() { + new DaoTestDelegate(coreDao).testDelete(ExternalIdentifier.class); + } + + public void testfindExternalIdentifierById() { + new DaoTestDelegate(coreDao).testfindById(ExternalIdentifier.class); + } + + /** + * ExternalLink + */ + public void testSaveExternalLink() { + new DaoTestDelegate(coreDao).testSave(ExternalLink.class); + } + + public void testMergeExternalLink() { + new DaoTestDelegate(coreDao).testMerge(ExternalLink.class, "externalURI"); + } + + public void testDeleteExternalLink() { + new DaoTestDelegate(coreDao).testDelete(ExternalLink.class); + } + + public void testfindExternalLinkById() { + new DaoTestDelegate(coreDao).testfindById(ExternalLink.class); + } + + /** + * ExtrinsicObject + */ + public void testSaveExtrinsicObject() { + new DaoTestDelegate(coreDao).testSave(ExtrinsicObject.class); + } + + public void testMergeExtrinsicObject() { + new DaoTestDelegate(coreDao).testMerge(ExtrinsicObject.class, "mimeType"); + } + + public void testDeleteExtrinsicObject() { + new DaoTestDelegate(coreDao).testDelete(ExtrinsicObject.class); + } + + public void testfindExtrinsicObjectById() { + new DaoTestDelegate(coreDao).testfindById(ExtrinsicObject.class); + } + + /** + * ObjectRef + */ + public void testSaveObjectRef() { + + new DaoTestDelegate(coreDao).testSave(ObjectRef.class); + } + + public void testMergeObjectRef() { + ObjectRef objectRef = ObjectRefFactory.create(); + coreDao.saveObjectRef(objectRef); + boolean value = objectRef.getCreateReplica(); + objectRef.setCreateReplica(!objectRef.getCreateReplica()); + coreDao.mergeObjectRef(objectRef); + assertNotSame(value, objectRef.getCreateReplica()); + } + + public void testDeleteObjectRef() { + new DaoTestDelegate(coreDao).testDelete(ObjectRef.class); + } + + public void testfindObjectRefById() { + new DaoTestDelegate(coreDao).testfindById(ObjectRef.class); + } + + /** + * RegistryObject + */ + public void testSaveRegistryObject() { + new DaoTestDelegate(coreDao).testSaveExpects(RegistryObject.class, 3); + } + + public void testMergeRegistryObject1() { + new DaoTestDelegate(coreDao).testMergeExpects(RegistryObject.class, "lid", 3); + } + + public void testMergeRegistryObject2() { + new DaoTestDelegate(coreDao).testMergeExpects(RegistryObject.class, "status", 3); + } + + public void testMergeRegistryObject3() { + new DaoTestDelegate(coreDao).testMergeExpects(RegistryObject.class, "objectType", 3); + } + + public void testDeleteRegistryObject() { + new DaoTestDelegate(coreDao).testDeleteExpects(RegistryObject.class, 3); + } + + public void testfindRegistryObjectById() { + new DaoTestDelegate(coreDao).testfindByIdExpects(RegistryObject.class, 3); + } + + /** + * RegistryPackage + */ + // public void testSaveRegistryPackage() { + // new DaoTestDelegate(coreDao).testSave(RegistryPackage.class); + // } + // + // public void testMergeRegistryPackage() { + // new DaoTestDelegate(coreDao).testMerge(RegistryPackage.class, "identificationScheme"); + // } + // + // public void testDeleteRegistryPackage() { + // new DaoTestDelegate(coreDao).testDelete(RegistryPackage.class); + // } + // + // public void testfindEmailAddressById() { + // new DaoTestDelegate(coreDao).testfindById(RegistryPackage.class); + // } + /** + * Slot + */ + public void testSaveSlot() { + new DaoTestDelegate(coreDao).testSave(Slot.class); + } + + public void testMergeSlot1() { + new DaoTestDelegate(coreDao).testMerge(Slot.class, "name"); + } + + public void testMergeSlot2() { + new DaoTestDelegate(coreDao).testMerge(Slot.class, "slotType"); + } + + public void testDeleteSlot() { + new DaoTestDelegate(coreDao).testDelete(Slot.class); + } + + public void testfindEmailAddressById() { + new DaoTestDelegate(coreDao).testfindById(Slot.class); + } + +} Property changes on: sandbox/3.0.x/geonetwork-persistence-ebrim/src/test/java/org/geonetwork/dao/ebrim/informationmodel/CoreDaoTest.java ___________________________________________________________________ Added: svn:mergeinfo + Deleted: sandbox/3.0.x/geonetwork-persistence-ebrim/src/test/java/org/geonetwork/dao/ebrim/informationmodel/core/CoreDaoTest.java =================================================================== --- sandbox/3.0.x/geonetwork-persistence-ebrim/src/test/java/org/geonetwork/dao/ebrim/informationmodel/core/CoreDaoTest.java 2008-12-22 09:47:29 UTC (rev 1871) +++ sandbox/3.0.x/geonetwork-persistence-ebrim/src/test/java/org/geonetwork/dao/ebrim/informationmodel/core/CoreDaoTest.java 2008-12-22 09:54:53 UTC (rev 1872) @@ -1,180 +0,0 @@ -package org.geonetwork.dao.ebrim.informationmodel.core; - -import org.geonetwork.dao.ebrim.AbstractDaoTest; -import org.geonetwork.dao.ebrim.provenance.DaoTestDelegate; -import org.geonetwork.domain.ebrim.informationmodel.core.ExternalIdentifier; -import org.geonetwork.domain.ebrim.informationmodel.core.ExternalLink; -import org.geonetwork.domain.ebrim.informationmodel.core.ExtrinsicObject; -import org.geonetwork.domain.ebrim.informationmodel.core.ObjectRef; -import org.geonetwork.domain.ebrim.informationmodel.core.RegistryObject; -import org.geonetwork.domain.ebrim.informationmodel.core.Slot; -import org.geonetwork.domain.ebrim.informationmodel.core.VersionInfo; -import org.geonetwork.domain.ebrim.informationmodel.core.datatype.LongName; -import org.geonetwork.domain.ebrim.informationmodel.core.datatype.String16; -import org.geonetwork.domain.ebrim.test.utilities.core.ObjectRefFactory; - -/** - * TestDao for ExternalIdentifier ExternalLink ExtrinsicObject ObjectRef RegistryObject - * RegistryPackage Slot VersionInfo - * - * @author Erik van Ingen - */ -public class CoreDaoTest extends AbstractDaoTest { - - CoreDao coreDao; - - public void setCoreDao(CoreDao coreDao) { - this.coreDao = coreDao; - } - - /** - * ExternalIdentifier - */ - public void testSaveExternalIdentifier() { - new DaoTestDelegate(coreDao).testSave(ExternalIdentifier.class); - } - - public void testMergeExternalIdentifier() { - new DaoTestDelegate(coreDao).testMerge(ExternalIdentifier.class, "identificationScheme"); - } - - public void testDeleteExternalIdentifier() { - new DaoTestDelegate(coreDao).testDelete(ExternalIdentifier.class); - } - - public void testfindExternalIdentifierById() { - new DaoTestDelegate(coreDao).testfindById(ExternalIdentifier.class); - } - - /** - * ExternalLink - */ - public void testSaveExternalLink() { - new DaoTestDelegate(coreDao).testSave(ExternalLink.class); - } - - public void testMergeExternalLink() { - new DaoTestDelegate(coreDao).testMerge(ExternalLink.class, "externalURI"); - } - - public void testDeleteExternalLink() { - new DaoTestDelegate(coreDao).testDelete(ExternalLink.class); - } - - public void testfindExternalLinkById() { - new DaoTestDelegate(coreDao).testfindById(ExternalLink.class); - } - - /** - * ExtrinsicObject - */ - public void testSaveExtrinsicObject() { - new DaoTestDelegate(coreDao).testSave(ExtrinsicObject.class); - } - - public void testMergeExtrinsicObject() { - new DaoTestDelegate(coreDao).testMerge(ExtrinsicObject.class, "mimeType"); - } - - public void testDeleteExtrinsicObject() { - new DaoTestDelegate(coreDao).testDelete(ExtrinsicObject.class); - } - - public void testfindExtrinsicObjectById() { - new DaoTestDelegate(coreDao).testfindById(ExtrinsicObject.class); - } - - /** - * ObjectRef - */ - public void testSaveObjectRef() { - - new DaoTestDelegate(coreDao).testSave(ObjectRef.class); - } - - public void testMergeObjectRef() { - ObjectRef objectRef = ObjectRefFactory.create(); - coreDao.saveObjectRef(objectRef); - boolean value = objectRef.getCreateReplica(); - objectRef.setCreateReplica(!objectRef.getCreateReplica()); - coreDao.mergeObjectRef(objectRef); - assertNotSame(value, objectRef.getCreateReplica()); - } - - public void testDeleteObjectRef() { - new DaoTestDelegate(coreDao).testDelete(ObjectRef.class); - } - - public void testfindObjectRefById() { - new DaoTestDelegate(coreDao).testfindById(ObjectRef.class); - } - - /** - * RegistryObject - */ - public void testSaveRegistryObject() { - new DaoTestDelegate(coreDao).testSaveExpects(RegistryObject.class, 3); - } - - public void testMergeRegistryObject1() { - new DaoTestDelegate(coreDao).testMergeExpects(RegistryObject.class, "lid", 3); - } - - public void testMergeRegistryObject2() { - new DaoTestDelegate(coreDao).testMergeExpects(RegistryObject.class, "status", 3); - } - - public void testMergeRegistryObject3() { - new DaoTestDelegate(coreDao).testMergeExpects(RegistryObject.class, "objectType", 3); - } - - public void testDeleteRegistryObject() { - new DaoTestDelegate(coreDao).testDeleteExpects(RegistryObject.class, 3); - } - - public void testfindRegistryObjectById() { - new DaoTestDelegate(coreDao).testfindByIdExpects(RegistryObject.class, 3); - } - - /** - * RegistryPackage - */ - // public void testSaveRegistryPackage() { - // new DaoTestDelegate(coreDao).testSave(RegistryPackage.class); - // } - // - // public void testMergeRegistryPackage() { - // new DaoTestDelegate(coreDao).testMerge(RegistryPackage.class, "identificationScheme"); - // } - // - // public void testDeleteRegistryPackage() { - // new DaoTestDelegate(coreDao).testDelete(RegistryPackage.class); - // } - // - // public void testfindEmailAddressById() { - // new DaoTestDelegate(coreDao).testfindById(RegistryPackage.class); - // } - /** - * Slot - */ - public void testSaveSlot() { - new DaoTestDelegate(coreDao).testSave(Slot.class); - } - - public void testMergeSlot1() { - new DaoTestDelegate(coreDao).testMerge(Slot.class, "name"); - } - - public void testMergeSlot2() { - new DaoTestDelegate(coreDao).testMerge(Slot.class, "slotType"); - } - - public void testDeleteSlot() { - new DaoTestDelegate(coreDao).testDelete(Slot.class); - } - - public void testfindEmailAddressById() { - new DaoTestDelegate(coreDao).testfindById(Slot.class); - } - -} Modified: sandbox/3.0.x/geonetwork-persistence-ebrim/src/test/resources/applicationContext-hibernate-test.xml =================================================================== --- sandbox/3.0.x/geonetwork-persistence-ebrim/src/test/resources/applicationContext-hibernate-test.xml 2008-12-22 09:47:29 UTC (rev 1871) +++ sandbox/3.0.x/geonetwork-persistence-ebrim/src/test/resources/applicationContext-hibernate-test.xml 2008-12-22 09:54:53 UTC (rev 1872) @@ -106,7 +106,7 @@ </bean> <bean id="provenanceDao" class="org.geonetwork.dao.ebrim.provenance.ProvenanceDao" parent="hibernateDaoSupport" /> - <bean id="coreDao" class="org.geonetwork.dao.ebrim.informationmodel.core.CoreDao" parent="hibernateDaoSupport" /> + <bean id="coreDao" class="org.geonetwork.dao.ebrim.informationmodel.CoreDao" parent="hibernateDaoSupport" /> <bean id="provenanceSearchDao" class="org.geonetwork.dao.ebrim.provenance.ProvenanceSearchDao" parent="hibernateDaoSupport" /> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |