Clover Coverage Report - Pebble 2.5-SNAPSHOT
Coverage timestamp: Sat Jun 12 2010 09:39:29 EST
../../../../img/srcFileCovDistChart0.png 48% of files have more coverage
8   34   6   8
2   23   0,75   1
1     6  
1    
This report was generated with an evaluation server license. Purchase Clover or configure your license.
 
  UpgradeUtilities       Line # 12 8 0% 6 11 0% 0.0
 
No Tests
 
1    package net.sourceforge.pebble.util;
2   
3    import net.sourceforge.pebble.domain.Blog;
4    import org.apache.commons.logging.Log;
5    import org.apache.commons.logging.LogFactory;
6   
7    /**
8    * Utilities for upgrading blogs.
9    *
10    * @author Simon Brown
11    */
 
12    public class UpgradeUtilities {
13   
14    /** the logger used by this action */
15    private static final Log log = LogFactory.getLog(UpgradeUtilities.class);
16   
 
17  0 toggle public static void upgradeBlog(Blog blog, String fromVersion, String toVersion) throws Exception {
18  0 log.info("Upgrading blog from " + fromVersion + " to " + toVersion);
19  0 if (fromVersion == null
20    || fromVersion.startsWith("2.3")
21    || fromVersion.startsWith("2.2")
22    || fromVersion.startsWith("2.1")
23    || fromVersion.startsWith("2.0")) {
24  0 log.info("restructuring static pages");
25  0 Utilities.restructureStaticPages(blog);
26  0 log.info("building indizes");
27  0 Utilities.buildIndexes(blog);
28  0 log.info("upgrade done");
29    } else {
30  0 log.info("No upgrade required");
31    }
32    }
33   
34    }