View Javadoc

1   /*
2    * $Id: SplashScreenTestCase.java 22387 2011-07-12 03:53:36Z dirk.olmes $
3    * --------------------------------------------------------------------------------------
4    * Copyright (c) MuleSoft, Inc.  All rights reserved.  http://www.mulesoft.com
5    *
6    * The software in this package is published under the terms of the CPAL v1.0
7    * license, a copy of which has been included with this distribution in the
8    * LICENSE.txt file.
9    */
10  
11  package org.mule.util;
12  
13  import org.mule.tck.junit4.AbstractMuleContextTestCase;
14  
15  import org.junit.Test;
16  
17  import static org.junit.Assert.assertEquals;
18  import static org.junit.Assert.assertNotNull;
19  import static org.junit.Assert.assertTrue;
20  
21  public class SplashScreenTestCase extends AbstractMuleContextTestCase
22  {
23  
24      @Test
25      public void testMuleContextSplashScreenRendering() throws Exception
26      {
27          SplashScreen serverStartupSplashScreen = new ServerStartupSplashScreen();
28          assertNotNull(serverStartupSplashScreen);
29          assertTrue(serverStartupSplashScreen.toString().length() > 0);
30          
31          muleContext.start();
32          muleContext.stop();
33          String initialStartBoilerPlate = serverStartupSplashScreen.toString();
34          
35          muleContext.start();
36          muleContext.stop();
37          String subsequentStartBoilerPlate = serverStartupSplashScreen.toString();
38          
39          // Only lightly validate on size because content changes, e.g. server start time-stamp
40          assertEquals("Splash-screen sizes differ, ", initialStartBoilerPlate.length(), subsequentStartBoilerPlate.length());
41      }
42  
43  }