mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
Merged V2.1 to HEAD
6455: OpenOffice transformer and extractor register regardless of the initial connection state. 6456: Fix for WCM-636 (Clicking OK twice while deleting web project results in exception) 6457: Updated installers and associated config 6458: AR-1669 Add getQnamePath to Javascript 6459: Fix for AWC-1456 - Word and Excel documents were being stored as octet streams rather than their correct mimetype 6460: Reverse order of reject & approve transitions, so that approve appears first in list of ui actions. 6461: Removed Process.exe (often detected as a virus) and updated config wizard. 6462: Switch to synchronous indexing for AVM by default 6463: Better support to query the state of AVM indexes 6464: Added Office 2007 document mimetypes and icons 6465: Added Office 2007 icons without the typo this time git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@6736 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -358,7 +358,14 @@ public class AVMServiceTest extends AVMServiceTestBase
|
||||
tx.begin();
|
||||
if(fService.getStore("avmAsynchronousTest") != null)
|
||||
{
|
||||
assertTrue(fIndexingInterceptor.hasIndexBeenCreated("avmAsynchronousTest"));
|
||||
fService.purgeStore("avmAsynchronousTest");
|
||||
assertTrue(fIndexingInterceptor.hasIndexBeenCreated("avmAsynchronousTest"));
|
||||
assertFalse(fIndexingInterceptor.hasIndexBeenCreated("bananaStoreWoof"));
|
||||
}
|
||||
else
|
||||
{
|
||||
assertFalse(fIndexingInterceptor.hasIndexBeenCreated("avmAsynchronousTest"));
|
||||
}
|
||||
StoreRef storeRef = AVMNodeConverter.ToStoreRef("avmAsynchronousTest");
|
||||
Indexer indexer = fIndexerAndSearcher.getIndexer(storeRef);
|
||||
@@ -368,6 +375,12 @@ public class AVMServiceTest extends AVMServiceTestBase
|
||||
avmIndexer.deleteIndex("avmAsynchronousTest", IndexMode.SYNCHRONOUS);
|
||||
}
|
||||
tx.commit();
|
||||
|
||||
tx = fTransactionService.getUserTransaction();
|
||||
tx.begin();
|
||||
assertEquals(-1, fIndexingInterceptor.getLastIndexedSnapshot("bananaStoreWoof"));
|
||||
assertEquals(-1, fIndexingInterceptor.getLastIndexedSnapshot("avmAsynchronousTest"));
|
||||
tx.commit();
|
||||
|
||||
// TODO: Suspend and resume indexing in case we are really unlucky and hit an index before we expect it.
|
||||
|
||||
@@ -379,8 +392,19 @@ public class AVMServiceTest extends AVMServiceTestBase
|
||||
results.close();
|
||||
|
||||
fService.createStore("avmAsynchronousTest");
|
||||
|
||||
tx = fTransactionService.getUserTransaction();
|
||||
tx.begin();
|
||||
assertEquals(0, fIndexingInterceptor.getLastIndexedSnapshot("avmAsynchronousTest"));
|
||||
tx.commit();
|
||||
|
||||
fService.createSnapshot("avmAsynchronousTest", null, null);
|
||||
|
||||
tx = fTransactionService.getUserTransaction();
|
||||
tx.begin();
|
||||
assertEquals(0, fIndexingInterceptor.getLastIndexedSnapshot("avmAsynchronousTest"));
|
||||
tx.commit();
|
||||
|
||||
results = searchService.query(storeRef, "lucene", "PATH:\"//.\"");
|
||||
assertEquals(1, results.length());
|
||||
results.close();
|
||||
@@ -388,8 +412,27 @@ public class AVMServiceTest extends AVMServiceTestBase
|
||||
fService.createDirectory("avmAsynchronousTest:/", "a");
|
||||
fService.createDirectory("avmAsynchronousTest:/a", "b");
|
||||
fService.createDirectory("avmAsynchronousTest:/a/b", "c");
|
||||
|
||||
tx = fTransactionService.getUserTransaction();
|
||||
tx.begin();
|
||||
assertEquals(0, fIndexingInterceptor.getLastIndexedSnapshot("avmAsynchronousTest"));
|
||||
assertTrue(fIndexingInterceptor.isIndexUpToDate("avmAsynchronousTest"));
|
||||
tx.commit();
|
||||
|
||||
fService.createSnapshot("avmAsynchronousTest", null, null);
|
||||
|
||||
tx = fTransactionService.getUserTransaction();
|
||||
tx.begin();
|
||||
assertEquals(1, fIndexingInterceptor.getLastIndexedSnapshot("avmAsynchronousTest"));
|
||||
assertTrue(fIndexingInterceptor.isIndexUpToDate("avmAsynchronousTest"));
|
||||
assertFalse(fIndexingInterceptor.isIndexUpToDateAndSearchable("avmAsynchronousTest"));
|
||||
assertEquals(IndexMode.ASYNCHRONOUS, fIndexingInterceptor.getIndexMode("avmAsynchronousTest"));
|
||||
assertEquals(IndexMode.SYNCHRONOUS, fIndexingInterceptor.getIndexMode("main"));
|
||||
assertTrue(fIndexingInterceptor.isSnapshotIndexed("avmAsynchronousTest", 0));
|
||||
assertTrue(fIndexingInterceptor.isSnapshotIndexed("avmAsynchronousTest", 1));
|
||||
assertFalse(fIndexingInterceptor.isSnapshotIndexed("avmAsynchronousTest", 2));
|
||||
tx.commit();
|
||||
|
||||
results = searchService.query(storeRef, "lucene", "PATH:\"//.\"");
|
||||
assertEquals(1, results.length());
|
||||
results.close();
|
||||
@@ -400,6 +443,14 @@ public class AVMServiceTest extends AVMServiceTestBase
|
||||
assertEquals(4, results.length());
|
||||
results.close();
|
||||
|
||||
|
||||
tx = fTransactionService.getUserTransaction();
|
||||
tx.begin();
|
||||
assertEquals(1, fIndexingInterceptor.getLastIndexedSnapshot("avmAsynchronousTest"));
|
||||
assertTrue(fIndexingInterceptor.isIndexUpToDate("avmAsynchronousTest"));
|
||||
assertTrue(fIndexingInterceptor.isIndexUpToDateAndSearchable("avmAsynchronousTest"));
|
||||
tx.commit();
|
||||
|
||||
fService.purgeStore("avmAsynchronousTest");
|
||||
|
||||
results = searchService.query(storeRef, "lucene", "PATH:\"//.\"");
|
||||
|
@@ -31,6 +31,7 @@ import java.util.TreeMap;
|
||||
|
||||
import org.alfresco.model.ContentModel;
|
||||
import org.alfresco.repo.content.MimetypeMap;
|
||||
import org.alfresco.repo.search.AVMSnapShotTriggeredIndexingMethodInterceptor;
|
||||
import org.alfresco.repo.search.IndexerAndSearcher;
|
||||
import org.alfresco.repo.search.impl.lucene.LuceneQueryParser;
|
||||
import org.alfresco.service.cmr.avm.AVMNodeDescriptor;
|
||||
@@ -81,6 +82,8 @@ public class AVMServiceTestBase extends TestCase
|
||||
*/
|
||||
private long fStartTime;
|
||||
|
||||
protected static AVMSnapShotTriggeredIndexingMethodInterceptor fIndexingInterceptor;
|
||||
|
||||
protected static TransactionService fTransactionService;
|
||||
|
||||
protected static IndexerAndSearcher fIndexerAndSearcher;
|
||||
@@ -104,6 +107,8 @@ public class AVMServiceTestBase extends TestCase
|
||||
fIndexerAndSearcher = (IndexerAndSearcher)fContext.getBean("indexerAndSearcherFactory");
|
||||
fTransactionService = (TransactionService)fContext.getBean("transactionComponent");
|
||||
fLockingService = (AVMLockingService)fContext.getBean("AVMLockingService");
|
||||
fIndexingInterceptor = (AVMSnapShotTriggeredIndexingMethodInterceptor)fContext.getBean("avmSnapShotTriggeredIndexingMethodInterceptor");
|
||||
|
||||
AuthenticationService authService = (AuthenticationService)fContext.getBean("AuthenticationService");
|
||||
authService.authenticate("admin", "admin".toCharArray());
|
||||
CreateStoreTxnListener cstl = (CreateStoreTxnListener)fContext.getBean("createStoreTxnListener");
|
||||
|
Reference in New Issue
Block a user