View Javadoc
1   /**
2    * Copyright 2005-2015 The Kuali Foundation
3    *
4    * Licensed under the Educational Community License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    * http://www.opensource.org/licenses/ecl2.php
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package org.kuali.rice.krad.uif.util;
17  
18  import static org.junit.Assert.assertEquals;
19  
20  import org.apache.log4j.Logger;
21  import org.junit.AfterClass;
22  import org.junit.Assume;
23  import org.junit.BeforeClass;
24  import org.junit.Ignore;
25  import org.junit.Test;
26  import org.kuali.rice.core.api.resourceloader.GlobalResourceLoader;
27  import org.kuali.rice.krad.uif.element.Message;
28  import org.kuali.rice.krad.uif.view.InquiryView;
29  
30  /**
31   * Unit tests for proving correct operation of the ViewHelperService.
32   * 
33   * @author Kuali Rice Team (rice.collab@kuali.org)
34   */
35  public class ComponentFactoryTest extends ProcessLoggingUnitTest {
36      
37      @BeforeClass
38      public static void setUpClass() throws Throwable {
39          UifUnitTestUtils.establishMockConfig("KRAD-ComponentFactoryTest");
40      }
41  
42      @AfterClass
43      public static void tearDownClass() throws Throwable {
44          GlobalResourceLoader.stop();
45      }
46  
47      @Test
48      public void testSanity() throws Throwable {
49          try {
50              Message message = ComponentFactory.getMessage();
51              assertEquals("uif-message", message.getCssClasses().get(0));
52          } catch (NullPointerException e) {
53              Assume.assumeNoException("Missing required testing resources, skipping", e);
54          }
55      }
56  
57      @Test
58      public void testInquiry() throws Throwable {
59          try {
60              InquiryView inquiryView = ComponentFactory.getInquiryView();
61              assertEquals("uif-formView", inquiryView.getCssClasses().get(0));
62          } catch (NullPointerException e) {
63              Assume.assumeNoException("Missing required testing resources, skipping", e);
64          }
65      }
66  
67  }