roller-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From agillil...@apache.org
Subject svn commit: r219732 - in /incubator/roller/trunk/tests/org/roller: RollerTestBase.java business/UserManagerTest.java
Date Tue, 19 Jul 2005 17:51:33 GMT
Author: agilliland
Date: Tue Jul 19 10:51:27 2005
New Revision: 219732

URL: http://svn.apache.org/viewcvs?rev=219732&view=rev
Log:
a couple small alterations to junit tests due to changes for theme management.  the big one
being that some tests assume users have page templates after a new registration which is no
longer true.

Modified:
    incubator/roller/trunk/tests/org/roller/RollerTestBase.java
    incubator/roller/trunk/tests/org/roller/business/UserManagerTest.java

Modified: incubator/roller/trunk/tests/org/roller/RollerTestBase.java
URL: http://svn.apache.org/viewcvs/incubator/roller/trunk/tests/org/roller/RollerTestBase.java?rev=219732&r1=219731&r2=219732&view=diff
==============================================================================
--- incubator/roller/trunk/tests/org/roller/RollerTestBase.java (original)
+++ incubator/roller/trunk/tests/org/roller/RollerTestBase.java Tue Jul 19 10:51:27 2005
@@ -21,9 +21,11 @@
 import org.roller.model.UserManager;
 import org.roller.model.WeblogManager;
 import org.roller.pojos.CommentData;
+import org.roller.pojos.Theme;
 import org.roller.pojos.UserData;
 import org.roller.pojos.WeblogCategoryData;
 import org.roller.pojos.WeblogEntryData;
+import org.roller.pojos.WeblogTemplate;
 import org.roller.pojos.WebsiteData;
 
 /**
@@ -130,7 +132,38 @@
         pages.put("Weblog","Weblog page content");
         pages.put("_day","Day page content");
         pages.put("css","CSS page content");
-        umgr.addUser(ud, pages, "basic", "en_US_WIN", "America/Los_Angeles");
+        umgr.addUser(ud, pages, Theme.CUSTOM, "en_US_WIN", "America/Los_Angeles");
+        
+        // the addUser method no longer creates pages, so we add them manually
+        WebsiteData website = umgr.getWebsite(username);
+        Iterator iter = pages.keySet().iterator();
+        while ( iter.hasNext() )
+        {
+            String pageName = (String) iter.next();
+            String sb = (String)pages.get( pageName );
+              
+            // Store each Velocity template as a page
+            WeblogTemplate pd = new WeblogTemplate( null,
+                website,         // website
+                pageName,        // name
+                pageName,        // description
+                pageName,        // link
+                sb,              // template
+                new Date()       // updateTime                
+            );
+            umgr.storePage(pd);
+            
+            if ( pd.getName().equals("Weblog") )
+            {  
+                website.setDefaultPageId(pd.getId());                 
+            }
+            else if ( pd.getName().equals("_day") )
+            {
+                website.setWeblogDayPageId(pd.getId());                 
+            }                
+        }
+        website.save();
+        
         return ud;
     }
 

Modified: incubator/roller/trunk/tests/org/roller/business/UserManagerTest.java
URL: http://svn.apache.org/viewcvs/incubator/roller/trunk/tests/org/roller/business/UserManagerTest.java?rev=219732&r1=219731&r2=219732&view=diff
==============================================================================
--- incubator/roller/trunk/tests/org/roller/business/UserManagerTest.java (original)
+++ incubator/roller/trunk/tests/org/roller/business/UserManagerTest.java Tue Jul 19 10:51:27
2005
@@ -238,7 +238,8 @@
         assertNotNull(root);
 
         List pages1 = getRoller().getUserManager().getPages(website);
-        assertEquals(3, pages1.size());
+        // new registrations require a theme, so no pages are created -- Allen G
+        assertEquals(0, pages1.size());
         getRoller().rollback();
 
         // Remove the user



Mime
View raw message