1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one or more
3    * contributor license agreements.  See the NOTICE file distributed with
4    * this work for additional information regarding copyright ownership.
5    * The ASF licenses this file to You under the Apache License, Version 2.0
6    * (the "License"); you may not use this file except in compliance with
7    * the License.  You may obtain a copy of the License at
8    * 
9    *      http://www.apache.org/licenses/LICENSE-2.0
10   * 
11   * Unless required by applicable law or agreed to in writing, software
12   * distributed under the License is distributed on an "AS IS" BASIS,
13   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14   * See the License for the specific language governing permissions and
15   * limitations under the License.
16   */
17  package org.apache.jetspeed.components.portletregistry.direct;
18  
19  import junit.framework.Test;
20  import junit.framework.TestSuite;
21  
22  import org.apache.jetspeed.components.portletregistry.AbstractRegistryTest;
23  import org.apache.jetspeed.om.portlet.impl.PortletApplicationDefinitionImpl;
24  
25  /***
26   * 
27   * TestRegistry runs a suite updating PAs
28   * 
29   * @author <a href="mailto:taylor@apache.org">David Sean Taylor</a>
30   * @version $Id: TestRegistryDirectPart1b.java 516448 2007-03-09 16:25:47Z ate $
31   *  
32   */
33  public class TestRegistryDirectPart1b extends AbstractRegistryTest
34  {
35      /*
36       * (non-Javadoc)
37       * 
38       * @see junit.framework.TestCase#setUp()
39       */
40      protected void setUp() throws Exception
41      {
42          super.setUp();                
43      }
44  
45      /*
46       * (non-Javadoc)
47       * 
48       * @see junit.framework.TestCase#tearDown()
49       */
50      protected void tearDown() throws Exception
51      {
52         //  super.tearDown();
53      }
54  
55      public static Test suite()
56      {
57          // All methods starting with "test" will be executed in the test suite.
58          return new TestSuite(TestRegistryDirectPart1b.class);
59      }
60      
61      public void testUpdates() throws Exception
62      {
63          
64          PortletApplicationDefinitionImpl app = (PortletApplicationDefinitionImpl) registry.getPortletApplication("App_1");
65          assertNotNull("PA App_1 is NULL", app);
66  
67          app.addUserAttribute("user.pets.doggie", "Busby");
68          
69          registry.updatePortletApplication(app);        
70                                  
71          System.out.println("PA update test complete");
72      }
73      
74  }