svn commit: r595347 - /lenya/trunk/src/impl/test/org/apache/lenya/cms/publication/DocumentManagerTest.java

[email protected]
Newsgroups gmane.comp.cms.lenya.cvs
Message-ID <[email protected]>
Author: andreas
Date: Thu Nov 15 08:17:59 2007
New Revision: 595347

URL: http://svn.apache.org/viewvc?rev=595347&view=rev
Log:
Added failing test for bug 43858

Modified:
    lenya/trunk/src/impl/test/org/apache/lenya/cms/publication/DocumentManagerTest.java

Modified: lenya/trunk/src/impl/test/org/apache/lenya/cms/publication/DocumentManagerTest.java
URL: http://svn.apache.org/viewvc/lenya/trunk/src/impl/test/org/apache/lenya/cms/publication/DocumentManagerTest.java?rev=595347&r1=595346&r2=595347&view=diff
==============================================================================
--- lenya/trunk/src/impl/test/org/apache/lenya/cms/publication/DocumentManagerTest.java (original)
+++ lenya/trunk/src/impl/test/org/apache/lenya/cms/publication/DocumentManagerTest.java Thu Nov 15 08:17:59 2007
@@ -28,6 +28,7 @@
 import org.apache.lenya.cms.site.SiteNode;
 import org.apache.lenya.cms.site.SiteStructure;
 import org.apache.lenya.cms.site.SiteUtil;
+import org.apache.lenya.util.StringUtil;
 
 /**
  * Document manager test.
@@ -122,6 +123,7 @@
         Area authoring = pub.getArea("authoring");
 
         SiteNode sourceNode = authoring.getSite().getNode(sourcePath);
+        
         NodeSet nodes = SiteUtil.getSubSite(getManager(), sourceNode);
         Document[] docs = nodes.getDocuments();
         Map doc2path = new HashMap();
@@ -144,7 +146,21 @@
             assertEquals(newDoc.getContentLength(), docs[i].getContentLength());
             assertFalse(newDoc.getUUID().equals(docs[i].getUUID()));
         }
+        
+        String[] sourceNames = getChildNames(sourceNode);
+        SiteNode targetNode = authoring.getSite().getNode(targetPath);
+        String[] targetNames = getChildNames(targetNode);
+        assertEquals(StringUtil.join(sourceNames, ","), StringUtil.join(targetNames, ","));
     }
+
+	protected String[] getChildNames(SiteNode node) {
+		SiteNode[] sourceChildren = node.getChildren();
+        String[] names = new String[sourceChildren.length];
+        for (int i = 0; i < names.length; i++) {
+        	names[i] = sourceChildren[i].getName();
+        }
+		return names;
+	}
 
     protected void doTestMoveAll(DocumentManager docManager, String sourcePath, String targetPath)
             throws SiteException, DocumentException, PublicationException {
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.