]> git.argeo.org Git - gpl/argeo-slc.git/blob - org.argeo.slc.core/src/test/java/org/argeo/slc/hibernate/structure/tree/TreeSPathDaoHibernateTest.java
Introduce tree test result collections
[gpl/argeo-slc.git] / org.argeo.slc.core / src / test / java / org / argeo / slc / hibernate / structure / tree / TreeSPathDaoHibernateTest.java
1 package org.argeo.slc.hibernate.structure.tree;
2
3 import org.argeo.slc.core.structure.tree.TreeSPath;
4 import org.argeo.slc.dao.structure.tree.TreeSPathDao;
5 import org.argeo.slc.unit.AbstractSpringTestCase;
6
7 public class TreeSPathDaoHibernateTest extends AbstractSpringTestCase {
8
9 public void testCreate() {
10 TreeSPathDao treeSPathDao = getBean(TreeSPathDao.class);
11
12 String pathParentStr = "/root/testParent";
13 String pathStr = pathParentStr + "/test";
14 TreeSPath path = TreeSPath.parseToCreatePath(pathStr);
15 treeSPathDao.create(path);
16
17 TreeSPath pathChild = treeSPathDao.getTreeSPath(pathStr);
18 assertEquals(path, pathChild);
19
20 TreeSPath pathParent = treeSPathDao.getTreeSPath(pathParentStr);
21 assertEquals(path.getParent(), pathParent);
22 }
23
24 @Override
25 protected String getApplicationContextLocation() {
26 return "org/argeo/slc/hibernate/applicationContext.xml";
27 }
28
29 }