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.
|
||||
|
@@ -109,10 +109,10 @@
|
||||
<property name="isRoot" column="is_root" type="boolean" />
|
||||
<!-- A map of names to DirectoryEntries. In the AVM world, it makes sense
|
||||
that nodes don't know there own names, only their containers do. -->
|
||||
<map name="children" cascade="all">
|
||||
<map name="children" cascade="all" fetch="join" lazy="true">
|
||||
<cache usage="read-write"/>
|
||||
<key column="directory_id" />
|
||||
<map-key type="string" column="name" />
|
||||
<key column="directory_id"/>
|
||||
<map-key type="string" column="name"/>
|
||||
<composite-element
|
||||
class="DirectoryEntry">
|
||||
<property name="type" type="int"
|
||||
|
Reference in New Issue
Block a user