Merged V2.2 to HEAD

10953: Merged V2.1 to V2.2
      10904: AVM - add test suite wrapper, update existing tests to purge test stores (rather than all stores)
      10909: AVM - unit test updates only (exposed further tests via test suite)
      10947: AVM - unit test update only (extra checks)
   10969: Merged V2.1 to V2.2 (cont)
      10904: AVM - add test suite wrapper, update existing tests to purge test stores (rather than all stores)
   11054: Fixed blind failures in AVM unit tests
   11064: AVM - unit test error handling
   11068: Temporarily remove AvmTestSuite from the build
   11074: AVM - unit tests - added error stack on concurrency tests (to show failure in build output), removed 1 hour freeze, put back AVM test suite
   11218: Merged V2.1 to V2.2
      11217: AVM - unit test fix ("n must be positive")


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@11224 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Derek Hulley
2008-10-07 00:57:23 +00:00
parent 2f2af720da
commit 5407e7ff37
13 changed files with 675 additions and 289 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2005-2007 Alfresco Software Limited.
* Copyright (C) 2005-2008 Alfresco Software Limited.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -31,41 +31,50 @@ import org.alfresco.repo.avm.util.BulkLoader;
*/
public class SimultaneousLoadTest extends AVMServiceTestBase
{
public void testSimulLoadA() throws Throwable
{
testSimultaneousLoad(1,1);
}
public void testSimulLoadB() throws Throwable
{
testSimultaneousLoad(5,3);
}
/**
* Test loading content simultaneously.
*/
public void testSimultaneousLoad()
private void testSimultaneousLoad(int n, int m) throws Throwable
{
// try
// {
// int n = 1;
// int m = 1;
// fReaper.setInactiveBaseSleep(60000);
// for (int i = 0; i < n; i++)
// {
// fService.createDirectory("main:/", "d" + i);
// }
// fService.createSnapshot("main", null, null);
// Thread [] threads = new Thread[n];
// for (int i = 0; i < n; i++)
// {
// Loader loader = new Loader("/Users/britt/stuff/" + i, "main:/d" + i, m);
// threads[i] = new Thread(loader);
// threads[i].start();
// }
// for (int i = 0; i < n; i++)
// {
// threads[i].join();
// }
// }
// catch (Exception e)
// {
// e.printStackTrace(System.err);
// fail();
// }
try
{
fReaper.setActiveBaseSleep(60000);
for (int i = 0; i < n; i++)
{
fService.createDirectory("main:/", "d" + i);
}
fService.createSnapshot("main", null, null);
Thread [] threads = new Thread[n];
for (int i = 0; i < n; i++)
{
//Loader loader = new Loader("/Users/britt/stuff/" + i, "main:/d" + i, m);
Loader loader = new Loader("source/java/org/alfresco/repo/avm", "main:/d" + i, m);
threads[i] = new Thread(loader);
threads[i].start();
}
for (int i = 0; i < n; i++)
{
threads[i].join();
}
}
catch (Exception e)
{
e.printStackTrace(System.err);
throw e;
}
}
@SuppressWarnings("unused")
private class Loader implements Runnable
{
/**