| 1 | 
    
            
    
     | 
    
           | 
  
            
  
    | 2 | 
    
            
    
     | 
    
           | 
  
            
  
    | 3 | 
    
            
    
     | 
    
           | 
  
            
  
    | 4 | 
    
            
    
     | 
    
           | 
  
            
  
    | 5 | 
    
            
    
     | 
    
           | 
  
            
  
    | 6 | 
    
            
    
     | 
    
           | 
  
            
  
    | 7 | 
    
            
    
     | 
    
           | 
  
            
  
    | 8 | 
    
            
    
     | 
    
           | 
  
            
  
    | 9 | 
    
            
    
     | 
    
           | 
  
            
  
    | 10 | 
    
            
    
     | 
    
           | 
  
            
  
    | 11 | 
    
            
    
     | 
    
           | 
  
            
  
    | 12 | 
    
            
    
     | 
    
           | 
  
            
  
    | 13 | 
    
            
    
     | 
    
           | 
  
            
  
    | 14 | 
    
            
    
     | 
    
           | 
  
            
  
    | 15 | 
    
            
    
     | 
    
           | 
  
            
  
    | 16 | 
    
            
    
     | 
    
           | 
  
            
  
    | 17 | 
    
            
    
     | 
    
           | 
  
            
  
    | 18 | 
    
            
    
     | 
    
           | 
  
            
  
    | 19 | 
    
            
    
     | 
    
           | 
  
            
  
    | 20 | 
    
            
    
     | 
    
           | 
  
            
  
    | 21 | 
    
            
    
     | 
    
           | 
  
            
  
    | 22 | 
    
            
    
     | 
    
           | 
  
            
  
    | 23 | 
    
            
    
     | 
    
           | 
  
            
  
    | 24 | 
    
            
    
     | 
    
           | 
  
            
  
    | 25 | 
    
            
    
     | 
    
           | 
  
            
  
    | 26 | 
    
            
    
     | 
    
           | 
  
            
  
    | 27 | 
    
            
    
     | 
    
           | 
  
            
  
    | 28 | 
    
            
    
     | 
    
           | 
  
            
  
    | 29 | 
    
            
    
     | 
    
           | 
  
            
  
    | 30 | 
    
            
    
     | 
    
           | 
  
            
  
    | 31 | 
    
            
    
     | 
    
           | 
  
            
  
    | 32 | 
    
            
    
     | 
    
      package net.sourceforge.pebble.domain;     | 
  
            
  
    | 33 | 
    
            
    
     | 
    
           | 
  
            
  
    | 34 | 
    
            
    
     | 
    
      import net.sourceforge.pebble.dao.DAOFactory;     | 
  
            
  
    | 35 | 
    
            
    
     | 
    
      import net.sourceforge.pebble.dao.mock.MockDAOFactory;     | 
  
            
  
    | 36 | 
    
            
    
     | 
    
      import net.sourceforge.pebble.Configuration;     | 
  
            
  
    | 37 | 
    
            
    
     | 
    
      import net.sourceforge.pebble.PebbleContext;     | 
  
            
  
    | 38 | 
    
            
    
     | 
    
      import net.sourceforge.pebble.security.MockSecurityRealm;     | 
  
            
  
    | 39 | 
    
            
    
     | 
    
           | 
  
            
  
    | 40 | 
    
            
    
     | 
    
      import java.io.File;     | 
  
            
  
    | 41 | 
    
            
    
     | 
    
           | 
  
            
  
    | 42 | 
    
            
    
     | 
    
           | 
  
            
  
    | 43 | 
    
            
    
     | 
    
           | 
  
            
  
    | 44 | 
    
            
    
     | 
    
           | 
  
            
  
    | 45 | 
    
            
    
     | 
    
      @author     | 
  
            
  
    | 46 | 
    
            
    
     | 
    
           | 
  
               
        | 
             
         | 
        
       
        | 
       
           
           
            | 100% | 
           Uncovered Elements: 0 (21) | 
           Complexity: 2 | 
           Complexity Density: 0,11 | 
                        
            
        | 
    
  
  
    | 47 | 
    
            
    
     | 
    
      public abstract class SingleBlogTestCase extends PebbleTestCase {     | 
  
            
  
    | 48 | 
    
            
    
     | 
    
           | 
  
            
  
    | 49 | 
    
            
    
     | 
    
        protected Blog blog;     | 
  
            
  
    | 50 | 
    
            
    
     | 
    
           | 
  
               
        | 
             
         | 
        
       
        | 
       
           
           
            | 100% | 
           Uncovered Elements: 0 (16) | 
           Complexity: 1 | 
           Complexity Density: 0,06 | 
                        
            
        | 
    
  
  
    | 51 | 
    
           1182
    
     | 
    
         protected void setUp() throws Exception {...     | 
  
            
  
    | 52 | 
    
           1182
    
     | 
    
          super.setUp();     | 
  
            
  
    | 53 | 
    
            
    
     | 
    
           | 
  
            
  
    | 54 | 
    
           1182
    
     | 
    
          DAOFactory.setConfiguredFactory(new MockDAOFactory());     | 
  
            
  
    | 55 | 
    
           1182
    
     | 
    
          BlogManager.getInstance().setMultiBlog(false);     | 
  
            
  
    | 56 | 
    
            
    
     | 
    
           | 
  
            
  
    | 57 | 
    
           1182
    
     | 
    
          File blogDirectory = new File(TEST_BLOG_LOCATION, "blogs/default");     | 
  
            
  
    | 58 | 
    
           1182
    
     | 
    
          blogDirectory.mkdir();     | 
  
            
  
    | 59 | 
    
           1182
    
     | 
    
          blog = new Blog(blogDirectory.getAbsolutePath());     | 
  
            
  
    | 60 | 
    
           1182
    
     | 
    
          Theme theme = new Theme(blog, "user-default", TEST_BLOG_LOCATION.getAbsolutePath());     | 
  
            
  
    | 61 | 
    
           1182
    
     | 
    
          blog.setEditableTheme(theme);     | 
  
            
  
    | 62 | 
    
            
    
     | 
    
               | 
  
            
  
    | 63 | 
    
           1182
    
     | 
    
          blog.setProperty(Blog.LANGUAGE_KEY, "en");     | 
  
            
  
    | 64 | 
    
            
    
     | 
    
           | 
  
            
  
    | 65 | 
    
           1182
    
     | 
    
          Configuration config = new Configuration();     | 
  
            
  
    | 66 | 
    
           1182
    
     | 
    
          config.setDataDirectory(TEST_BLOG_LOCATION.getAbsolutePath());     | 
  
            
  
    | 67 | 
    
           1182
    
     | 
    
          config.setUrl("http://www.yourdomain.com/blog/");     | 
  
            
  
    | 68 | 
    
           1182
    
     | 
    
          PebbleContext.getInstance().setConfiguration(config);     | 
  
            
  
    | 69 | 
    
            
    
     | 
    
           | 
  
            
  
    | 70 | 
    
           1182
    
     | 
    
          PebbleContext.getInstance().getConfiguration().setSecurityRealm(new MockSecurityRealm());     | 
  
            
  
    | 71 | 
    
            
    
     | 
    
           | 
  
            
  
    | 72 | 
    
           1182
    
     | 
    
          BlogManager.getInstance().addBlog(blog);     | 
  
            
  
    | 73 | 
    
           1182
    
     | 
    
          blog.start();     | 
  
            
  
    | 74 | 
    
            
    
     | 
    
        }     | 
  
            
  
    | 75 | 
    
            
    
     | 
    
           | 
  
               
        | 
             
         | 
        
       
        | 
       
           
           
            | 100% | 
           Uncovered Elements: 0 (3) | 
           Complexity: 1 | 
           Complexity Density: 0,33 | 
                        
            
        | 
    
  
  
    | 76 | 
    
           1182
    
     | 
    
         protected void tearDown() throws Exception {...     | 
  
            
  
    | 77 | 
    
           1182
    
     | 
    
          blog.stop();     | 
  
            
  
    | 78 | 
    
           1182
    
     | 
    
          BlogManager.getInstance().removeAllBlogs();     | 
  
            
  
    | 79 | 
    
            
    
     | 
    
           | 
  
            
  
    | 80 | 
    
           1182
    
     | 
    
          super.tearDown();     | 
  
            
  
    | 81 | 
    
            
    
     | 
    
        }     | 
  
            
  
    | 82 | 
    
            
    
     | 
    
           | 
  
            
  
    | 83 | 
    
            
    
     | 
    
      }     |