KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > exoplatform > services > config > test > TestConfigurationService


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.services.config.test;
6
7 import org.exoplatform.container.PortalContainer;
8 import org.exoplatform.services.config.ConfigurationService;
9 import org.exoplatform.services.config.impl.*;
10 import org.exoplatform.test.BasicTestCase;
11 /**
12  * Thu, May 15, 2004 @
13  * @author: Tuan Nguyen
14  * @version: $Id: TestResourceBundleService.java,v 1.2 2004/10/27 03:04:43 tuan08 Exp $
15  * @since: 0.0
16  * @email: tuan08@yahoo.com
17  */

18 public class TestConfigurationService extends BasicTestCase {
19   
20   private ConfigurationService service_ ;
21   
22   public TestConfigurationService(String JavaDoc name) {
23     super(name);
24   }
25
26   public void setUp() throws Exception JavaDoc {
27     PortalContainer manager = PortalContainer.getInstance();
28     service_ = (ConfigurationService) manager.getComponentInstanceOfType(ConfigurationService.class) ;
29   }
30   
31   public void tearDown() throws Exception JavaDoc {
32   }
33   
34   public void testResourceBundleService() throws Exception JavaDoc {
35     ConfigurationDataImpl impl = new ConfigurationDataImpl() ;
36     impl.setData("this is a test") ;
37     service_.saveServiceConfiguration(ConfigurationDataImpl.class, impl) ;
38     
39     impl = (ConfigurationDataImpl) service_.getServiceConfiguration(ConfigurationDataImpl.class) ;
40     assertTrue("expect the configuration" , impl != null) ;
41   }
42 }
Popular Tags