First round trip. A unit test instantiates an AVMService and creates a new empty

repository.


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/WCM-DEV2/root@2926 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Britt Park
2006-05-19 21:59:37 +00:00
parent f4980f8ddd
commit 72751fdedb
7 changed files with 121 additions and 12 deletions

View File

@@ -17,6 +17,8 @@
package org.alfresco.repo.avm.hibernate;
import org.hibernate.Session;
/**
* This is a helper class that knows how to issue identifiers.
* @author britt
@@ -51,10 +53,11 @@ public class Issuer
* @param name The name of this issuer.
* @param next The next number to issue.
*/
public Issuer(String name, long next)
public Issuer(String name, long next, Session session)
{
fName = name;
fNext = next;
session.save(this);
}
// Bean methods.

View File

@@ -76,9 +76,9 @@ public class TestPopulate extends TestCase
public void perform(Session session)
{
// Set up issuers.
Issuer nodeIssuer = new Issuer("node", 0);
Issuer contentIssuer = new Issuer("content", 0);
Issuer repositoryIssuer = new Issuer("repository", 0);
Issuer nodeIssuer = new Issuer("node", 0, session);
Issuer contentIssuer = new Issuer("content", 0, session);
Issuer repositoryIssuer = new Issuer("repository", 0, session);
// Make the initial root directory.
long time = System.currentTimeMillis();
BasicAttributesBean attrs = new BasicAttributesBeanImpl("britt",
@@ -105,9 +105,6 @@ public class TestPopulate extends TestCase
session.save(rep);
rep.getRoots().put(rep.getNextVersionID(), root);
rep.setNextVersionID(rep.getNextVersionID() + 1);
session.save(nodeIssuer);
session.save(contentIssuer);
session.save(repositoryIssuer);
root.setIsNew(false);
}
});