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:
Britt Park
2006-05-23 00:05:50 +00:00
parent bd0752eb4a
commit 7440ae18a6
4 changed files with 41 additions and 9 deletions

View File

@@ -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.