Package org.exoplatform.services.jcr.util

Examples of org.exoplatform.services.jcr.util.TesterConfigurationHelper


    * We have A/B moved to C/B without generation events for B.
    * Will checked if B reloaded its data.
    */
   public void testMoveWithoutGenerationChangesForAllSubTree() throws Exception
   {
      TesterConfigurationHelper helper = TesterConfigurationHelper.getInstance();
      WorkspaceEntry wsEntry = helper.createWorkspaceEntry(DatabaseStructureType.MULTI, null);
      wsEntry.getContainer().getParameters()
         .add(new SimpleParameterEntry(WorkspaceDataContainer.TRIGGER_EVENTS_FOR_DESCENDENTS_ON_RENAME, "false"));

      ManageableRepository repository = helper.createRepository(container, DatabaseStructureType.MULTI, null);
      helper.addWorkspace(repository, wsEntry);

      SessionImpl session = (SessionImpl)repository.login(credentials, wsEntry.getName());

      Node nodeA = session.getRootNode().addNode("A");
      Node nodeB = nodeA.addNode("B");
View Full Code Here


   }

   private String createWs() throws Exception
   {
      TesterConfigurationHelper helper = TesterConfigurationHelper.getInstance();
      WorkspaceEntry wsEntry = (WorkspaceEntry)session.getContainer().getComponentInstanceOfType(WorkspaceEntry.class);
      boolean isDefaultWsMultiDb = false;
      if ("true".equals(wsEntry.getContainer().getParameterValue("multi-db")))
      {
         isDefaultWsMultiDb = true;
      }
      WorkspaceEntry workspaceEntry =
         helper.createWorkspaceEntry(isDefaultWsMultiDb,
            wsEntry.getContainer().getParameterValue(JDBCWorkspaceDataContainer.SOURCE_NAME));

      return workspaceEntry.getName();
   }
View Full Code Here

      if (bch != null)
      {
         backupManagerImpl.stopBackup(bch);
      }
     
      TesterConfigurationHelper helper = TesterConfigurationHelper.getInstance();
      RepositoryEntry repositoryEntryIsolated = helper.copyRepositoryEntry(repositoryService.getRepository(repositoryName).getConfiguration());
     
      for (WorkspaceEntry we : repositoryEntryIsolated.getWorkspaceEntries())
      {
         List<SimpleParameterEntry> props = we.getContainer().getParameters();
        
         for (int i = 0; i < props.size(); i++)
         {
            SimpleParameterEntry spe = props.get(i);
           
            if (spe.getName().equals(JDBCWorkspaceDataContainer.DB_STRUCTURE_TYPE))
            {
              props.set(i, new SimpleParameterEntry(spe.getName(), DatabaseStructureType.ISOLATED.toString()));
              break;
            }
         }
      }
     
      // restore single backup on structure single to isolated
      {
         RepositoryEntry newRE = helper.copyRepositoryEntry(repositoryEntryIsolated);
  
         File backLog = new File(bch.getLogFilePath());
         assertTrue(backLog.exists());
         RepositoryBackupChainLog bchLog = new RepositoryBackupChainLog(backLog);
        
         backupManagerImpl.restoreExistingRepository(bchLog, newRE, false);
         checkConent(newRE.getName());
        
         String dbStructureType = repositoryService.getRepository(repositoryName).getConfiguration().getWorkspaceEntries().get(0).getContainer().getParameterValue(JDBCWorkspaceDataContainer.DB_STRUCTURE_TYPE);
         assertTrue(DatabaseStructureType.ISOLATED.toString().equalsIgnoreCase(dbStructureType));
      }
     
     
      // restore  single backup on structure isolated to isolated
      {
         RepositoryEntry newRE = helper.copyRepositoryEntry(repositoryEntryIsolated);
  
         File backLog = new File(bch.getLogFilePath());
         assertTrue(backLog.exists());
  
         RepositoryBackupChainLog bchLog = new RepositoryBackupChainLog(backLog);
View Full Code Here

      if (bch != null)
      {
         backupManagerImpl.stopBackup(bch);
      }
     
      TesterConfigurationHelper helper = TesterConfigurationHelper.getInstance();
      RepositoryEntry repositoryEntryIsolated = helper.copyRepositoryEntry(repositoryService.getRepository(repositoryName).getConfiguration());
     
      for (WorkspaceEntry we : repositoryEntryIsolated.getWorkspaceEntries())
      {
         List<SimpleParameterEntry> props = we.getContainer().getParameters();
        
         for (int i = 0; i < props.size(); i++)
         {
            SimpleParameterEntry spe = props.get(i);
           
            if (spe.getName().equals(JDBCWorkspaceDataContainer.DB_STRUCTURE_TYPE))
            {
              props.set(i, new SimpleParameterEntry(spe.getName(), DatabaseStructureType.ISOLATED.toString()));
              break;
            }
         }
      }
     
      // restore single backup on structure single to isolated
      {
         RepositoryEntry newRE = helper.copyRepositoryEntry(repositoryEntryIsolated);
  
         File backLog = new File(bch.getLogFilePath());
         assertTrue(backLog.exists());
         RepositoryBackupChainLog bchLog = new RepositoryBackupChainLog(backLog);
        
         backupManagerImpl.restoreExistingRepository(bchLog, newRE, false);
         checkConent(newRE.getName());
        
         String dbStructureType = repositoryService.getRepository(repositoryName).getConfiguration().getWorkspaceEntries().get(0).getContainer().getParameterValue(JDBCWorkspaceDataContainer.DB_STRUCTURE_TYPE);
         assertTrue(DatabaseStructureType.ISOLATED.toString().equalsIgnoreCase(dbStructureType));
      }
     
     
      // restore  single backup on structure isolated to isolated
      {
         RepositoryEntry newRE = helper.copyRepositoryEntry(repositoryEntryIsolated);
  
         File backLog = new File(bch.getLogFilePath());
         assertTrue(backLog.exists());
  
         RepositoryBackupChainLog bchLog = new RepositoryBackupChainLog(backLog);
View Full Code Here

   }

   private String createWs() throws Exception
   {
      TesterConfigurationHelper helper = TesterConfigurationHelper.getInstance();
      WorkspaceEntry wsEntry = (WorkspaceEntry)session.getContainer().getComponentInstanceOfType(WorkspaceEntry.class);
    DatabaseStructureType dbStructureType = DatabaseStructureType
        .valueOf(wsEntry.getContainer().getParameterValue(
            JDBCWorkspaceDataContainer.DB_STRUCTURE_TYPE));
      WorkspaceEntry workspaceEntry =
         helper.createWorkspaceEntry(dbStructureType,
            wsEntry.getContainer().getParameterValue(JDBCWorkspaceDataContainer.SOURCE_NAME));

      return workspaceEntry.getName();
   }
View Full Code Here

    * We have A/B moved to C/B without generation events for B.
    * Will checked if B reloaded its data.
    */
   public void testMoveWithoutGenerationChangesForAllSubTree() throws Exception
   {
      TesterConfigurationHelper helper = TesterConfigurationHelper.getInstance();
      WorkspaceEntry wsEntry = helper.createWorkspaceEntry(DatabaseStructureType.MULTI, null);
      wsEntry.getContainer().getParameters()
         .add(new SimpleParameterEntry(WorkspaceDataContainer.TRIGGER_EVENTS_FOR_DESCENDANTS_ON_RENAME, "false"));

      ManageableRepository repository = helper.createRepository(container, DatabaseStructureType.MULTI, null);
      helper.addWorkspace(repository, wsEntry);

      testMoveForAllSubTree(wsEntry, repository);
   }
View Full Code Here

    * We have A/B moved to C/B without generation events for B.
    * Will checked if B reloaded its data.
    */
   public void testMoveWithoutGenerationChangesForAllSubTreeBadSpelled() throws Exception
   {
      TesterConfigurationHelper helper = TesterConfigurationHelper.getInstance();
      WorkspaceEntry wsEntry = helper.createWorkspaceEntry(DatabaseStructureType.MULTI, null);
      wsEntry.getContainer().getParameters()
         .add(new SimpleParameterEntry(WorkspaceDataContainer.TRIGGER_EVENTS_FOR_DESCENDENTS_ON_RENAME, "false"));

      ManageableRepository repository = helper.createRepository(container, DatabaseStructureType.MULTI, null);
      helper.addWorkspace(repository, wsEntry);

      testMoveForAllSubTree(wsEntry, repository);
   }
View Full Code Here

    * We have A/B moved to C/B without generation events for B.
    * Will checked if B reloaded its data.
    */
   public void testMoveWithoutGenerationChangesForAllSubTreeWithMaxDescParam() throws Exception
   {
      TesterConfigurationHelper helper = TesterConfigurationHelper.getInstance();
      WorkspaceEntry wsEntry = helper.createWorkspaceEntry(DatabaseStructureType.MULTI, null);
      wsEntry.getContainer().getParameters()
         .add(new SimpleParameterEntry(WorkspaceDataContainer.MAX_DESCENDANTS_NODES_ALLOWED_ON_MOVE, "2"));

      ManageableRepository repository = helper.createRepository(container, DatabaseStructureType.MULTI, null);
      helper.addWorkspace(repository, wsEntry);

      testMoveForAllSubTree(wsEntry, repository);
   }
View Full Code Here

    * We have A/B moved to C/B without generation events for B.
    * Will checked if B reloaded its data.
    */
   public void testMoveWithoutGenerationChangesForAllSubTreeWithMoveParam() throws Exception
   {
      TesterConfigurationHelper helper = TesterConfigurationHelper.getInstance();
      WorkspaceEntry wsEntry = helper.createWorkspaceEntry(DatabaseStructureType.MULTI, null);
      wsEntry.getContainer().getParameters()
         .add(new SimpleParameterEntry(WorkspaceDataContainer.TRIGGER_EVENTS_FOR_DESCENDANTS_ON_MOVE, "false"));

      ManageableRepository repository = helper.createRepository(container, DatabaseStructureType.MULTI, null);
      helper.addWorkspace(repository, wsEntry);

      testMoveForAllSubTree(wsEntry, repository);
   }
View Full Code Here

      if (bch != null)
      {
         backupManagerImpl.stopBackup(bch);
      }
     
      TesterConfigurationHelper helper = TesterConfigurationHelper.getInstance();
      RepositoryEntry repositoryEntryIsolated = helper.copyRepositoryEntry(repositoryService.getRepository(repositoryName).getConfiguration());
     
      for (WorkspaceEntry we : repositoryEntryIsolated.getWorkspaceEntries())
      {
         List<SimpleParameterEntry> props = we.getContainer().getParameters();
        
         for (int i = 0; i < props.size(); i++)
         {
            SimpleParameterEntry spe = props.get(i);
           
            if (spe.getName().equals(JDBCWorkspaceDataContainer.DB_STRUCTURE_TYPE))
            {
              props.set(i, new SimpleParameterEntry(spe.getName(), DatabaseStructureType.ISOLATED.toString()));
              break;
            }
         }
      }
     
      // restore single backup on structure single to isolated
      {
         RepositoryEntry newRE = helper.copyRepositoryEntry(repositoryEntryIsolated);
  
         File backLog = new File(bch.getLogFilePath());
         assertTrue(backLog.exists());
         RepositoryBackupChainLog bchLog = new RepositoryBackupChainLog(backLog);
        
         backupManagerImpl.restoreExistingRepository(bchLog, newRE, false);
         checkConent(newRE.getName());
        
         String dbStructureType = repositoryService.getRepository(repositoryName).getConfiguration().getWorkspaceEntries().get(0).getContainer().getParameterValue(JDBCWorkspaceDataContainer.DB_STRUCTURE_TYPE);
         assertTrue(DatabaseStructureType.ISOLATED.toString().equalsIgnoreCase(dbStructureType));
      }
     
     
      // restore  single backup on structure isolated to isolated
      {
         RepositoryEntry newRE = helper.copyRepositoryEntry(repositoryEntryIsolated);
  
         File backLog = new File(bch.getLogFilePath());
         assertTrue(backLog.exists());
  
         RepositoryBackupChainLog bchLog = new RepositoryBackupChainLog(backLog);
View Full Code Here

TOP

Related Classes of org.exoplatform.services.jcr.util.TesterConfigurationHelper

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.