mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
Added a sanity performance test.
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/WCM-DEV2/root@2941 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -411,6 +411,37 @@ public class AVMServiceTest extends TestCase
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Test adding 100 files to each directory.
|
||||
*/
|
||||
public void testAdd100()
|
||||
{
|
||||
try
|
||||
{
|
||||
String [] dirs = { "a", "b", "c", "d", "e", "f", "g", "h", "i", "j" };
|
||||
for (String dir : dirs)
|
||||
{
|
||||
fService.createDirectory("main:/", dir);
|
||||
dir = "main:/" + dir;
|
||||
for (int i = 0; i < 50; i++)
|
||||
{
|
||||
fService.createFile(dir, "file" + i);
|
||||
System.out.println(dir + "/file" + i);
|
||||
PrintStream out =
|
||||
new PrintStream(fService.getFileOutputStream(dir + "/file" + i));
|
||||
out.println("I am " + dir + "/file" + i);
|
||||
out.close();
|
||||
}
|
||||
}
|
||||
fService.createSnapshot("main");
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
e.printStackTrace(System.err);
|
||||
fail();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper to write a recursive listing of a repository at a given version.
|
||||
* @param repoName The name of the repository.
|
||||
|
Reference in New Issue
Block a user