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 2007/11/16 10:25:51 UTC

svn commit: r595609 - /lenya/trunk/src/impl/test/org/apache/lenya/cms/site/SimpleSiteManagerTest.java

Author: andreas
Date: Fri Nov 16 01:25:49 2007
New Revision: 595609

URL: http://svn.apache.org/viewvc?rev=595609&view=rev
Log:
SiteTree test: updated to new site code (don't fail for non-UUID nodes)

Modified:
    lenya/trunk/src/impl/test/org/apache/lenya/cms/site/SimpleSiteManagerTest.java

Modified: lenya/trunk/src/impl/test/org/apache/lenya/cms/site/SimpleSiteManagerTest.java
URL: http://svn.apache.org/viewvc/lenya/trunk/src/impl/test/org/apache/lenya/cms/site/SimpleSiteManagerTest.java?rev=595609&r1=595608&r2=595609&view=diff
==============================================================================
--- lenya/trunk/src/impl/test/org/apache/lenya/cms/site/SimpleSiteManagerTest.java (original)
+++ lenya/trunk/src/impl/test/org/apache/lenya/cms/site/SimpleSiteManagerTest.java Fri Nov 16 01:25:49 2007
@@ -29,7 +29,6 @@
 import org.apache.lenya.cms.publication.PublicationException;
 import org.apache.lenya.cms.publication.ResourceType;
 import org.apache.lenya.cms.repository.RepositoryException;
-import org.apache.lenya.cms.repository.RepositoryUtil;
 import org.apache.lenya.cms.repository.Session;
 import org.apache.lenya.cms.site.Link;
 import org.apache.lenya.cms.site.SiteException;
@@ -99,9 +98,6 @@
 
                 SiteNode node = structure.getNode(nodes[i].getPath());
                 assertNotNull(node);
-                if (node.getLanguages().length > 0) {
-                    assertNotNull(node.getUuid());
-                }
                 assertEquals(nodes[i], node);
 
                 checkLinks(siteManager, node);
@@ -144,21 +140,24 @@
             Link link = node.getLink(languages[i]);
             assertEquals(link.getLanguage(), languages[i]);
             assertNotNull(link.getLabel());
-            Document doc = link.getDocument();
-            assertNotNull(doc);
-
-            String docUuid = doc.getUUID();
-            String nodeUuid = node.getUuid();
-
-            assertNotNull(doc.getUUID());
-            assertEquals(docUuid, nodeUuid);
-            assertEquals(doc.getLanguage(), link.getLanguage());
-
-            // it may not be allowed to insert the doc twice
-            try {
-                siteManager.add("/sidebar", doc);
-                assertTrue("No exception thrown", false);
-            } catch (Exception expected) {
+            
+            if (node.getUuid() != null) {
+                Document doc = link.getDocument();
+                assertNotNull(doc);
+    
+                String docUuid = doc.getUUID();
+                String nodeUuid = node.getUuid();
+    
+                assertNotNull(doc.getUUID());
+                assertEquals(docUuid, nodeUuid);
+                assertEquals(doc.getLanguage(), link.getLanguage());
+    
+                // it may not be allowed to insert the doc twice
+                try {
+                    siteManager.add("/sidebar", doc);
+                    assertTrue("No exception thrown", false);
+                } catch (Exception expected) {
+                }
             }
         }
     }



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