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

[email protected]
Newsgroups gmane.comp.cms.lenya.cvs
Message-ID <[email protected]>
Author: andreas
Date: Mon Mar 24 10:24:47 2008
New Revision: 640473

URL: http://svn.apache.org/viewvc?rev=640473&view=rev
Log:
Updateing publication test to template handling changes.

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

Modified: lenya/trunk/src/impl/test/org/apache/lenya/cms/publication/PublicationTest.java
URL: http://svn.apache.org/viewvc/lenya/trunk/src/impl/test/org/apache/lenya/cms/publication/PublicationTest.java?rev=640473&r1=640472&r2=640473&view=diff
==============================================================================
--- lenya/trunk/src/impl/test/org/apache/lenya/cms/publication/PublicationTest.java (original)
+++ lenya/trunk/src/impl/test/org/apache/lenya/cms/publication/PublicationTest.java Mon Mar 24 10:24:47 2008
@@ -81,12 +81,12 @@
 
         Set typeSet = new HashSet(Arrays.asList(types));
 
-        String[] templateIds = pub.getTemplateIds();
-        for (int i = 0; i < templateIds.length; i++) {
-            Publication template = pub.getFactory().getPublication(templateIds[i]);
+        String templateId = pub.getTemplateId();
+        if (templateId != null) {
+            Publication template = pub.getFactory().getPublication(templateId);
             String[] templateTypes = template.getResourceTypeNames();
             for (int t = 0; t < templateTypes.length; t++) {
-                assertTrue(typeSet.contains(templateTypes[i]));
+                assertTrue(typeSet.contains(templateTypes[t]));
             }
         }
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.