Package org.exoplatform.container.xml

Examples of org.exoplatform.container.xml.InitParams


      URL propertiesURL = TestPropertyManagerConfigurator.class.getResource("property-configurator.properties");
      assertNotNull(propertiesURL);
      System.setProperty(PropertyManager.PROPERTIES_URL, propertiesURL.toString());
      System.setProperty("property_2", "property_value_2");
      PropertiesParam propertiesParam = new PropertiesParam();
      InitParams params = new InitParams();
      params.put("properties", propertiesParam);
      new PropertyConfigurator(params, new ConfigurationManagerImpl(new HashSet<String>()));
      Map<String, String> additions = reset();
      assertEquals("property_value_1", additions.get("property_1"));
      assertEquals("property_value_2", additions.get("property_2"));
      assertEquals("${property_3}", additions.get("property_3"));
View Full Code Here


   private List getCollection(String... profiles)
      throws Exception
   {
      RootContainer config = getKernel("collection-configuration.xml", profiles);
      InitParamsHolder holder = (InitParamsHolder)config.getComponentInstanceOfType(InitParamsHolder.class);
      InitParams params = holder.getParams();
      ObjectParameter op = params.getObjectParam("test.configuration");
      ConfigParam cp = (ConfigParam)op.getObject();
      return cp.getRole();
   }
View Full Code Here

   private List getCollection(String... profiles)
      throws Exception
   {
      RootContainer config = getKernel("field-configuration.xml", profiles);
      InitParamsHolder holder = (InitParamsHolder)config.getComponentInstanceOfType(InitParamsHolder.class);
      InitParams params = holder.getParams();
      ObjectParameter op = params.getObjectParam("test.configuration");
      ConfigParam cp = (ConfigParam)op.getObject();
      return cp.getRole();
   }
View Full Code Here

   public void testNoProfile() throws Exception
   {
      Configuration config = getConfiguration("init-param-configuration.xml");
      Component component = config.getComponent("Component");
      InitParams initParams = component.getInitParams();
      ValueParam valueParam = initParams.getValueParam("param");
      assertEquals("empty", valueParam.getValue());
   }
View Full Code Here

   public void testFooProfile() throws Exception
   {
      Configuration config = getConfiguration("init-param-configuration.xml", "foo");
      Component component = config.getComponent("Component");
      InitParams initParams = component.getInitParams();
      ValueParam valueParam = initParams.getValueParam("param");
      assertEquals("foo", valueParam.getValue());
   }
View Full Code Here

   public void testFooBarProfiles() throws Exception
   {
      Configuration config = getConfiguration("init-param-configuration.xml", "foo", "bar");
      Component component = config.getComponent("Component");
      InitParams initParams = component.getInitParams();
      ValueParam valueParam = initParams.getValueParam("param");
      assertEquals("bar", valueParam.getValue());
   }
View Full Code Here

      }
   }

   public void testCacheFactory() throws Exception
   {
      InitParams params = new InitParams();
      ObjectParameter param = new ObjectParameter();
      param.setName("NoImpl");
      ExoCacheConfig config = new ExoCacheConfig();
      config.setName(param.getName());
      param.setObject(config);
      params.addParameter(param);

      param = new ObjectParameter();
      param.setName("KnownImpl");
      config = new ExoCacheConfig();
      config.setName(param.getName());
      config.setImplementation("org.exoplatform.services.cache.concurrent.ConcurrentFIFOExoCache");
      param.setObject(config);
      params.addParameter(param);

      param = new ObjectParameter();
      param.setName("UnKnownImpl");
      config = new ExoCacheConfig();
      config.setName(param.getName());
      config.setImplementation("fakeImpl");
      param.setObject(config);
      params.addParameter(param);

      param = new ObjectParameter();
      param.setName("UnKnownImplButCorrectFQN");
      config = new ExoCacheConfig();
      config.setName(param.getName());
      config.setImplementation("java.lang.String");
      param.setObject(config);
      params.addParameter(param);

      param = new ObjectParameter();
      param.setName("NoImpl-MyExoCacheConfig");
      config = new MyExoCacheConfig();
      config.setName(param.getName());
      param.setObject(config);
      params.addParameter(param);

      param = new ObjectParameter();
      param.setName("KnownImpl-MyExoCacheConfig");
      config = new MyExoCacheConfig();
      config.setName(param.getName());
      config.setImplementation("org.exoplatform.services.cache.FIFOExoCache");
      param.setObject(config);
      params.addParameter(param);

      param = new ObjectParameter();
      param.setName("UnKnownImpl-MyExoCacheConfig");
      config = new MyExoCacheConfig();
      config.setName(param.getName());
      config.setImplementation("fakeImpl");
      param.setObject(config);
      params.addParameter(param);

      param = new ObjectParameter();
      param.setName("UnKnownImplButCorrectFQN-MyExoCacheConfig");
      config = new MyExoCacheConfig();
      config.setName(param.getName());
      config.setImplementation("java.lang.String");
      param.setObject(config);
      params.addParameter(param);

      CacheService cs = new CacheServiceImpl(params, new MyExoCacheFactory());
      assertTrue("Expected type MyExoCache found " + cs.getCacheInstance("NoImpl").getClass(),
         cs.getCacheInstance("NoImpl") instanceof MyExoCache);
      assertTrue("Expected type ConcurrentFIFOExoCache found " + cs.getCacheInstance("KnownImpl").getClass(),
View Full Code Here

   protected ExtendedBackupManager getJCRBackupManager()
   {
      if (backup == null)
      {
         InitParams initParams = new InitParams();
         PropertiesParam pps = new PropertiesParam();
         pps.setProperty(BackupManagerImpl.FULL_BACKUP_TYPE,
            "org.exoplatform.services.jcr.ext.backup.impl.fs.FullBackupJob");
         pps.setProperty(BackupManagerImpl.INCREMENTAL_BACKUP_TYPE,
            "org.exoplatform.services.jcr.ext.backup.impl.fs.IncrementalBackupJob");
         pps.setProperty(BackupManagerImpl.BACKUP_DIR, "target/backup");
         pps.setProperty(BackupManagerImpl.DEFAULT_INCREMENTAL_JOB_PERIOD, "3600");

         initParams.put(BackupManagerImpl.BACKUP_PROPERTIES, pps);

         BackupManagerImpl backup = new BackupManagerImpl(initParams, repositoryService);
         backup.start();

         return backup;
View Full Code Here

   protected ExtendedBackupManager getRDBMSBackupManager()
   {
      if (backup == null)
      {
         InitParams initParams = new InitParams();
         PropertiesParam pps = new PropertiesParam();
         pps.setProperty(BackupManagerImpl.FULL_BACKUP_TYPE,
            "org.exoplatform.services.jcr.ext.backup.impl.rdbms.FullBackupJob");
         pps.setProperty(BackupManagerImpl.INCREMENTAL_BACKUP_TYPE,
            "org.exoplatform.services.jcr.ext.backup.impl.fs.IncrementalBackupJob");
         pps.setProperty(BackupManagerImpl.BACKUP_DIR, "target/backup");
         pps.setProperty(BackupManagerImpl.DEFAULT_INCREMENTAL_JOB_PERIOD, "3600");

         initParams.put(BackupManagerImpl.BACKUP_PROPERTIES, pps);

         BackupManagerImpl backup = new BackupManagerImpl(initParams, repositoryService);
         backup.start();

         return backup;
View Full Code Here

            "/test,/exo:test1", true, null, "nt:base", null);
      List actionsList = new ArrayList();
      ActionsConfig actions = new ActionsConfig();
      actions.setActions(actionsList);
      actionsList.add(ac);
      InitParams params = new InitParams();
      ObjectParameter op = new ObjectParameter();
      op.setObject(actions);
      op.setName("actions");
      params.addParameter(op);
      AddActionsPlugin aap = new AddActionsPlugin(params);

      SessionActionCatalog catalog =
         (SessionActionCatalog)container.getComponentInstanceOfType(SessionActionCatalog.class);
      catalog.clear();
View Full Code Here

TOP

Related Classes of org.exoplatform.container.xml.InitParams

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.