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