Added QName indexed Properties to AVMNodes.

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/WCM-DEV2/root@3357 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Britt Park
2006-07-19 22:15:09 +00:00
parent e5eb45da0f
commit e2eec832f1
20 changed files with 700 additions and 0 deletions

View File

@@ -29,6 +29,8 @@ import java.util.Map;
import java.util.TreeMap;
import org.alfresco.repo.avm.util.BulkLoader;
import org.alfresco.repo.domain.PropertyValue;
import org.alfresco.service.namespace.QName;
/**
* Big test of AVM behavior.
@@ -2018,4 +2020,28 @@ public class AVMServiceTest extends AVMServiceTestBase
fail();
}
}
/**
* Test properties.
*/
public void testProperties()
{
try
{
setupBasicTree();
QName name = QName.createQName("silly.uri", "SillyProperty");
PropertyValue value = new PropertyValue(name, "Silly Property Value");
fService.setProperty("main:/a/b/c/foo", name, value);
fService.createSnapshot("main");
PropertyValue returned = fService.getProperty(-1, "main:/a/b/c/foo", name);
assertEquals(value.toString(), returned.toString());
Map<QName, PropertyValue> props = fService.getProperties(-1, "main:/a/b/c/foo");
assertEquals(1, props.size());
assertEquals(value.toString(), props.get(name).toString());
}
catch (Exception e)
{
e.printStackTrace(System.err);
}
}
}