Britt Park f501073de5 Added two new fields to VersionRoot (the version record), a short description,
and a long description.  Adjusted signature of createSnapshot(), and update()
to match, and thus actions and tests that needed to be fixed.


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/WCM-DEV2/root@4290 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
2006-11-05 23:41:55 +00:00

156 lines
4.9 KiB
Java

/*
* Copyright (C) 2006 Alfresco, Inc.
*
* Licensed under the Mozilla Public License version 1.1
* with a permitted attribution clause. You may obtain a
* copy of the License at
*
* http://www.alfresco.org/legal/license.txt
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
* either express or implied. See the License for the specific
* language governing permissions and limitations under the
* License.
*/
package org.alfresco.repo.avm;
import java.io.PrintStream;
/**
* Performance test(s).
* @author britt
*/
public class AVMServicePerfTest extends AVMServiceTestBase
{
/**
* Test adding 100 files to each directory.
*/
public void testAdd100a()
{
try
{
String [] dirs = { "a", "b", "c", "d", "e", "f", "g", "h", "i", "j" };
for (String dir : dirs)
{
fService.createDirectory("main:/", dir);
String ndir = "main:/" + dir;
fService.createDirectory(ndir, dir);
ndir = ndir + "/" + dir;
for (int i = 0; i < 100; i++)
{
PrintStream out = new PrintStream(fService.createFile(ndir, "file" + i));
out.println("I am " + ndir + "/file" + i);
System.out.println(ndir + "/file" + i);
out.close();
}
fService.createSnapshot("main", null, null);
}
// System.out.println(recursiveList("main", -1));
}
catch (Exception e)
{
e.printStackTrace(System.err);
fail();
}
}
/**
* Test adding 100 files to each directory.
*/
public void testAdd100b()
{
try
{
String [] dirs = { "a", "b", "c", "d", "e", "f", "g", "h", "i", "j" };
for (String dir : dirs)
{
fService.createDirectory("main:/", dir);
String ndir = "main:/" + dir;
fService.createDirectory(ndir, dir);
ndir = ndir + "/" + dir;
for (int i = 0; i < 100; i++)
{
PrintStream out = new PrintStream(fService.createFile(ndir, "file" + i));
out.println("I am " + ndir + "/file" + i);
System.out.println(ndir + "/file" + i);
out.close();
}
fService.createSnapshot("main", null, null);
}
// System.out.println(recursiveList("main", -1));
}
catch (Exception e)
{
e.printStackTrace(System.err);
fail();
}
}
/**
* Test adding 100 files to each directory.
*/
public void testAdd100c()
{
try
{
String [] dirs = { "a", "b", "c", "d", "e", "f", "g", "h", "i", "j" };
for (String dir : dirs)
{
fService.createDirectory("main:/", dir);
String ndir = "main:/" + dir;
fService.createDirectory(ndir, dir);
ndir = ndir + "/" + dir;
for (int i = 0; i < 100; i++)
{
PrintStream out = new PrintStream(fService.createFile(ndir, "file" + i));
out.println("I am " + ndir + "/file" + i);
System.out.println(ndir + "/file" + i);
out.close();
}
fService.createSnapshot("main", null, null);
}
// System.out.println(recursiveList("main", -1));
}
catch (Exception e)
{
e.printStackTrace(System.err);
fail();
}
}
/**
* Test adding 100 files to each directory.
*/
public void testAdd100d()
{
try
{
String [] dirs = { "a", "b", "c", "d", "e", "f", "g", "h", "i", "j" };
for (String dir : dirs)
{
fService.createDirectory("main:/", dir);
String ndir = "main:/" + dir;
fService.createDirectory(ndir, dir);
ndir = ndir + "/" + dir;
for (int i = 0; i < 100; i++)
{
PrintStream out = new PrintStream(fService.createFile(ndir, "file" + i));
out.println("I am " + ndir + "/file" + i);
out.close();
System.out.println(ndir + "/file" + i);
}
fService.createSnapshot("main", null, null);
}
// System.out.println(recursiveList("main", -1));
}
catch (Exception e)
{
e.printStackTrace(System.err);
fail();
}
}
}