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 2006/02/17 11:09:52 UTC

svn commit: r378474 - in /lenya/trunk/src: resources/test/ targets/ test/org/apache/lenya/cms/ test/org/apache/lenya/cms/cocoon/source/ test/org/apache/lenya/cms/publication/

Author: andreas
Date: Fri Feb 17 02:09:49 2006
New Revision: 378474

URL: http://svn.apache.org/viewcvs?rev=378474&view=rev
Log:
Fixed some more tests.

Added:
    lenya/trunk/src/resources/test/
    lenya/trunk/src/resources/test/meta.xsl
    lenya/trunk/src/resources/test/template.xtest
Removed:
    lenya/trunk/src/test/org/apache/lenya/cms/cocoon/source/
    lenya/trunk/src/test/org/apache/lenya/cms/publication/PublicationTest.java
Modified:
    lenya/trunk/src/targets/test-build.xml
    lenya/trunk/src/test/org/apache/lenya/cms/LenyaTestCase.java
    lenya/trunk/src/test/org/apache/lenya/cms/LenyaTestCase.xtest
    lenya/trunk/src/test/org/apache/lenya/cms/publication/DefaultDocumentBuilderTest.java
    lenya/trunk/src/test/org/apache/lenya/cms/publication/DefaultDocumentTest.java
    lenya/trunk/src/test/org/apache/lenya/cms/publication/DublinCoreTest.java

Added: lenya/trunk/src/resources/test/meta.xsl
URL: http://svn.apache.org/viewcvs/lenya/trunk/src/resources/test/meta.xsl?rev=378474&view=auto
==============================================================================
--- lenya/trunk/src/resources/test/meta.xsl (added)
+++ lenya/trunk/src/resources/test/meta.xsl Fri Feb 17 02:09:49 2006
@@ -0,0 +1,54 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Copyright 1999-2004 The Apache Software Foundation
+  
+  Licensed under the Apache License, Version 2.0 (the "License");
+  you may not use this file except in compliance with the License.
+  You may obtain a copy of the License at
+  
+  http://www.apache.org/licenses/LICENSE-2.0
+  
+  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.
+-->
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
+  xmlns:xso="http://apache.org/cocoon/lenya/xslt/1.0"
+  >
+
+  <xsl:namespace-alias stylesheet-prefix="xso" result-prefix="xsl"/>
+  
+  <xsl:param name="element"/>
+
+  <xsl:template match="/">
+    <xso:stylesheet version="1.0">
+      
+      <xsl:apply-templates/>
+      
+      <xso:template match="@*|node()">
+        <xso:copy>
+          <xso:apply-templates select="@*|node()"/>
+        </xso:copy>
+      </xso:template>
+      
+    </xso:stylesheet>
+  </xsl:template>
+  
+  <xsl:template match="/*">
+    <xso:template match="{$element}">
+      <xso:copy>
+        <xso:copy-of select="*"/>
+        <xsl:copy-of select="*"/>
+      </xso:copy>
+    </xso:template>
+  </xsl:template>
+
+  <xsl:template match="@*|node()">
+    <xsl:copy>
+      <xsl:apply-templates select="@*|node()"/>
+    </xsl:copy>
+  </xsl:template>
+
+</xsl:stylesheet>
\ No newline at end of file

Added: lenya/trunk/src/resources/test/template.xtest
URL: http://svn.apache.org/viewcvs/lenya/trunk/src/resources/test/template.xtest?rev=378474&view=auto
==============================================================================
--- lenya/trunk/src/resources/test/template.xtest (added)
+++ lenya/trunk/src/resources/test/template.xtest Fri Feb 17 02:09:49 2006
@@ -0,0 +1,28 @@
+<?xml version="1.0" ?>
+<!--
+  Copyright 1999-2004 The Apache Software Foundation
+  
+  Licensed under the Apache License, Version 2.0 (the "License");
+  you may not use this file except in compliance with the License.
+  You may obtain a copy of the License at
+  
+  http://www.apache.org/licenses/LICENSE-2.0
+  
+  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.
+-->
+<testcase>
+  
+  <annotation>
+    Test Cases
+  </annotation>
+  
+  <roles/>
+  
+  <components/>
+  
+</testcase>
+    
\ No newline at end of file

Modified: lenya/trunk/src/targets/test-build.xml
URL: http://svn.apache.org/viewcvs/lenya/trunk/src/targets/test-build.xml?rev=378474&r1=378473&r2=378474&view=diff
==============================================================================
--- lenya/trunk/src/targets/test-build.xml (original)
+++ lenya/trunk/src/targets/test-build.xml Fri Feb 17 02:09:49 2006
@@ -92,28 +92,54 @@
         <pathelement path="${build.webapp}/WEB-INF/classes" />
       </classpath>
     </javac>
+    
+    <!-- Generate the xtest file -->
+    <!--
+    This is template code to generate the xtest file automatically.
+    It doesn't work yet due to some exceptions during component initialization.
+    -->
+    <!--
+    <xslt in="${cocoon.src.dir}/build/cocoon-2.1.9-dev/classes/org/apache/cocoon/cocoon.roles"
+      out="${build.temp}/test/cocoon-roles.xsl"
+      style="${src.resource.dir}/test/meta.xsl"
+      force="true">
+      <param name="element" expression="roles"/>
+    </xslt>
+    
+    <xslt in="${build.webapp}/WEB-INF/classes/org/apache/lenya/lenya.roles"
+          out="${build.temp}/test/roles.xsl"
+          style="${src.resource.dir}/test/meta.xsl">
+      <param name="element" expression="roles"/>
+    </xslt>
+    
+    <xslt in="${build.webapp}/WEB-INF/cocoon.xconf"
+      out="${build.temp}/test/components.xsl"
+      style="${src.resource.dir}/test/meta.xsl">
+      <param name="element" expression="components"/>
+    </xslt>
+    
+    <xslt in="${src.resource.dir}/test/template.xtest"
+      out="${build.temp}/test/cocoon-roles.xtest"
+      style="${build.temp}/test/cocoon-roles.xsl"/>
+    
+    <xslt in="${build.temp}/test/cocoon-roles.xtest"
+      out="${build.temp}/test/roles.xtest"
+      style="${build.temp}/test/roles.xsl"/>
+    
+    <xslt in="${build.temp}/test/roles.xtest"
+      out="${build.test}/org/apache/lenya/cms/LenyaTestCase.xtest"
+      style="${build.temp}/test/components.xsl"/>
+    -->
+    
   </target>
 
 
   <!-- Runs JUnit tests -->
-  <target name="tests.junit"	depends="init, tests.prepare,
-        test.accesscontrol" />
-  
-  <!--
-  			test.workflow,
-  			test.anttask,
-  			test.publisher,
-  			test.accesscontrol,
-        test.deactivate,
-        test.publications" />
-  -->
-
-  
-  <!-- Access Control Tests -->
-  <target name="test.accesscontrol" depends="test.pub.prepare">
+  <target name="tests.junit" depends="init, tests.prepare, test.pub.prepare">
     <junit printsummary="yes" showoutput="true" haltonerror="on" haltonfailure="on">
       <sysproperty key="junit.test.loglevel" value="${junit.test.loglevel}"/>
       <sysproperty key="contextRoot" value="${basedir}/build/lenya/webapp"/>
+      <sysproperty key="tempDir" value="${basedir}/build/lenya/temp"/>
       <formatter type="plain"/>
       <classpath refid="classpath"/>
       <classpath>
@@ -139,65 +165,14 @@
       <test name="org.apache.lenya.ac.file.FileUserTest"/>
       <test name="org.apache.lenya.ac.file.FileGroupTest"/>
       <test name="org.apache.lenya.ac.file.FileRoleTest"/>
+      
+      <test name="org.apache.lenya.cms.publication.DefaultDocumentTest"/>
+      <test name="org.apache.lenya.cms.publication.DefaultDocumentBuilderTest"/>
+      <test name="org.apache.lenya.cms.publication.DublinCoreTest"/>
     </junit>
   </target>
   
     
-  <!-- AntTask Test -->
-  <target name="test.anttask" depends="test.pub.prepare">
-    <java
-    	fork="yes"
-    	classname="org.apache.lenya.cms.task.AntTaskTest"
-    	>
-      <jvmarg value="-enableassertions"/>
-      <arg value="${build.webapp}"/>
-      <arg value="${test.pub.id}"/>
-      <classpath refid="classpath.default"/>
-    </java>
-  </target>
-  
-
-  <!-- Workflow Test -->
-  <target name="test.workflow" depends="test.pub.prepare">
-    <java fork="yes" classname="org.apache.lenya.cms.workflow.WorkflowTest">
-      <jvmarg value="-enableassertions"/>
-      <arg value="${build.webapp}"/>
-      <arg value="${test.pub.id}"/>
-      <arg value="xhtml"/> <!-- document type -->
-      <classpath refid="classpath.default"/>
-    </java>
-  </target>  
-  
-  <!-- Publisher Test -->
-  <target name="test.publisher" depends="test.pub.prepare">
-    <java fork="yes" classname="org.apache.lenya.cms.task.PublisherTest">
-      <jvmarg value="-enableassertions"/>
-      <arg value="${build.webapp}"/>
-      <arg value="${test.pub.id}"/>
-      <classpath refid="classpath.default"/>
-    </java>
-  </target>  
-
-  <!-- Publication Test -->
-  <target name="test.publication" depends="test.pub.prepare">
-    <java fork="yes" classname="org.apache.lenya.cms.publication.PublicationTest">
-      <jvmarg value="-enableassertions"/>
-      <arg value="${build.webapp}"/>
-      <arg value="${test.pub.id}"/>
-      <classpath refid="classpath.default"/>
-    </java>
-  </target>  
-
-  <!-- Deactivate Document Test -->
-  <target name="test.deactivate" depends="test.pub.prepare">
-    <java fork="yes" classname="org.apache.lenya.cms.task.DocumentDeactivateTaskTest">
-      <jvmarg value="-enableassertions"/>
-      <arg value="C:\digitas\src\lenya-trunk\build\lenya\webapp"/>
-      <arg value="${test.pub.id}"/>
-      <classpath refid="classpath.default"/>
-    </java>
-  </target>
-
   <!-- ================================================ -->
   <!-- Anteater tests -->
   <!-- ================================================ -->

Modified: lenya/trunk/src/test/org/apache/lenya/cms/LenyaTestCase.java
URL: http://svn.apache.org/viewcvs/lenya/trunk/src/test/org/apache/lenya/cms/LenyaTestCase.java?rev=378474&r1=378473&r2=378474&view=diff
==============================================================================
--- lenya/trunk/src/test/org/apache/lenya/cms/LenyaTestCase.java (original)
+++ lenya/trunk/src/test/org/apache/lenya/cms/LenyaTestCase.java Fri Feb 17 02:09:49 2006
@@ -18,15 +18,19 @@
 
 import java.io.File;
 import java.net.URL;
+import java.util.Arrays;
 
 import org.apache.avalon.framework.container.ContainerUtil;
 import org.apache.avalon.framework.context.DefaultContext;
+import org.apache.cocoon.Constants;
 import org.apache.cocoon.core.container.ContainerTestCase;
 import org.apache.cocoon.environment.Context;
 import org.apache.cocoon.environment.Request;
 import org.apache.cocoon.environment.commandline.CommandLineContext;
 import org.apache.cocoon.environment.commandline.CommandLineRequest;
 import org.apache.cocoon.environment.mock.MockEnvironment;
+import org.apache.cocoon.util.IOUtils;
+import org.apache.commons.lang.SystemUtils;
 import org.apache.excalibur.source.SourceResolver;
 
 /**
@@ -41,13 +45,32 @@
 
         this.context = context;
 
+        String tempPath = System.getProperty("tempDir");
         String contextRoot = System.getProperty("contextRoot");
         getLogger().info("Adding context root entry [" + contextRoot + "]");
-        context.put("context-root", new File(contextRoot));
+
+        File contextRootDir = new File(contextRoot);
+        context.put("context-root", contextRootDir);
 
         Context envContext = new CommandLineContext(contextRoot);
         ContainerUtil.enableLogging(envContext, getLogger());
-        context.put("environment-context", envContext);
+        context.put(Constants.CONTEXT_ENVIRONMENT_CONTEXT, envContext);
+
+        File tempDir = new File(tempPath);
+
+        File workDir = new File(tempDir, "work");
+        context.put("work-directory", workDir);
+
+        File cacheDir = new File(tempDir, "cache");
+        context.put(Constants.CONTEXT_CACHE_DIR, cacheDir);
+
+        File uploadDir = new File(tempDir, "upload");
+        context.put(Constants.CONTEXT_UPLOAD_DIR, uploadDir);
+
+        context.put(Constants.CONTEXT_CLASS_LOADER, LenyaTestCase.class.getClassLoader());
+        context.put(Constants.CONTEXT_CLASSPATH, getClassPath(contextRoot));
+        // context.put(Constants.CONTEXT_CONFIG_URL, conf.toURL());
+        context.put(Constants.CONTEXT_DEFAULT_ENCODING, "ISO-8859-1");
 
     }
 
@@ -70,5 +93,44 @@
 
         Request request = new CommandLineRequest(env, "", contextRoot, pathInfo);
         context.put("object-model.request", request);
+    }
+
+    /**
+     * This builds the important ClassPath used by this class. It does so in a neutral way. It
+     * iterates in alphabetical order through every file in the lib directory and adds it to the
+     * classpath.
+     * 
+     * Also, we add the files to the ClassLoader for the Cocoon system. In order to protect
+     * ourselves from skitzofrantic classloaders, we need to work with a known one.
+     * 
+     * @param context The context path
+     * @return a <code>String</code> value
+     */
+    protected String getClassPath(final String context) {
+        StringBuffer buildClassPath = new StringBuffer();
+
+        String classDir = context + "/WEB-INF/classes";
+        buildClassPath.append(classDir);
+
+        File root = new File(context + "/WEB-INF/lib");
+        if (root.isDirectory()) {
+            File[] libraries = root.listFiles();
+            Arrays.sort(libraries);
+            for (int i = 0; i < libraries.length; i++) {
+                if (libraries[i].getAbsolutePath().endsWith(".jar")) {
+                    buildClassPath.append(File.pathSeparatorChar)
+                            .append(IOUtils.getFullFilename(libraries[i]));
+                }
+            }
+        }
+
+        buildClassPath.append(File.pathSeparatorChar).append(SystemUtils.JAVA_CLASS_PATH);
+
+        // Extra class path is necessary for non-classloader-aware java compilers to compile XSPs
+        // buildClassPath.append(File.pathSeparatorChar)
+        // .append(getExtraClassPath(context));
+
+        getLogger().info("Context classpath: " + buildClassPath);
+        return buildClassPath.toString();
     }
 }

Modified: lenya/trunk/src/test/org/apache/lenya/cms/LenyaTestCase.xtest
URL: http://svn.apache.org/viewcvs/lenya/trunk/src/test/org/apache/lenya/cms/LenyaTestCase.xtest?rev=378474&r1=378473&r2=378474&view=diff
==============================================================================
--- lenya/trunk/src/test/org/apache/lenya/cms/LenyaTestCase.xtest (original)
+++ lenya/trunk/src/test/org/apache/lenya/cms/LenyaTestCase.xtest Fri Feb 17 02:09:49 2006
@@ -83,6 +83,15 @@
     <role name="org.apache.lenya.cms.site.SiteManagerSelector"
       shorthand="site-managers"
       default-class="org.apache.cocoon.components.ExtendedComponentSelector"/>
+      
+    <role name="org.apache.lenya.cms.repository.NodeFactory"
+      shorthand="node-factory"
+      default-class="org.apache.lenya.cms.repository.SourceNodeFactory"/>
+    <!--
+      default-class="org.apache.lenya.cms.repo.adapter.RepoNodeFactory"/>
+      default-class="org.apache.lenya.cms.jcr.JCRNodeFactory"/>
+    -->
+    
     
   </roles>
   
@@ -91,10 +100,8 @@
     <source-factories>
       <component-instance class="org.apache.excalibur.source.impl.ResourceSourceFactory" name="resource"/>
       <component-instance class="org.apache.cocoon.components.source.impl.ContextSourceFactory" name="context"/>
-      <!--
-        <component-instance class="org.apache.lenya.cms.cocoon.source.ContextSourceFactory" name="context"/>
-      -->
       <component-instance class="org.apache.excalibur.source.impl.URLSourceFactory" name="*"/>
+      <component-instance class="org.apache.lenya.cms.cocoon.source.LenyaSourceFactory" name="lenya" scheme="context:"/>
     </source-factories>
     
     <source-resolver class="org.apache.excalibur.source.impl.SourceResolverImpl"/>

Modified: lenya/trunk/src/test/org/apache/lenya/cms/publication/DefaultDocumentBuilderTest.java
URL: http://svn.apache.org/viewcvs/lenya/trunk/src/test/org/apache/lenya/cms/publication/DefaultDocumentBuilderTest.java?rev=378474&r1=378473&r2=378474&view=diff
==============================================================================
--- lenya/trunk/src/test/org/apache/lenya/cms/publication/DefaultDocumentBuilderTest.java (original)
+++ lenya/trunk/src/test/org/apache/lenya/cms/publication/DefaultDocumentBuilderTest.java Fri Feb 17 02:09:49 2006
@@ -19,42 +19,12 @@
 
 package org.apache.lenya.cms.publication;
 
-import junit.framework.Test;
-import junit.framework.TestSuite;
-import junit.textui.TestRunner;
-
 /**
  * 
  * To change the template for this generated type comment go to Window>Preferences>Java>Code
  * Generation>Code and Comments
  */
 public class DefaultDocumentBuilderTest extends DefaultDocumentTest {
-    /**
-     * Constructor.
-     * 
-     * @param test The test.
-     */
-    public DefaultDocumentBuilderTest(String test) {
-        super(test);
-    }
-
-    /**
-     * The main program. The parameters are set from the command line arguments.
-     * 
-     * @param args The command line arguments.
-     */
-    public static void main(String[] args) {
-        TestRunner.run(getSuite());
-    }
-
-    /**
-     * Returns the test suite.
-     * 
-     * @return A test suite.
-     */
-    public static Test getSuite() {
-        return new TestSuite(DefaultDocumentBuilderTest.class);
-    }
 
     /**
      * @throws PublicationException 

Modified: lenya/trunk/src/test/org/apache/lenya/cms/publication/DefaultDocumentTest.java
URL: http://svn.apache.org/viewcvs/lenya/trunk/src/test/org/apache/lenya/cms/publication/DefaultDocumentTest.java?rev=378474&r1=378473&r2=378474&view=diff
==============================================================================
--- lenya/trunk/src/test/org/apache/lenya/cms/publication/DefaultDocumentTest.java (original)
+++ lenya/trunk/src/test/org/apache/lenya/cms/publication/DefaultDocumentTest.java Fri Feb 17 02:09:49 2006
@@ -19,11 +19,7 @@
 
 package org.apache.lenya.cms.publication;
 
-import junit.framework.Test;
-import junit.framework.TestSuite;
-import junit.textui.TestRunner;
-
-import org.apache.cocoon.SitemapComponentTestCase;
+import org.apache.lenya.cms.LenyaTestCase;
 import org.apache.lenya.transaction.IdentityMap;
 import org.apache.lenya.transaction.IdentityMapImpl;
 
@@ -32,34 +28,10 @@
  * To change the template for this generated type comment go to Window>Preferences>Java>Code
  * Generation>Code and Comments
  */
-public class DefaultDocumentTest extends SitemapComponentTestCase {
-    /**
-     * Constructor.
-     * @param test The test.
-     */
-    public DefaultDocumentTest(String test) {
-        super();
-    }
-
-    /**
-     * The main program. The parameters are set from the command line arguments.
-     * @param args The command line arguments.
-     */
-    public static void main(String[] args) {
-        TestRunner.run(getSuite());
-    }
-
-    /**
-     * Returns the test suite.
-     * @return A test suite.
-     */
-    public static Test getSuite() {
-        return new TestSuite(DefaultDocumentTest.class);
-    }
-
+public class DefaultDocumentTest extends LenyaTestCase {
+    
     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,
@@ -73,12 +45,12 @@
      */
     protected void doDocumentTest(DocumentTestSet testSet) throws PublicationException {
         Document document = getDocument(testSet);
-        System.out.println("ID:           " + document.getId());
-        System.out.println("Area:         " + document.getArea());
-        System.out.println("Language:     " + document.getLanguage());
-        System.out.println("Document URL: " + document.getCanonicalDocumentURL());
-        System.out.println("Complete URL: " + document.getCanonicalWebappURL());
-        System.out.println("Extension:    " + document.getExtension());
+        getLogger().info("ID:           " + document.getId());
+        getLogger().info("Area:         " + document.getArea());
+        getLogger().info("Language:     " + document.getLanguage());
+        getLogger().info("Document URL: " + document.getCanonicalDocumentURL());
+        getLogger().info("Complete URL: " + document.getCanonicalWebappURL());
+        getLogger().info("Extension:    " + document.getExtension());
 
         Publication publication = PublicationUtil.getPublication(getManager(), "test");
         assertEquals(document.getPublication(), publication);
@@ -90,7 +62,7 @@
                 + document.getArea() + testSet.getUrl());
         assertEquals(document.getExtension(), testSet.getExtension());
 
-        System.out.println("-----------------------------------------------");
+        getLogger().info("-----------------------------------------------");
     }
 
     /**

Modified: lenya/trunk/src/test/org/apache/lenya/cms/publication/DublinCoreTest.java
URL: http://svn.apache.org/viewcvs/lenya/trunk/src/test/org/apache/lenya/cms/publication/DublinCoreTest.java?rev=378474&r1=378473&r2=378474&view=diff
==============================================================================
--- lenya/trunk/src/test/org/apache/lenya/cms/publication/DublinCoreTest.java (original)
+++ lenya/trunk/src/test/org/apache/lenya/cms/publication/DublinCoreTest.java Fri Feb 17 02:09:49 2006
@@ -17,20 +17,17 @@
 
 package org.apache.lenya.cms.publication;
 
-import junit.textui.TestRunner;
-
-import org.apache.cocoon.SitemapComponentTestCase;
 import org.apache.lenya.cms.metadata.MetaData;
 import org.apache.lenya.cms.metadata.dublincore.DublinCore;
-import org.apache.lenya.transaction.IdentityMap;
-import org.apache.lenya.transaction.IdentityMapImpl;
+import org.apache.lenya.cms.repository.RepositoryException;
+import org.apache.lenya.cms.repository.RepositoryTestCase;
 
 /**
  * Dublin Core test.
  * 
  * @version $Id$
  */
-public class DublinCoreTest extends SitemapComponentTestCase {
+public class DublinCoreTest extends RepositoryTestCase {
 
     private static final String AREA = "authoring";
     private static final String DOCUMENT_ID = "/tutorial";
@@ -38,32 +35,18 @@
     private static final String CREATOR = "test";
 
     /**
-     * Constructor for DublinCoreTest.
-     * @param arg0 a test
-     */
-    public DublinCoreTest(String arg0) {
-        super();
-    }
-
-    /**
-     * The main program. The parameters are set from the command line arguments.
-     * 
-     * @param args The command line arguments.
-     */
-    public static void main(String[] args) {
-        TestRunner.run(DublinCoreTest.class);
-    }
-
-    /**
      * Test the fetching, modification and refetching of a dc core object.
      * @throws PublicationException 
+     * @throws RepositoryException 
      */
-    final public void testModifySaveAndReload() throws PublicationException {
+    final public void testModifySaveAndReload() throws PublicationException, RepositoryException {
         Publication publication = PublicationUtil.getPublication(getManager(), "test");
         
-        IdentityMap idMap = new IdentityMapImpl(getLogger());
-        DocumentIdentityMap map = new DocumentIdentityMap(idMap, getManager(), getLogger());
+        DocumentIdentityMap map = getIdentityMap();
         Document doc = map.get(publication, AREA, DOCUMENT_ID, LANGUAGE);
+        
+        doc.getRepositoryNode().lock();
+        
         MetaData dcCore = doc.getMetaDataManager().getDublinCoreMetaData();
         String title = dcCore.getFirstValue(DublinCore.ELEMENT_TITLE);
         String subject = dcCore.getFirstValue(DublinCore.ELEMENT_SUBJECT);
@@ -81,6 +64,8 @@
         assertEquals(dateIssued, dcCore2.getFirstValue(DublinCore.TERM_ISSUED));
         assertFalse(creator.equals(dcCore2.getFirstValue(DublinCore.ELEMENT_CREATOR)));
         assertEquals(CREATOR, dcCore2.getFirstValue(DublinCore.ELEMENT_CREATOR));
+        
+        doc.getRepositoryNode().unlock();
     }
 
 }



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