mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
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:
@@ -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.
|
||||
|
@@ -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);
|
||||
}
|
||||
});
|
||||
|
Reference in New Issue
Block a user