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:
@@ -10,11 +10,12 @@
|
||||
<property name="current_session_context_class">thread</property>
|
||||
<property name="dialect">org.hibernate.dialect.MySQLInnoDBDialect</property>
|
||||
<property name="show_sql">false</property>
|
||||
<property name="order_updates">true</property>
|
||||
<property name="connection.isolation">2</property>
|
||||
<property name="c3po.min_size">5</property>
|
||||
<property name="c3po.max_size">20</property>
|
||||
<property name="c3po.timeout">900</property>
|
||||
<property name="c3po.max_statements">50</property>
|
||||
<property name="c3p0.min_size">5</property>
|
||||
<property name="c3p0.max_size">20</property>
|
||||
<property name="c3p0.timeout">900</property>
|
||||
<property name="c3p0.max_statements">500</property>
|
||||
<!-- <property name="cache.use_query_cache">true</property> -->
|
||||
<mapping resource="org/alfresco/repo/avm/hibernate/AVM.hbm.xml"/>
|
||||
</session-factory>
|
||||
|
@@ -6,4 +6,4 @@ log4j.appender.stdout.layout.ConversionPattern=%d %5p %c{1}:%m%n
|
||||
|
||||
### Set log levels.
|
||||
log4j.rootLogger=warn, stdout
|
||||
log4j.logger.org.hibernate=warn
|
||||
log4j.logger.org.hibernate=info
|
||||
|
@@ -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,7 +109,7 @@
|
||||
<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"/>
|
||||
|
Reference in New Issue
Block a user