diff --git a/config/alfresco/model-specific-services-context.xml b/config/alfresco/model-specific-services-context.xml
index ed4d309303..0c831de690 100644
--- a/config/alfresco/model-specific-services-context.xml
+++ b/config/alfresco/model-specific-services-context.xml
@@ -91,13 +91,13 @@
-
+
-
+
-
+
@@ -109,7 +109,7 @@
-
+
diff --git a/source/java/org/alfresco/repo/avm/AVMServiceTest.java b/source/java/org/alfresco/repo/avm/AVMServiceTest.java
index a2fc6ddb8b..6748ec5ec1 100644
--- a/source/java/org/alfresco/repo/avm/AVMServiceTest.java
+++ b/source/java/org/alfresco/repo/avm/AVMServiceTest.java
@@ -96,11 +96,108 @@ import org.alfresco.util.Pair;
/**
* Big test of AVM behavior.
- *
+ *
* @author britt
*/
public class AVMServiceTest extends AVMServiceTestBase
{
+ public void test_WCM_949() throws Exception
+ {
+ try
+ {
+ fService.createStore("StagingArea");
+ fService.createStore("SandBox");
+
+ fService.createDirectory("StagingArea:/", "www");
+ fService.createLayeredDirectory("StagingArea:/www", "SandBox:/", "www");
+
+ fService.createDirectory("SandBox:/www", "TestFolder");
+ fService.createFile("SandBox:/www/TestFolder", "test1").close();
+
+ List diffs = fSyncService.compare(-1, "SandBox:/www", -1, "StagingArea:/www", null);
+ fSyncService.update(diffs, null, true, true, false, false, "one", "one");
+ AVMDAOs.Instance().fAVMNodeDAO.flush();
+ fSyncService.flatten("SandBox:/www", "StagingArea:/www");
+
+ StoreRef storeRef = AVMNodeConverter.ToStoreRef("StagingArea");
+ SearchService searchService = fIndexerAndSearcher.getSearcher(storeRef, true);
+ ResultSet results = searchService.query(storeRef, "lucene", "@cm\\:name:test1");
+ assertEquals(1, results.length());
+ results.close();
+
+ fService.removeNode("SandBox:/www/TestFolder");
+
+ diffs = fSyncService.compare(-1, "SandBox:/www", -1, "StagingArea:/www", null);
+ fSyncService.update(diffs, null, true, true, false, false, "one", "one");
+ AVMDAOs.Instance().fAVMNodeDAO.flush();
+ fSyncService.flatten("SandBox:/www", "StagingArea:/www");
+
+ results = searchService.query(storeRef, "lucene", "@cm\\:name:test1");
+ assertEquals(0, results.length());
+ results.close();
+
+ fService.createDirectory("SandBox:/www", "TestFolder");
+ fService.createFile("SandBox:/www/TestFolder", "test1").close();
+
+ diffs = fSyncService.compare(-1, "SandBox:/www", -1, "StagingArea:/www", null);
+ fSyncService.update(diffs, null, true, true, false, false, "one", "one");
+ AVMDAOs.Instance().fAVMNodeDAO.flush();
+ fSyncService.flatten("SandBox:/www", "StagingArea:/www");
+
+ results = searchService.query(storeRef, "lucene", "@cm\\:name:test1");
+ assertEquals(1, results.length());
+ results.close();
+ }
+ finally
+ {
+ fService.purgeStore("StagingArea");
+ fService.purgeStore("SandBox");
+ }
+
+ }
+
+ public void testPathEncoding()
+ {
+ try
+ {
+ setupBasicTree();
+ fService.createFile("main:/", "2007").close();
+ fService.createFile("main:/", "meep meep").close();
+ fService.createDirectory("main:/", "my space");
+ fService.createFile("main:/my space", "my file");
+ fService.createDirectory("main:/", "2001");
+ fService.createFile("main:/2001", "2002");
+ fService.createSnapshot("main", null, null);
+
+ StoreRef storeRef = AVMNodeConverter.ToStoreRef("main");
+ SearchService searchService = fIndexerAndSearcher.getSearcher(storeRef, true);
+ ResultSet results = searchService.query(storeRef, "lucene", "PATH:\"/meep_x0020_meep\"");
+ assertEquals(1, results.length());
+ System.out.println(results.getNodeRef(0));
+ results.close();
+
+ results = searchService.query(storeRef, "lucene", "PATH:\"/_x0032_007\"");
+ assertEquals(1, results.length());
+ System.out.println(results.getNodeRef(0));
+ results.close();
+
+ results = searchService.query(storeRef, "lucene", "PATH:\"/my_x0020_space/my_x0020_file\"");
+ assertEquals(1, results.length());
+ System.out.println(results.getNodeRef(0));
+ results.close();
+
+ results = searchService.query(storeRef, "lucene", "PATH:\"/_x0032_001/_x0032_002\"");
+ assertEquals(1, results.length());
+ System.out.println(results.getNodeRef(0));
+ results.close();
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ fail();
+ }
+ }
+
public void testRename6() throws Exception
{
try
@@ -186,25 +283,21 @@ public class AVMServiceTest extends AVMServiceTestBase
public void testLockingAwareService() throws Exception
{
AVMService oldService = fService;
- fService = (AVMService)fContext.getBean("AVMLockingAwareService");
- AuthenticationService authService = (AuthenticationService)fContext.getBean("AuthenticationService");
+ fService = (AVMService) fContext.getBean("AVMLockingAwareService");
+ AuthenticationService authService = (AuthenticationService) fContext.getBean("AuthenticationService");
try
{
- fService.setStoreProperty("main", QName.createQName(null, ".dns.main"),
- new PropertyValue(DataTypeDefinition.TEXT, "Nothing."));
+ fService.setStoreProperty("main", QName.createQName(null, ".dns.main"), new PropertyValue(DataTypeDefinition.TEXT, "Nothing."));
fService.createStore("test");
- fService.setStoreProperty("test", QName.createQName(null, ".dns.test.main"),
- new PropertyValue(DataTypeDefinition.TEXT, "Nothing."));
+ fService.setStoreProperty("test", QName.createQName(null, ".dns.test.main"), new PropertyValue(DataTypeDefinition.TEXT, "Nothing."));
setupBasicTree0();
authService.authenticateAsGuest();
// assertEquals(0, fLockingService.getUsersLocks("admin").size());
List diffs = fSyncService.compare(-1, "main:/", -1, "test:/", null);
fSyncService.update(diffs, null, false, false, false, false, null, null);
- RetryingTransactionHelper.RetryingTransactionCallback