KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > exoplatform > test > mocks > portlet > MockPortletConfig


1 /**
2  * Copyright 2001-2003 The eXo Platform SARL All rights reserved.
3  * Please look at license.txt in info directory for more license detail.
4  **/

5 package org.exoplatform.test.mocks.portlet;
6
7 import java.util.* ;
8 import javax.portlet.* ;
9
10 /**
11  * Created by The eXo Platform SARL
12  * Author : Tuan Nguyen
13  * tuan08@users.sourceforge.net
14  * Date: Jul 27, 2003
15  * Time: 2:13:09 AM
16  */

17 public class MockPortletConfig implements PortletConfig {
18   
19   String JavaDoc portletName_ ;
20   PortletContext context_ = null ;
21   Hashtable parameters_ = new Hashtable() ;
22   ResourceBundle res_ ;
23   
24   public MockPortletConfig(PortletContext context) {
25     parameters_ = new Hashtable() ;
26     context_ = context;
27     parameters_.put("template-location", "/WEB-INF/templates/html") ;
28   }
29   
30   public String JavaDoc getPortletName () {
31     return portletName_ ;
32   }
33   public void setPortletName(String JavaDoc name) { portletName_ = name ; }
34
35   public PortletContext getPortletContext () {
36     return context_ ;
37   }
38   
39   public void setResourceBundle(ResourceBundle res) {
40     res_ = res ;
41   }
42   
43   public java.util.ResourceBundle JavaDoc getResourceBundle(java.util.Locale JavaDoc locale) {
44     return res_ ;
45   }
46
47   public String JavaDoc getInitParameter(java.lang.String JavaDoc name) {
48     return (String JavaDoc) parameters_.get(name) ;
49   }
50
51   public void setInitParameter(String JavaDoc name, String JavaDoc value) {
52     parameters_.put(name, value) ;
53   }
54
55   public java.util.Enumeration JavaDoc getInitParameterNames() {
56     return null ;
57   }
58 }
59
60
Popular Tags