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,12 +10,13 @@
|
|||||||
<property name="current_session_context_class">thread</property>
|
<property name="current_session_context_class">thread</property>
|
||||||
<property name="dialect">org.hibernate.dialect.MySQLInnoDBDialect</property>
|
<property name="dialect">org.hibernate.dialect.MySQLInnoDBDialect</property>
|
||||||
<property name="show_sql">false</property>
|
<property name="show_sql">false</property>
|
||||||
|
<property name="order_updates">true</property>
|
||||||
<property name="connection.isolation">2</property>
|
<property name="connection.isolation">2</property>
|
||||||
<property name="c3po.min_size">5</property>
|
<property name="c3p0.min_size">5</property>
|
||||||
<property name="c3po.max_size">20</property>
|
<property name="c3p0.max_size">20</property>
|
||||||
<property name="c3po.timeout">900</property>
|
<property name="c3p0.timeout">900</property>
|
||||||
<property name="c3po.max_statements">50</property>
|
<property name="c3p0.max_statements">500</property>
|
||||||
<!-- <property name="cache.use_query_cache">true</property> -->
|
<!-- <property name="cache.use_query_cache">true</property> -->
|
||||||
<mapping resource="org/alfresco/repo/avm/hibernate/AVM.hbm.xml"/>
|
<mapping resource="org/alfresco/repo/avm/hibernate/AVM.hbm.xml"/>
|
||||||
</session-factory>
|
</session-factory>
|
||||||
</hibernate-configuration>
|
</hibernate-configuration>
|
||||||
|
@@ -6,4 +6,4 @@ log4j.appender.stdout.layout.ConversionPattern=%d %5p %c{1}:%m%n
|
|||||||
|
|
||||||
### Set log levels.
|
### Set log levels.
|
||||||
log4j.rootLogger=warn, stdout
|
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.
|
* Helper to write a recursive listing of a repository at a given version.
|
||||||
* @param repoName The name of the repository.
|
* @param repoName The name of the repository.
|
||||||
|
@@ -109,10 +109,10 @@
|
|||||||
<property name="isRoot" column="is_root" type="boolean" />
|
<property name="isRoot" column="is_root" type="boolean" />
|
||||||
<!-- A map of names to DirectoryEntries. In the AVM world, it makes sense
|
<!-- 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. -->
|
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"/>
|
<cache usage="read-write"/>
|
||||||
<key column="directory_id" />
|
<key column="directory_id"/>
|
||||||
<map-key type="string" column="name" />
|
<map-key type="string" column="name"/>
|
||||||
<composite-element
|
<composite-element
|
||||||
class="DirectoryEntry">
|
class="DirectoryEntry">
|
||||||
<property name="type" type="int"
|
<property name="type" type="int"
|
||||||
|
Reference in New Issue
Block a user