mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
AVM DAO refactor
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@16138 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -1,3 +1,26 @@
|
||||
/*
|
||||
* Copyright (C) 2005-2009 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
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
* As a special exception to the terms and conditions of version 2.0 of
|
||||
* the GPL, you may redistribute this Program in connection with Free/Libre
|
||||
* and Open Source Software ("FLOSS") applications as described in Alfresco's
|
||||
* FLOSS exception. You should have recieved a copy of the text describing
|
||||
* the FLOSS exception, and it is also available here:
|
||||
* http://www.alfresco.com/legal/licensing" */
|
||||
|
||||
package org.alfresco.repo.avm;
|
||||
|
||||
import java.util.List;
|
||||
@@ -11,8 +34,27 @@ import org.alfresco.util.GUID;
|
||||
|
||||
public class AVMDiffPerformanceTest extends AVMServiceTestBase
|
||||
{
|
||||
public void testSetup() throws Exception
|
||||
{
|
||||
super.testSetup();
|
||||
}
|
||||
|
||||
public void xtest_1000() throws Exception
|
||||
{
|
||||
runTest(1000);
|
||||
}
|
||||
|
||||
public void ytest_10000() throws Exception
|
||||
{
|
||||
runTest(10000);
|
||||
}
|
||||
|
||||
public void test_2000() throws Exception
|
||||
{
|
||||
runTest(2000);
|
||||
}
|
||||
|
||||
public void test_10000() throws Exception
|
||||
private void runTest(final int cnt) throws Exception
|
||||
{
|
||||
fTransactionService.getRetryingTransactionHelper().doInTransaction(new RetryingTransactionCallback<Object>() {
|
||||
|
||||
@@ -28,7 +70,7 @@ public class AVMDiffPerformanceTest extends AVMServiceTestBase
|
||||
fService.createLayeredDirectory("StagingArea:/www", "SandBox:/", "www");
|
||||
|
||||
|
||||
for(int i = 0; i < 10000; i++)
|
||||
for(int i = 0; i < cnt; i++)
|
||||
{
|
||||
String name = GUID.generate();
|
||||
fService.createFile("SandBox:/www", name).close();
|
||||
@@ -36,21 +78,21 @@ public class AVMDiffPerformanceTest extends AVMServiceTestBase
|
||||
System.out.println("Create SandBox:/www");
|
||||
|
||||
|
||||
for(int i = 0; i < 10000; i++)
|
||||
for(int i = 0; i < cnt; i++)
|
||||
{
|
||||
String name = GUID.generate();
|
||||
fService.createFile("SandBox:/www/test", name).close();
|
||||
}
|
||||
System.out.println("Create SandBox:/www/test");
|
||||
|
||||
for(int i = 0; i < 10000; i++)
|
||||
for(int i = 0; i < cnt; i++)
|
||||
{
|
||||
String name = GUID.generate();
|
||||
fService.createFile("StagingArea:/www", name).close();
|
||||
}
|
||||
System.out.println("Create StagingArea:/www");
|
||||
|
||||
for(int i = 0; i < 10000; i++)
|
||||
for(int i = 0; i < cnt; i++)
|
||||
{
|
||||
String name = GUID.generate();
|
||||
fService.createFile("StagingArea:/www/test", name).close();
|
||||
@@ -62,9 +104,7 @@ public class AVMDiffPerformanceTest extends AVMServiceTestBase
|
||||
long end = System.nanoTime();
|
||||
System.out.println("Diff in "+( (end-start)/1000000000.0f));
|
||||
|
||||
assertEquals(20000, diffs.size());
|
||||
|
||||
|
||||
assertEquals(cnt*2, diffs.size());
|
||||
}
|
||||
finally
|
||||
{
|
||||
@@ -73,7 +113,6 @@ public class AVMDiffPerformanceTest extends AVMServiceTestBase
|
||||
}
|
||||
return null;
|
||||
}});
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user