1 package org
.argeo
.slc
.hibernate
.structure
.tree
;
3 import org
.argeo
.slc
.core
.structure
.SimpleSElement
;
4 import org
.argeo
.slc
.core
.structure
.tree
.TreeSPath
;
5 import org
.argeo
.slc
.core
.structure
.tree
.TreeSRegistry
;
6 import org
.argeo
.slc
.dao
.structure
.tree
.TreeSPathDao
;
7 import org
.argeo
.slc
.dao
.structure
.tree
.TreeSRegistryDao
;
8 import org
.argeo
.slc
.unit
.SpringBasedTestCase
;
10 public class TreeSRegistryDaoHibernateTest
extends SpringBasedTestCase
{
12 public void testCreate() {
13 TreeSRegistryDao treeSRegistryDao
= (TreeSRegistryDao
) getContext()
14 .getBean("treeSRegistryDao");
16 TreeSPathDao treeSPathDao
= (TreeSPathDao
) getContext().getBean(
19 TreeSPath root
= TreeSPath
.parseToCreatePath("/root");
20 TreeSPath path
= root
.createChild("test");
22 treeSPathDao
.create(root
);
23 treeSPathDao
.create(path
);
25 TreeSRegistry registry
= new TreeSRegistry();
26 registry
.setRoot(root
);
28 registry
.register(path
, new SimpleSElement(desc
));
30 treeSRegistryDao
.create(registry
);
32 TreeSRegistry registry2
= treeSRegistryDao
.getTreeSRegistry(path
);
33 SimpleSElement element
= registry2
.getElements().get(path
);
34 assertEquals(desc
, element
.getDescription());
38 protected String
getApplicationContextLocation() {
39 return "org/argeo/slc/hibernate/applicationContext.xml";