1   /*
2    * Copyright 2004 The Apache Software Foundation
3    *
4    * Licensed under the Apache 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.apache.org/licenses/LICENSE-2.0
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.apache.pluto.descriptors.portlet;
17  
18  import java.util.Arrays;
19  
20  import junit.framework.TestCase;
21  
22  /***
23   * Portlet Deployment Descriptor Configuration.
24   * @author <a href="ddewolf@apache.org">David H. DeWolf</a>
25   * @version 1.0
26   * @since Mar 23, 2005
27   */
28  public class PortletAppDDTest extends TestCase {
29  
30      private PortletAppDD dd;
31  
32      public PortletAppDDTest() {
33  
34      }
35  
36      public void setUp() {
37          dd = new PortletAppDD();
38      }
39  
40      public void tearDown() {
41          dd = null;
42      }
43  
44      public void testCollectionsNotNull() {
45          assertNotNull(dd.getPortlets());
46      }
47  
48      public void testFindPortlet() {
49          PortletDD[] portlets = {new PortletDD(), new PortletDD()};
50          portlets[0].setPortletName("one");
51          portlets[1].setPortletName("two");
52          dd.setPortlets(Arrays.asList(portlets));
53  
54          assertEquals(portlets[0], dd.getPortlet("one"));
55          assertEquals(portlets[1], dd.getPortlet("two"));
56      }
57  
58  }
59