You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lenya.apache.org by an...@apache.org on 2004/09/16 22:01:01 UTC

svn commit: rev 46204 - in incubator/lenya/trunk/src/test/org/apache/lenya/cms: authoring publication publication/file site site/tree task workflow

Author: andreas
Date: Thu Sep 16 13:00:59 2004
New Revision: 46204

Added:
   incubator/lenya/trunk/src/test/org/apache/lenya/cms/site/
   incubator/lenya/trunk/src/test/org/apache/lenya/cms/site/tree/
   incubator/lenya/trunk/src/test/org/apache/lenya/cms/site/tree/DefaultSiteTreeTest.java
      - copied, changed from rev 46169, incubator/lenya/trunk/src/test/org/apache/lenya/cms/publication/DefaultSiteTreeTest.java
   incubator/lenya/trunk/src/test/org/apache/lenya/cms/site/tree/SiteTreeNodeImplTest.java
      - copied, changed from rev 46169, incubator/lenya/trunk/src/test/org/apache/lenya/cms/publication/SiteTreeNodeImplTest.java
Removed:
   incubator/lenya/trunk/src/test/org/apache/lenya/cms/publication/DefaultSiteTreeTest.java
   incubator/lenya/trunk/src/test/org/apache/lenya/cms/publication/SiteTreeNodeImplTest.java
Modified:
   incubator/lenya/trunk/src/test/org/apache/lenya/cms/authoring/DocumentCreatorTest.java
   incubator/lenya/trunk/src/test/org/apache/lenya/cms/publication/DefaultDocumentBuilderTest.java
   incubator/lenya/trunk/src/test/org/apache/lenya/cms/publication/DefaultDocumentTest.java
   incubator/lenya/trunk/src/test/org/apache/lenya/cms/publication/DublinCoreTest.java
   incubator/lenya/trunk/src/test/org/apache/lenya/cms/publication/TestPageEnvelope.java
   incubator/lenya/trunk/src/test/org/apache/lenya/cms/publication/file/FilePublicationTest.java
   incubator/lenya/trunk/src/test/org/apache/lenya/cms/task/DocumentCopyTaskTest.java
   incubator/lenya/trunk/src/test/org/apache/lenya/cms/task/DocumentDeactivateTaskTest.java
   incubator/lenya/trunk/src/test/org/apache/lenya/cms/task/DocumentMoveTaskTest.java
   incubator/lenya/trunk/src/test/org/apache/lenya/cms/task/DocumentRenameTaskTest.java
   incubator/lenya/trunk/src/test/org/apache/lenya/cms/workflow/WorkflowTest.java
Log:
re-organize site management, using DocumentIdentityMap

Modified: incubator/lenya/trunk/src/test/org/apache/lenya/cms/authoring/DocumentCreatorTest.java
==============================================================================
--- incubator/lenya/trunk/src/test/org/apache/lenya/cms/authoring/DocumentCreatorTest.java	(original)
+++ incubator/lenya/trunk/src/test/org/apache/lenya/cms/authoring/DocumentCreatorTest.java	Thu Sep 16 13:00:59 2004
@@ -27,16 +27,18 @@
 import junit.textui.TestRunner;
 
 import org.apache.lenya.cms.PublicationHelper;
+import org.apache.lenya.cms.publication.DocumentIdentityMap;
 import org.apache.lenya.cms.publication.Publication;
 import org.apache.lenya.cms.site.SiteException;
+import org.apache.lenya.cms.site.SiteManager;
 import org.apache.lenya.cms.site.tree.SiteTree;
 import org.apache.lenya.cms.site.tree.SiteTreeNode;
-
+import org.apache.lenya.cms.site.tree.TreeSiteManager;
 
 /**
- *
- * To change the template for this generated type comment go to
- * Window>Preferences>Java>Code Generation>Code and Comments
+ * 
+ * To change the template for this generated type comment go to Window>Preferences>Java>Code
+ * Generation>Code and Comments
  */
 public class DocumentCreatorTest extends TestCase {
     /**
@@ -48,9 +50,8 @@
     }
 
     /**
-     * The main program.
-     * The parameters are set from the command line arguments.
-     *
+     * The main program. The parameters are set from the command line arguments.
+     * 
      * @param args The command line arguments.
      */
     public static void main(String[] args) {
@@ -71,24 +72,35 @@
      * @throws CreatorException when something went wrong.
      * @throws SiteException when something went wrong.
      */
-    public void testCreator()
-        throws CreatorException, SiteException {
+    public void testCreator() throws CreatorException, SiteException {
         Publication publication = PublicationHelper.getPublication();
         DocumentCreator creator = new DocumentCreator();
         File authoringDirectory = new File(publication.getDirectory(), AUTHORING_DIR);
 
         creator.create(publication, authoringDirectory, AREA, PARENT_ID, CHILD_ID, CHILD_NAME,
-            CHILD_TYPE, DOCUMENT_TYPE, DOCUMENT_LANGUAGE);
+                CHILD_TYPE, DOCUMENT_TYPE, DOCUMENT_LANGUAGE);
 
         File documentFile = new File(authoringDirectory, CREATED_FILE);
         assertTrue(documentFile.exists());
         System.out.println("File was created: " + documentFile.getAbsolutePath());
 
-        SiteTree sitetree = publication.getSiteTree(AREA);
+        DocumentIdentityMap map = new DocumentIdentityMap(publication);
+        SiteTree sitetree;
+        try {
+            SiteManager manager = publication.getSiteManager(map);
+            if (!(manager instanceof TreeSiteManager)) {
+                throw new RuntimeException("Only supported for site trees.");
+            }
+            sitetree = ((TreeSiteManager) manager).getTree(AREA);
+        } catch (RuntimeException e) {
+            throw e;
+        } catch (Exception e) {
+            throw new RuntimeException(e);
+        }
         SiteTreeNode node = sitetree.getNode(PARENT_ID + "/" + CHILD_ID);
         assertNotNull(node);
-        System.out.println("Sitetree node was created: " + node.getId() + " (label: " +
-            node.getLabel(DOCUMENT_LANGUAGE) + ")");
+        System.out.println("Sitetree node was created: " + node.getId() + " (label: "
+                + node.getLabel(DOCUMENT_LANGUAGE) + ")");
     }
 
     protected static final String AUTHORING_DIR = "content" + File.separator + "authoring";
@@ -104,8 +116,9 @@
     /** @see junit.framework.TestCase#setUp() */
     protected void setUp() throws Exception {
         if (PublicationHelper.getPublication() == null) {
-            String[] args = { "/home/egli/build/jakarta-tomcat-4.1.21-LE-jdk14/webapps/lenya", "test" };
+            String[] args = { "/home/egli/build/jakarta-tomcat-4.1.21-LE-jdk14/webapps/lenya",
+                    "test" };
             PublicationHelper.extractPublicationArguments(args);
         }
     }
-}
+}
\ No newline at end of file

Modified: incubator/lenya/trunk/src/test/org/apache/lenya/cms/publication/DefaultDocumentBuilderTest.java
==============================================================================
--- incubator/lenya/trunk/src/test/org/apache/lenya/cms/publication/DefaultDocumentBuilderTest.java	(original)
+++ incubator/lenya/trunk/src/test/org/apache/lenya/cms/publication/DefaultDocumentBuilderTest.java	Thu Sep 16 13:00:59 2004
@@ -15,7 +15,7 @@
  *
  */
 
-/* $Id: DefaultDocumentBuilderTest.java,v 1.5 2004/03/04 15:41:09 egli Exp $  */
+/* $Id$  */
 
 package org.apache.lenya.cms.publication;
 
@@ -67,8 +67,6 @@
 	protected Document getDocument(DocumentTestSet set) throws DocumentBuildException {
 		Publication pub = PublicationHelper.getPublication();
 
-		return pub.getDocumentBuilder().buildDocument(
-			pub,
-			"/" + pub.getId() + "/" + set.getArea() + set.getUrl());
+		return getIdentityMap().get(pub.getId() + "/" + set.getArea() + set.getUrl());
 	}
 }

Modified: incubator/lenya/trunk/src/test/org/apache/lenya/cms/publication/DefaultDocumentTest.java
==============================================================================
--- incubator/lenya/trunk/src/test/org/apache/lenya/cms/publication/DefaultDocumentTest.java	(original)
+++ incubator/lenya/trunk/src/test/org/apache/lenya/cms/publication/DefaultDocumentTest.java	Thu Sep 16 13:00:59 2004
@@ -15,7 +15,7 @@
  *
  */
 
-/* $Id: DefaultDocumentTest.java,v 1.6 2004/03/04 15:41:09 egli Exp $  */
+/* $Id$  */
 
 package org.apache.lenya.cms.publication;
 
@@ -26,11 +26,10 @@
 
 import org.apache.lenya.cms.PublicationHelper;
 
-
 /**
- *
- * To change the template for this generated type comment go to
- * Window>Preferences>Java>Code Generation>Code and Comments
+ * 
+ * To change the template for this generated type comment go to Window>Preferences>Java>Code
+ * Generation>Code and Comments
  */
 public class DefaultDocumentTest extends TestCase {
     /**
@@ -42,9 +41,8 @@
     }
 
     /**
-     * The main program.
-     * The parameters are set from the command line arguments.
-     *
+     * The main program. The parameters are set from the command line arguments.
+     * 
      * @param args The command line arguments.
      */
     public static void main(String[] args) {
@@ -61,18 +59,17 @@
     }
 
     protected static final DocumentTestSet[] testSets = {
-        new DocumentTestSet("/index.html", "/index", Publication.AUTHORING_AREA, "en", "html"),
-        new DocumentTestSet("/index_en.htm", "/index", Publication.AUTHORING_AREA, "en", "htm"),
-        new DocumentTestSet("/index_de.html", "/index", Publication.AUTHORING_AREA, "de", "html")
-    };
+            new DocumentTestSet("/index.html", "/index", Publication.AUTHORING_AREA, "en", "html"),
+            new DocumentTestSet("/index_en.htm", "/index", Publication.AUTHORING_AREA, "en", "htm"),
+            new DocumentTestSet("/index_de.html", "/index", Publication.AUTHORING_AREA, "de",
+                    "html") };
 
     /**
      * Tests a document test set.
      * @param testSet The test set.
      * @throws DocumentBuildException when something went wrong.
      */
-    protected void doDocumentTest(DocumentTestSet testSet)
-        throws DocumentBuildException {
+    protected void doDocumentTest(DocumentTestSet testSet) throws DocumentBuildException {
         Document document = getDocument(testSet);
         System.out.println("ID:           " + document.getId());
         System.out.println("Area:         " + document.getArea());
@@ -87,8 +84,8 @@
         assertEquals(document.getArea(), testSet.getArea());
         assertEquals(document.getLanguage(), testSet.getLanguage());
         assertEquals(document.getDocumentURL(), testSet.getUrl());
-        assertEquals(document.getCompleteURL(),
-            "/" + publication.getId() + "/" + document.getArea() + testSet.getUrl());
+        assertEquals(document.getCompleteURL(), "/" + publication.getId() + "/"
+                + document.getArea() + testSet.getUrl());
         assertEquals(document.getExtension(), testSet.getExtension());
 
         System.out.println("-----------------------------------------------");
@@ -104,16 +101,26 @@
         }
     }
 
+    private DocumentIdentityMap identityMap;
+
+    protected DocumentIdentityMap getIdentityMap() {
+        if (this.identityMap == null) {
+            Publication pub = PublicationHelper.getPublication();
+            this.identityMap = new DocumentIdentityMap(pub);
+        }
+        return this.identityMap;
+    }
+
     /**
      * Returns the test document for a given test set.
      * @param testSet A document test set.
      * @return A document.
      * @throws DocumentBuildException when something went wrong.
      */
-    protected Document getDocument(DocumentTestSet testSet)
-        throws DocumentBuildException {
-        DefaultDocument document = new DefaultDocument(PublicationHelper.getPublication(),
-                testSet.getId(), testSet.getArea());
+    protected Document getDocument(DocumentTestSet testSet) throws DocumentBuildException {
+
+        DefaultDocument document = new DefaultDocument(getIdentityMap(), testSet.getId(), testSet
+                .getArea());
         document.setDocumentURL(testSet.getUrl());
         document.setLanguage(testSet.getLanguage());
         document.setExtension(testSet.getExtension());
@@ -192,4 +199,4 @@
             PublicationHelper.extractPublicationArguments(args);
         }
     }
-}
+}
\ No newline at end of file

Modified: incubator/lenya/trunk/src/test/org/apache/lenya/cms/publication/DublinCoreTest.java
==============================================================================
--- incubator/lenya/trunk/src/test/org/apache/lenya/cms/publication/DublinCoreTest.java	(original)
+++ incubator/lenya/trunk/src/test/org/apache/lenya/cms/publication/DublinCoreTest.java	Thu Sep 16 13:00:59 2004
@@ -26,7 +26,7 @@
 /**
  * Dublin Core test.
  * 
- * @version $Id:$
+ * @version $Id$
  */
 public class DublinCoreTest extends TestCase {
 
@@ -37,16 +37,15 @@
 
     /**
      * Constructor for DublinCoreTest.
-     * @param arg0 a test 
+     * @param arg0 a test
      */
     public DublinCoreTest(String arg0) {
         super(arg0);
     }
 
     /**
-     * The main program.
-     * The parameters are set from the command line arguments.
-     *
+     * The main program. The parameters are set from the command line arguments.
+     * 
      * @param args The command line arguments.
      */
     public static void main(String[] args) {
@@ -55,23 +54,15 @@
     }
 
     /**
-     * Test the fetching, modification and refetching of a dc core object. 
+     * Test the fetching, modification and refetching of a dc core object.
      * 
      * @throws DocumentBuildException if an error occurs
      * @throws DocumentException if an error occurs
      */
-    final public void testModifySaveAndReload()
-        throws DocumentBuildException, DocumentException {
+    final public void testModifySaveAndReload() throws DocumentBuildException, DocumentException {
         Publication publication = PublicationHelper.getPublication();
-        DocumentBuilder builder = new DefaultDocumentBuilder();
-        Document doc =
-            builder.buildDocument(
-                publication,
-                builder.buildCanonicalUrl(
-                    publication,
-                    AREA,
-                    DOCUMENT_ID,
-                    LANGUAGE));
+        DocumentIdentityMap map = new DocumentIdentityMap(publication);
+        Document doc = map.get(AREA, DOCUMENT_ID, LANGUAGE);
         DublinCore dcCore = doc.getDublinCore();
         String title = dcCore.getFirstValue(DublinCore.ELEMENT_TITLE);
         String subject = dcCore.getFirstValue(DublinCore.ELEMENT_SUBJECT);
@@ -81,14 +72,7 @@
         dcCore.setValue(DublinCore.ELEMENT_CREATOR, CREATOR);
         dcCore.save();
 
-        Document doc2 =
-            builder.buildDocument(
-                publication,
-                builder.buildCanonicalUrl(
-                    publication,
-                    AREA,
-                    DOCUMENT_ID,
-                    LANGUAGE));
+        Document doc2 = map.get(AREA, DOCUMENT_ID, LANGUAGE);
 
         DublinCore dcCore2 = doc2.getDublinCore();
         assertEquals(title, dcCore2.getFirstValue(DublinCore.ELEMENT_TITLE));
@@ -101,11 +85,9 @@
     /** @see junit.framework.TestCase#setUp() */
     protected void setUp() throws Exception {
         if (PublicationHelper.getPublication() == null) {
-            String[] args =
-                {
-                    "/home/egli/build/jakarta-tomcat-4.1.21-LE-jdk14/webapps/lenya",
+            String[] args = { "/home/egli/build/jakarta-tomcat-4.1.21-LE-jdk14/webapps/lenya",
                     "test" };
             PublicationHelper.extractPublicationArguments(args);
         }
     }
-}
+}
\ No newline at end of file

Modified: incubator/lenya/trunk/src/test/org/apache/lenya/cms/publication/TestPageEnvelope.java
==============================================================================
--- incubator/lenya/trunk/src/test/org/apache/lenya/cms/publication/TestPageEnvelope.java	(original)
+++ incubator/lenya/trunk/src/test/org/apache/lenya/cms/publication/TestPageEnvelope.java	Thu Sep 16 13:00:59 2004
@@ -15,7 +15,7 @@
  *
  */
 
-/* $Id: TestPageEnvelope.java,v 1.5 2004/03/04 15:41:09 egli Exp $  */
+/* $Id$  */
 
 package org.apache.lenya.cms.publication;
 
@@ -35,7 +35,8 @@
         setContext("");
 
         try {
-            setDocument(publication.getDocumentBuilder().buildDocument(publication, url));
+            DocumentIdentityMap map = new DocumentIdentityMap(publication);
+            setDocument(map.get(url));
         } catch (DocumentBuildException e) {
             throw new PageEnvelopeException(e);
         }

Modified: incubator/lenya/trunk/src/test/org/apache/lenya/cms/publication/file/FilePublicationTest.java
==============================================================================
--- incubator/lenya/trunk/src/test/org/apache/lenya/cms/publication/file/FilePublicationTest.java	(original)
+++ incubator/lenya/trunk/src/test/org/apache/lenya/cms/publication/file/FilePublicationTest.java	Thu Sep 16 13:00:59 2004
@@ -28,12 +28,14 @@
 import org.apache.lenya.cms.publication.Document;
 import org.apache.lenya.cms.publication.DocumentBuilder;
 import org.apache.lenya.cms.publication.DocumentException;
+import org.apache.lenya.cms.publication.DocumentIdentityMap;
 import org.apache.lenya.cms.publication.Publication;
 import org.apache.lenya.cms.publication.PublicationException;
+import org.apache.lenya.cms.site.Label;
 import org.apache.lenya.cms.site.SiteException;
-import org.apache.lenya.cms.site.tree.Label;
 import org.apache.lenya.cms.site.tree.SiteTree;
 import org.apache.lenya.cms.site.tree.SiteTreeNode;
+import org.apache.lenya.cms.site.tree.TreeSiteManager;
 
 /**
  * To change the template for this generated type comment go to
@@ -106,20 +108,18 @@
         System.out.println("    Destination language:    [" + destinationLanguage + "]");
 
         Publication publication = PublicationHelper.getPublication();
-        DocumentBuilder builder = publication.getDocumentBuilder();
+        DocumentIdentityMap map = new DocumentIdentityMap(publication);
 
-        String sourceUrl = builder.buildCanonicalUrl(publication, sourceArea, sourceDocumentId,
-                sourceLanguage);
-        Document sourceDocument = builder.buildDocument(publication, sourceUrl);
-        String destinationUrl = builder.buildCanonicalUrl(publication, destinationArea,
-                destinationDocumentId, destinationLanguage);
-        Document destinationDocument = builder.buildDocument(publication, destinationUrl);
+        Document sourceDocument = map.get(sourceArea, sourceDocumentId, sourceLanguage);
+        Document destinationDocument = map.get(destinationArea, destinationDocumentId,
+                destinationLanguage);
 
         publication.copyDocument(sourceDocument, destinationDocument);
 
         assertTrue(destinationDocument.exists());
 
-        SiteTree destinationTree = publication.getSiteTree(destinationArea);
+        TreeSiteManager manager = (TreeSiteManager) publication.getSiteManager(map);
+        SiteTree destinationTree = manager.getTree(destinationArea);
         SiteTreeNode destinationNode = destinationTree.getNode(destinationDocumentId);
         assertNotNull(destinationNode);
         Label destinationLabel = destinationNode.getLabel(destinationLanguage);

Copied: incubator/lenya/trunk/src/test/org/apache/lenya/cms/site/tree/DefaultSiteTreeTest.java (from rev 46169, incubator/lenya/trunk/src/test/org/apache/lenya/cms/publication/DefaultSiteTreeTest.java)
==============================================================================
--- incubator/lenya/trunk/src/test/org/apache/lenya/cms/publication/DefaultSiteTreeTest.java	(original)
+++ incubator/lenya/trunk/src/test/org/apache/lenya/cms/site/tree/DefaultSiteTreeTest.java	Thu Sep 16 13:00:59 2004
@@ -17,7 +17,7 @@
 
 /* $Id$  */
 
-package org.apache.lenya.cms.publication;
+package org.apache.lenya.cms.site.tree;
 
 import java.io.IOException;
 
@@ -26,9 +26,9 @@
 
 import junit.framework.TestCase;
 
+import org.apache.lenya.cms.site.Label;
 import org.apache.lenya.cms.site.SiteException;
 import org.apache.lenya.cms.site.tree.DefaultSiteTree;
-import org.apache.lenya.cms.site.tree.Label;
 import org.apache.lenya.cms.site.tree.SiteTreeNode;
 import org.xml.sax.SAXException;
 

Copied: incubator/lenya/trunk/src/test/org/apache/lenya/cms/site/tree/SiteTreeNodeImplTest.java (from rev 46169, incubator/lenya/trunk/src/test/org/apache/lenya/cms/publication/SiteTreeNodeImplTest.java)
==============================================================================
--- incubator/lenya/trunk/src/test/org/apache/lenya/cms/publication/SiteTreeNodeImplTest.java	(original)
+++ incubator/lenya/trunk/src/test/org/apache/lenya/cms/site/tree/SiteTreeNodeImplTest.java	Thu Sep 16 13:00:59 2004
@@ -17,10 +17,10 @@
 
 /* $Id$  */
 
-package org.apache.lenya.cms.publication;
+package org.apache.lenya.cms.site.tree;
 
+import org.apache.lenya.cms.site.Label;
 import org.apache.lenya.cms.site.tree.DefaultSiteTree;
-import org.apache.lenya.cms.site.tree.Label;
 import org.apache.lenya.cms.site.tree.SiteTreeNode;
 
 import junit.framework.TestCase;

Modified: incubator/lenya/trunk/src/test/org/apache/lenya/cms/task/DocumentCopyTaskTest.java
==============================================================================
--- incubator/lenya/trunk/src/test/org/apache/lenya/cms/task/DocumentCopyTaskTest.java	(original)
+++ incubator/lenya/trunk/src/test/org/apache/lenya/cms/task/DocumentCopyTaskTest.java	Thu Sep 16 13:00:59 2004
@@ -28,108 +28,114 @@
 
 import org.apache.avalon.framework.parameters.Parameters;
 import org.apache.lenya.cms.PublicationHelper;
+import org.apache.lenya.cms.publication.DocumentIdentityMap;
 import org.apache.lenya.cms.publication.Publication;
 import org.apache.lenya.cms.site.tree.SiteTree;
 import org.apache.lenya.cms.site.tree.SiteTreeNode;
-
+import org.apache.lenya.cms.site.tree.TreeSiteManager;
 
 /**
  * Class for testing the task to copy a document.
  */
 public class DocumentCopyTaskTest extends AntTaskTest {
 
-	/**
+    /**
      * Creates a new DocumentCopyTaskTest object.
-	 * @param test the test
-	 */
-	public DocumentCopyTaskTest(String test) {
-		super(test);
-	}
-
-	/** 
-	 * Creates a test suite.
-	 * @return Test 
-	 **/
-	public static Test getSuite() {
-		return new TestSuite(DocumentCopyTaskTest.class);
-	}
-
-	/**
-	 * The main program for the DocumentCopyTaskTest class
-	 *
-	 * @param args The command line arguments
-	 */
-	public static void main(String[] args) {
-		AntTaskTest.initialize(args);
-		TestRunner.run(getSuite());
-	}
-
-	public static final String FIRST_DOCUMENT_ID = "/tutorial";
-	public static final String SEC_DOCUMENT_ID = "/features";
-	public static final String AUTHORING_PATH = "content/authoring".replace('/', File.separatorChar);
-	public static final String TREE_FILE = "sitetree.xml";
-	public static final String AUTHORING_RESOURCE = "resources/authoring";
-	public static final String RCML_DIR = "content/rcml";
-	public static final String RCBAK_DIR = "content/rcbak";
-	
-	/**
-	 * @see org.apache.lenya.cms.task.AntTaskTest#getTaskParameters()
-	 **/
-	protected Parameters getTaskParameters() {
-		Parameters parameters = super.getTaskParameters();
-		parameters.setParameter("properties.node.firstdocumentid", FIRST_DOCUMENT_ID);
-		parameters.setParameter("properties.node.secdocumentid", SEC_DOCUMENT_ID);
-		return parameters;
-	}
-    
-	/**
-	 * Returns the target test.
-	 * @return target.
-	 */
-	protected String getTarget() {
-		return "copyDocument";
-	}
+     * @param test the test
+     */
+    public DocumentCopyTaskTest(String test) {
+        super(test);
+    }
+
+    /**
+     * Creates a test suite.
+     * @return Test
+     */
+    public static Test getSuite() {
+        return new TestSuite(DocumentCopyTaskTest.class);
+    }
 
-	/**
-	 * prepare the test
+    /**
+     * The main program for the DocumentCopyTaskTest class
+     * 
+     * @param args The command line arguments
+     */
+    public static void main(String[] args) {
+        AntTaskTest.initialize(args);
+        TestRunner.run(getSuite());
+    }
+
+    public static final String FIRST_DOCUMENT_ID = "/tutorial";
+    public static final String SEC_DOCUMENT_ID = "/features";
+    public static final String AUTHORING_PATH = "content/authoring"
+            .replace('/', File.separatorChar);
+    public static final String TREE_FILE = "sitetree.xml";
+    public static final String AUTHORING_RESOURCE = "resources/authoring";
+    public static final String RCML_DIR = "content/rcml";
+    public static final String RCBAK_DIR = "content/rcbak";
+
+    /**
+     * @see org.apache.lenya.cms.task.AntTaskTest#getTaskParameters()
+     */
+    protected Parameters getTaskParameters() {
+        Parameters parameters = super.getTaskParameters();
+        parameters.setParameter("properties.node.firstdocumentid", FIRST_DOCUMENT_ID);
+        parameters.setParameter("properties.node.secdocumentid", SEC_DOCUMENT_ID);
+        return parameters;
+    }
+
+    /**
+     * Returns the target test.
+     * @return target.
+     */
+    protected String getTarget() {
+        return "copyDocument";
+    }
+
+    /**
+     * prepare the test
      * 
      * @throws Exception if an error occurs
-	 */
-	protected void prepareTest() throws Exception {
-		File publicationDirectory = PublicationHelper.getPublication().getDirectory();
-        String publicationPath = publicationDirectory.getAbsolutePath()+ File.separator; 
-		File authoringDirectory = new File(publicationPath, AUTHORING_PATH);
+     */
+    protected void prepareTest() throws Exception {
+        File publicationDirectory = PublicationHelper.getPublication().getDirectory();
+        String publicationPath = publicationDirectory.getAbsolutePath() + File.separator;
+        File authoringDirectory = new File(publicationPath, AUTHORING_PATH);
 
-		// TODO generate the resources  
-	}
+        // TODO generate the resources
+    }
 
-	/**
-	 * evaluate the test
+    /**
+     * evaluate the test
      * 
      * @throws Exception if an error occurs
-	 */
-	protected void evaluateTest() throws Exception {
-		File publicationDirectory = PublicationHelper.getPublication().getDirectory();
-		String publicationPath = publicationDirectory.getAbsolutePath(); 
+     */
+    protected void evaluateTest() throws Exception {
+        File publicationDirectory = PublicationHelper.getPublication().getDirectory();
+        String publicationPath = publicationDirectory.getAbsolutePath();
         File authoringDirectory = new File(publicationPath, AUTHORING_PATH);
-        
-		StringTokenizer st = new StringTokenizer(FIRST_DOCUMENT_ID , "/", true);
-		int l = st.countTokens();
-		for (int i=1; i<l; i++) {
-		  st.nextToken();
-		}
-		String secdocumentid = SEC_DOCUMENT_ID+"/"+st.nextToken();      
 
-		String filepath = secdocumentid + File.separator + "index.xml";  
+        StringTokenizer st = new StringTokenizer(FIRST_DOCUMENT_ID, "/", true);
+        int l = st.countTokens();
+        for (int i = 1; i < l; i++) {
+            st.nextToken();
+        }
+        String secdocumentid = SEC_DOCUMENT_ID + "/" + st.nextToken();
+
+        String filepath = secdocumentid + File.separator + "index.xml";
 
-		File documentFile = new File(authoringDirectory, filepath);
+        File documentFile = new File(authoringDirectory, filepath);
         assertTrue(documentFile.exists());
-		System.out.println("Document was copied: " + documentFile.getAbsolutePath());
+        System.out.println("Document was copied: " + documentFile.getAbsolutePath());
+
+        Publication pub = PublicationHelper.getPublication();
+        DocumentIdentityMap map = new DocumentIdentityMap(pub);
+        TreeSiteManager manager = (TreeSiteManager) pub.getSiteManager(map);
 
-        SiteTree sitetree = PublicationHelper.getPublication().getSiteTree(Publication.AUTHORING_AREA);
+        SiteTree sitetree = manager.getTree(Publication.AUTHORING_AREA);
         SiteTreeNode node = sitetree.getNode(secdocumentid);
         assertNotNull(node);
-        System.out.println("Sitetree node with id " + node.getId() +
-            " was created as child of node with id: " + node.getAbsoluteParentId());
+        System.out.println("Sitetree node with id " + node.getId()
+                + " was created as child of node with id: " + node.getAbsoluteParentId());
     }
-}
+}
\ No newline at end of file

Modified: incubator/lenya/trunk/src/test/org/apache/lenya/cms/task/DocumentDeactivateTaskTest.java
==============================================================================
--- incubator/lenya/trunk/src/test/org/apache/lenya/cms/task/DocumentDeactivateTaskTest.java	(original)
+++ incubator/lenya/trunk/src/test/org/apache/lenya/cms/task/DocumentDeactivateTaskTest.java	Thu Sep 16 13:00:59 2004
@@ -27,106 +27,112 @@
 
 import org.apache.avalon.framework.parameters.Parameters;
 import org.apache.lenya.cms.PublicationHelper;
+import org.apache.lenya.cms.publication.DocumentIdentityMap;
 import org.apache.lenya.cms.publication.Publication;
 import org.apache.lenya.cms.site.tree.SiteTree;
 import org.apache.lenya.cms.site.tree.SiteTreeNode;
-
+import org.apache.lenya.cms.site.tree.TreeSiteManager;
 
 /**
- * Class for testing the task to deactivate a document.
- * Extend the AntTask class.
+ * Class for testing the task to deactivate a document. Extend the AntTask class.
  */
 public class DocumentDeactivateTaskTest extends AntTaskTest {
 
-	private long time = 0;
+    private long time = 0;
 
-	/**
+    /**
      * Creates a new DocumentDeactivateTaskTest object.
-	 * @param test The test.
-	 */
-	public DocumentDeactivateTaskTest(String test) {
-		super(test);
-	}
-
-	/** 
-	 * Creates a test suite.
-	 * @return Test 
-	 **/
-	public static Test getSuite() {
-		return new TestSuite(DocumentDeactivateTaskTest.class);
-	}
-
-	/**
-	 * The main program for the DocumentDeactivateTaskTest class
-	 *
-	 * @param args The command line arguments
-	 */
-	public static void main(String[] args) {
-		AntTaskTest.initialize(args);
-		TestRunner.run(getSuite());
-	}
+     * @param test The test.
+     */
+    public DocumentDeactivateTaskTest(String test) {
+        super(test);
+    }
+
+    /**
+     * Creates a test suite.
+     * @return Test
+     */
+    public static Test getSuite() {
+        return new TestSuite(DocumentDeactivateTaskTest.class);
+    }
+
+    /**
+     * The main program for the DocumentDeactivateTaskTest class
+     * 
+     * @param args The command line arguments
+     */
+    public static void main(String[] args) {
+        AntTaskTest.initialize(args);
+        TestRunner.run(getSuite());
+    }
 
-	public static final String DOCUMENT_ID = "/tutorial";
+    public static final String DOCUMENT_ID = "/tutorial";
     public static final String LANGUAGE = "en";
-	public static final String AUTHORING_PATH = "content/authoring".replace('/', File.separatorChar);
-	public static final String LIVE_PATH = "content/live".replace('/', File.separatorChar);
-	
-	/**
-	 * @see org.apache.lenya.cms.task.AntTaskTest#getTaskParameters()
-	 **/
-	protected Parameters getTaskParameters() {
-		Parameters parameters = super.getTaskParameters();
-		parameters.setParameter("properties.node.firstdocumentid", DOCUMENT_ID);
+    public static final String AUTHORING_PATH = "content/authoring"
+            .replace('/', File.separatorChar);
+    public static final String LIVE_PATH = "content/live".replace('/', File.separatorChar);
+
+    /**
+     * @see org.apache.lenya.cms.task.AntTaskTest#getTaskParameters()
+     */
+    protected Parameters getTaskParameters() {
+        Parameters parameters = super.getTaskParameters();
+        parameters.setParameter("properties.node.firstdocumentid", DOCUMENT_ID);
         parameters.setParameter("properties.node.language", LANGUAGE);
-		return parameters;
-	}
-    
-	/**
-	 * Returns the target test.
-	 * @return target.
-	 */
-	protected String getTarget() {
-		return "deactivateDocument";
-	}
+        return parameters;
+    }
 
-	/** (non-Javadoc)
+    /**
+     * Returns the target test.
+     * @return target.
+     */
+    protected String getTarget() {
+        return "deactivateDocument";
+    }
+
+    /**
+     * (non-Javadoc)
      * @see org.apache.lenya.cms.task.AntTaskTest#prepareTest()
      */
     protected void prepareTest() throws Exception {
-		File publicationDirectory = PublicationHelper.getPublication().getDirectory();
-        String publicationPath = publicationDirectory.getAbsolutePath()+ File.separator; 
-
+        File publicationDirectory = PublicationHelper.getPublication().getDirectory();
+        String publicationPath = publicationDirectory.getAbsolutePath() + File.separator;
 
-		// TODO generate the resources  
-}
+        // TODO generate the resources
+    }
 
-	/** (non-Javadoc)
+    /**
+     * (non-Javadoc)
      * @see org.apache.lenya.cms.task.AntTaskTest#evaluateTest()
      */
     protected void evaluateTest() throws Exception {
-		File publicationDirectory = PublicationHelper.getPublication().getDirectory();
-		String publicationPath = publicationDirectory.getAbsolutePath(); 
+        File publicationDirectory = PublicationHelper.getPublication().getDirectory();
+        String publicationPath = publicationDirectory.getAbsolutePath();
         File authoringDirectory = new File(publicationPath, AUTHORING_PATH);
-		File liveDirectory = new File(publicationPath, LIVE_PATH);
-        
-		String filepath = DOCUMENT_ID.substring(1) + File.separator + "index_en.xml";  
+        File liveDirectory = new File(publicationPath, LIVE_PATH);
 
-		File authoringDocumentFile = new File(authoringDirectory, filepath);
+        String filepath = DOCUMENT_ID.substring(1) + File.separator + "index_en.xml";
+
+        File authoringDocumentFile = new File(authoringDirectory, filepath);
         System.out.println("Authoring document: " + authoringDocumentFile.getAbsolutePath());
         assertTrue(authoringDocumentFile.exists());
-		File liveDocumentFile = new File(liveDirectory, filepath);
+        File liveDocumentFile = new File(liveDirectory, filepath);
         System.out.println("Live document: " + liveDocumentFile.getAbsolutePath());
-		assertFalse(liveDocumentFile.exists());
+        assertFalse(liveDocumentFile.exists());
 
         //TODO evaluation of resources, meta, workflow
-        
-		SiteTree authoringSitetree = PublicationHelper.getPublication().getSiteTree(Publication.AUTHORING_AREA);
-		SiteTreeNode node = authoringSitetree.getNode(DOCUMENT_ID);
-		assertNotNull(node);
-        System.out.println("Sitetree node with id ["+node.getId()+"] is always in authoring");
-		SiteTree liveSitetree = PublicationHelper.getPublication().getSiteTree(Publication.LIVE_AREA);
-		SiteTreeNode livenode = liveSitetree.getNode(DOCUMENT_ID);
-		assertNull(livenode);
-        System.out.println("Sitetree node for document id ["+DOCUMENT_ID+"] was deleted from the live tree");
-	}
-}
+
+        Publication pub = PublicationHelper.getPublication();
+        DocumentIdentityMap map = new DocumentIdentityMap(pub);
+        TreeSiteManager manager = (TreeSiteManager) pub.getSiteManager(map);
+        SiteTree authoringSitetree = manager.getTree(Publication.AUTHORING_AREA);
+        SiteTreeNode node = authoringSitetree.getNode(DOCUMENT_ID);
+        assertNotNull(node);
+        System.out.println("Sitetree node with id [" + node.getId() + "] is always in authoring");
+        SiteTree liveSitetree = manager.getTree(Publication.LIVE_AREA);
+        SiteTreeNode livenode = liveSitetree.getNode(DOCUMENT_ID);
+        assertNull(livenode);
+        System.out.println("Sitetree node for document id [" + DOCUMENT_ID
+                + "] was deleted from the live tree");
+    }
+}
\ No newline at end of file

Modified: incubator/lenya/trunk/src/test/org/apache/lenya/cms/task/DocumentMoveTaskTest.java
==============================================================================
--- incubator/lenya/trunk/src/test/org/apache/lenya/cms/task/DocumentMoveTaskTest.java	(original)
+++ incubator/lenya/trunk/src/test/org/apache/lenya/cms/task/DocumentMoveTaskTest.java	Thu Sep 16 13:00:59 2004
@@ -28,149 +28,155 @@
 
 import org.apache.avalon.framework.parameters.Parameters;
 import org.apache.lenya.cms.PublicationHelper;
+import org.apache.lenya.cms.publication.DocumentIdentityMap;
 import org.apache.lenya.cms.publication.Publication;
 import org.apache.lenya.cms.rc.RevisionController;
 import org.apache.lenya.cms.site.tree.SiteTree;
 import org.apache.lenya.cms.site.tree.SiteTreeNode;
-
+import org.apache.lenya.cms.site.tree.TreeSiteManager;
 
 /**
- * Class for testing the task to copy a document.
- * Extend the AntTask class.
-  */
+ * Class for testing the task to copy a document. Extend the AntTask class.
+ */
 public class DocumentMoveTaskTest extends AntTaskTest {
 
-	private long time = 0;
+    private long time = 0;
 
-	/**
+    /**
      * Creates a new DocumentMoveTaskTest object.
      * 
-	 * @param test the test
-	 */
-	public DocumentMoveTaskTest(String test) {
-		super(test);
-	}
-
-	/** 
-	 * Creates a test suite.
-	 * @return Test 
-	 **/
-	public static Test getSuite() {
-		return new TestSuite(DocumentMoveTaskTest.class);
-	}
-
-	/**
-	 * The main program for the DocumentMoveTaskTest class
-	 *
-	 * @param args The command line arguments
-	 */
-	public static void main(String[] args) {
-		AntTaskTest.initialize(args);
-		TestRunner.run(getSuite());
-	}
-
-	public static final String FIRST_DOCUMENT_ID = "/concepts";
-	public static final String SEC_DOCUMENT_ID = "/features";
-	public static final String AUTHORING_PATH = "content/authoring".replace('/', File.separatorChar);
-	public static final String AUTHORING_RESOURCE = "resources/authoring";
-	public static final String RCML_DIR = "content/rcml";
-	public static final String RCBAK_DIR = "content/rcbak";
-	
-	/**
-	 * @see org.apache.lenya.cms.task.AntTaskTest#getTaskParameters()
-	 **/
-	protected Parameters getTaskParameters() {
-		Parameters parameters = super.getTaskParameters();
-		parameters.setParameter("properties.node.firstdocumentid", FIRST_DOCUMENT_ID);
-		parameters.setParameter("properties.node.secdocumentid", SEC_DOCUMENT_ID);
-		return parameters;
-	}
-    
-	/**
-	 * Returns the target test.
-	 * @return target.
-	 */
-	protected String getTarget() {
-		return "moveDocument";
-	}
+     * @param test the test
+     */
+    public DocumentMoveTaskTest(String test) {
+        super(test);
+    }
+
+    /**
+     * Creates a test suite.
+     * @return Test
+     */
+    public static Test getSuite() {
+        return new TestSuite(DocumentMoveTaskTest.class);
+    }
+
+    /**
+     * The main program for the DocumentMoveTaskTest class
+     * 
+     * @param args The command line arguments
+     */
+    public static void main(String[] args) {
+        AntTaskTest.initialize(args);
+        TestRunner.run(getSuite());
+    }
+
+    public static final String FIRST_DOCUMENT_ID = "/concepts";
+    public static final String SEC_DOCUMENT_ID = "/features";
+    public static final String AUTHORING_PATH = "content/authoring"
+            .replace('/', File.separatorChar);
+    public static final String AUTHORING_RESOURCE = "resources/authoring";
+    public static final String RCML_DIR = "content/rcml";
+    public static final String RCBAK_DIR = "content/rcbak";
+
+    /**
+     * @see org.apache.lenya.cms.task.AntTaskTest#getTaskParameters()
+     */
+    protected Parameters getTaskParameters() {
+        Parameters parameters = super.getTaskParameters();
+        parameters.setParameter("properties.node.firstdocumentid", FIRST_DOCUMENT_ID);
+        parameters.setParameter("properties.node.secdocumentid", SEC_DOCUMENT_ID);
+        return parameters;
+    }
+
+    /**
+     * Returns the target test.
+     * @return target.
+     */
+    protected String getTarget() {
+        return "moveDocument";
+    }
 
-	/**
-	 * prepare the test
+    /**
+     * prepare the test
      * 
      * @throws Exception if an error occurs
-	 */
-	protected void prepareTest() throws Exception {
-		File publicationDirectory = PublicationHelper.getPublication().getDirectory();
-        String publicationPath = publicationDirectory.getAbsolutePath()+ File.separator; 
-		File authoringDirectory = new File(publicationPath, AUTHORING_PATH);
-
-		// TODO generate the resources  
-
-		// generate the rcml and rcbak files
-		File rcmlDirectory = new File(publicationPath , RCML_DIR);
-		File rcbakDirectory = new File(publicationPath , RCBAK_DIR);
-        RevisionController rc = new RevisionController(rcmlDirectory.getAbsolutePath(), rcbakDirectory.getAbsolutePath(), publicationPath);
-		String filename = AUTHORING_PATH +FIRST_DOCUMENT_ID + File.separator + "index.xml";
-		rc.reservedCheckOut(filename, "lenya");   
-		time = rc.reservedCheckIn(filename, "lenya", true);   
-	}
+     */
+    protected void prepareTest() throws Exception {
+        File publicationDirectory = PublicationHelper.getPublication().getDirectory();
+        String publicationPath = publicationDirectory.getAbsolutePath() + File.separator;
+        File authoringDirectory = new File(publicationPath, AUTHORING_PATH);
+
+        // TODO generate the resources
 
-	/**
-	 * evaluate the test
+        // generate the rcml and rcbak files
+        File rcmlDirectory = new File(publicationPath, RCML_DIR);
+        File rcbakDirectory = new File(publicationPath, RCBAK_DIR);
+        RevisionController rc = new RevisionController(rcmlDirectory.getAbsolutePath(),
+                rcbakDirectory.getAbsolutePath(), publicationPath);
+        String filename = AUTHORING_PATH + FIRST_DOCUMENT_ID + File.separator + "index.xml";
+        rc.reservedCheckOut(filename, "lenya");
+        time = rc.reservedCheckIn(filename, "lenya", true);
+    }
+
+    /**
+     * evaluate the test
      * 
      * @throws Exception if an error occurs
-	 */
-	protected void evaluateTest() throws Exception {
-		File publicationDirectory = PublicationHelper.getPublication().getDirectory();
-		String publicationPath = publicationDirectory.getAbsolutePath(); 
+     */
+    protected void evaluateTest() throws Exception {
+        File publicationDirectory = PublicationHelper.getPublication().getDirectory();
+        String publicationPath = publicationDirectory.getAbsolutePath();
         File authoringDirectory = new File(publicationPath, AUTHORING_PATH);
-        
-		StringTokenizer st = new StringTokenizer(FIRST_DOCUMENT_ID , "/", true);
-		int l = st.countTokens();
-		for (int i=1; i<l; i++) {
-		  st.nextToken();
-		}
-		String secdocumentid = SEC_DOCUMENT_ID+"/"+st.nextToken();      
-		String filepath = secdocumentid + File.separator + "index.xml";  
 
-		File documentFile = new File(authoringDirectory, filepath);
+        StringTokenizer st = new StringTokenizer(FIRST_DOCUMENT_ID, "/", true);
+        int l = st.countTokens();
+        for (int i = 1; i < l; i++) {
+            st.nextToken();
+        }
+        String secdocumentid = SEC_DOCUMENT_ID + "/" + st.nextToken();
+        String filepath = secdocumentid + File.separator + "index.xml";
+
+        File documentFile = new File(authoringDirectory, filepath);
         assertTrue(documentFile.exists());
-		System.out.println("Document was copied: " + documentFile.getAbsolutePath());
-		String firstfilepath = FIRST_DOCUMENT_ID + File.separator + "index.xml";  
-		File firstdocumentFile = new File(authoringDirectory, firstfilepath);
-		assertFalse(firstdocumentFile.exists());
-		System.out.println("Document was deleted: " + firstdocumentFile.getAbsolutePath());
-
-		File rcmlDirectory = new File(publicationPath , RCML_DIR);
-        String rcmlFilePath = filepath+".rcml";
-		File rcmlFile = new File(rcmlDirectory , AUTHORING_PATH + rcmlFilePath);
+        System.out.println("Document was copied: " + documentFile.getAbsolutePath());
+        String firstfilepath = FIRST_DOCUMENT_ID + File.separator + "index.xml";
+        File firstdocumentFile = new File(authoringDirectory, firstfilepath);
+        assertFalse(firstdocumentFile.exists());
+        System.out.println("Document was deleted: " + firstdocumentFile.getAbsolutePath());
+
+        File rcmlDirectory = new File(publicationPath, RCML_DIR);
+        String rcmlFilePath = filepath + ".rcml";
+        File rcmlFile = new File(rcmlDirectory, AUTHORING_PATH + rcmlFilePath);
         assertTrue(rcmlFile.exists());
-		System.out.println("rcml file was copied: " + rcmlFile.getAbsolutePath());
+        System.out.println("rcml file was copied: " + rcmlFile.getAbsolutePath());
 
-		String firstRcmlFilePath = firstfilepath+".rcml";
-		File firstRcmlFile = new File(rcmlDirectory , AUTHORING_PATH + firstRcmlFilePath);
-		assertFalse(firstRcmlFile.exists());
-		System.out.println("rcml file was deleted: " + firstRcmlFile.getAbsolutePath());
-
-		File rcbakDirectory = new File(publicationPath , RCBAK_DIR);
-        String rcbakFilePath= filepath +".bak." +time ;
-		File rcbakFile = new File(rcbakDirectory, AUTHORING_PATH + rcbakFilePath);
+        String firstRcmlFilePath = firstfilepath + ".rcml";
+        File firstRcmlFile = new File(rcmlDirectory, AUTHORING_PATH + firstRcmlFilePath);
+        assertFalse(firstRcmlFile.exists());
+        System.out.println("rcml file was deleted: " + firstRcmlFile.getAbsolutePath());
+
+        File rcbakDirectory = new File(publicationPath, RCBAK_DIR);
+        String rcbakFilePath = filepath + ".bak." + time;
+        File rcbakFile = new File(rcbakDirectory, AUTHORING_PATH + rcbakFilePath);
         assertTrue(rcbakFile.exists());
-		System.out.println("Backup was copied: " + rcbakFile.getAbsolutePath());
+        System.out.println("Backup was copied: " + rcbakFile.getAbsolutePath());
+
+        String firstRcbakFilePath = firstfilepath + ".bak." + time;
+        File firstRcbakFile = new File(rcbakDirectory, AUTHORING_PATH + firstRcbakFilePath);
+        assertFalse(firstRcbakFile.exists());
+        System.out.println("Backup was deleted: " + firstRcbakFile.getAbsolutePath());
 
-		String firstRcbakFilePath= firstfilepath +".bak." +time ;
-		File firstRcbakFile = new File(rcbakDirectory, AUTHORING_PATH + firstRcbakFilePath);
-		assertFalse(firstRcbakFile.exists());
-		System.out.println("Backup was deleted: " + firstRcbakFile.getAbsolutePath());
-        
         //TODO evaluation of meta, workflow
-        
-		SiteTree sitetree = PublicationHelper.getPublication().getSiteTree(Publication.AUTHORING_AREA);
-		SiteTreeNode node = sitetree.getNode(secdocumentid);
-		assertNotNull(node);
-		System.out.println("Sitetree node with id "+node.getId()+" was created as child of node with id: " + node.getAbsoluteParentId());
-		SiteTreeNode firstnode = sitetree.getNode(FIRST_DOCUMENT_ID);
-		assertNull(firstnode);
-		System.out.println("Sitetree node for document id "+FIRST_DOCUMENT_ID+" was deleted");
-	}
-}
+
+        Publication pub = PublicationHelper.getPublication();
+        DocumentIdentityMap map = new DocumentIdentityMap(pub);
+        TreeSiteManager manager = (TreeSiteManager) pub.getSiteManager(map);
+        SiteTree sitetree = manager.getTree(Publication.AUTHORING_AREA);
+        SiteTreeNode node = sitetree.getNode(secdocumentid);
+        assertNotNull(node);
+        System.out.println("Sitetree node with id " + node.getId()
+                + " was created as child of node with id: " + node.getAbsoluteParentId());
+        SiteTreeNode firstnode = sitetree.getNode(FIRST_DOCUMENT_ID);
+        assertNull(firstnode);
+        System.out.println("Sitetree node for document id " + FIRST_DOCUMENT_ID + " was deleted");
+    }
+}
\ No newline at end of file

Modified: incubator/lenya/trunk/src/test/org/apache/lenya/cms/task/DocumentRenameTaskTest.java
==============================================================================
--- incubator/lenya/trunk/src/test/org/apache/lenya/cms/task/DocumentRenameTaskTest.java	(original)
+++ incubator/lenya/trunk/src/test/org/apache/lenya/cms/task/DocumentRenameTaskTest.java	Thu Sep 16 13:00:59 2004
@@ -28,10 +28,12 @@
 
 import org.apache.avalon.framework.parameters.Parameters;
 import org.apache.lenya.cms.PublicationHelper;
+import org.apache.lenya.cms.publication.DocumentIdentityMap;
 import org.apache.lenya.cms.publication.Publication;
 import org.apache.lenya.cms.rc.RevisionController;
 import org.apache.lenya.cms.site.tree.SiteTree;
 import org.apache.lenya.cms.site.tree.SiteTreeNode;
+import org.apache.lenya.cms.site.tree.TreeSiteManager;
 
 
 /**
@@ -180,7 +182,10 @@
 		//TODO evaluation of meta, workflow
         
         //evaluate the node
-		SiteTree sitetree = PublicationHelper.getPublication().getSiteTree(Publication.AUTHORING_AREA);
+        Publication pub = PublicationHelper.getPublication();
+        DocumentIdentityMap map = new DocumentIdentityMap(pub);
+        TreeSiteManager manager = (TreeSiteManager) pub.getSiteManager(map);
+		SiteTree sitetree = manager.getTree(Publication.AUTHORING_AREA);
 		SiteTreeNode node = sitetree.getNode(secdocumentid);
 		assertNotNull(node);
         System.out.println(

Modified: incubator/lenya/trunk/src/test/org/apache/lenya/cms/workflow/WorkflowTest.java
==============================================================================
--- incubator/lenya/trunk/src/test/org/apache/lenya/cms/workflow/WorkflowTest.java	(original)
+++ incubator/lenya/trunk/src/test/org/apache/lenya/cms/workflow/WorkflowTest.java	Thu Sep 16 13:00:59 2004
@@ -35,11 +35,13 @@
 import org.apache.lenya.cms.PublicationHelper;
 import org.apache.lenya.cms.publication.Document;
 import org.apache.lenya.cms.publication.DocumentBuildException;
+import org.apache.lenya.cms.publication.DocumentIdentityMap;
 import org.apache.lenya.cms.publication.DocumentType;
 import org.apache.lenya.cms.publication.DocumentTypeBuildException;
 import org.apache.lenya.cms.publication.DocumentTypeBuilder;
 import org.apache.lenya.cms.publication.PageEnvelopeException;
 import org.apache.lenya.cms.publication.Publication;
+import org.apache.lenya.cms.site.tree.TreeSiteManager;
 import org.apache.lenya.workflow.Event;
 import org.apache.lenya.workflow.Situation;
 import org.apache.lenya.workflow.WorkflowException;
@@ -92,7 +94,8 @@
             AccessControlException, PageEnvelopeException, DocumentBuildException {
         Publication publication = PublicationHelper.getPublication();
         String url = "/" + publication.getId() + URL;
-        Document document = publication.getDocumentBuilder().buildDocument(publication, url);
+        DocumentIdentityMap map = new DocumentIdentityMap(publication);
+        Document document = map.get(url);
 
         File configDir = new File(publication.getDirectory(), "config" + File.separator + "ac"
                 + File.separator + "passwd");

---------------------------------------------------------------------
To unsubscribe, e-mail: lenya-cvs-unsubscribe@cocoon.apache.org
For additional commands, e-mail: lenya-cvs-help@cocoon.apache.org