Example #1
0
 /** Clean all node for testing */
 public void tearDown() throws Exception {
   Node myRoot = session.getRootNode();
   if (myRoot.hasNode("Feeds")) {
     myRoot.getNode("Feeds").remove();
   }
   session.save();
   super.tearDown();
 }
Example #2
0
 public void tearDown() throws Exception {
   List<Node> lstNode = taxonomyService.getAllTaxonomyTrees(true);
   for (Node tree : lstNode) {
     if (!tree.getName().equals("System")) taxonomyService.removeTaxonomyTree(tree.getName());
   }
   for (String s : new String[] {"/Article", "/MyDocuments"})
     if (session.itemExists(s)) {
       session.getItem(s).remove();
       session.save();
     }
   super.tearDown();
 }
Example #3
0
 public void setUp() throws Exception {
   super.setUp();
   taxonomyService = (TaxonomyService) container.getComponentInstanceOfType(TaxonomyService.class);
   mockTaxonomyService =
       (MockTaxonomyService) container.getComponentInstanceOfType(MockTaxonomyService.class);
   dmsSesssion =
       sessionProviderService_.getSystemSessionProvider(null).getSession(DMSSYSTEM_WS, repository);
   nodeHierarchyCreator =
       (NodeHierarchyCreator) container.getComponentInstanceOfType(NodeHierarchyCreator.class);
   linkManage = (LinkManager) container.getComponentInstanceOfType(LinkManager.class);
   definitionPath = nodeHierarchyCreator.getJcrPath(BasePath.TAXONOMIES_TREE_DEFINITION_PATH);
   storagePath = nodeHierarchyCreator.getJcrPath(BasePath.TAXONOMIES_TREE_STORAGE_PATH);
 }
Example #4
0
  public void setUp() throws Exception {
    super.setUp();
    ExoContainer myContainer = ExoContainerContext.getCurrentContainer();
    favoriteService =
        (FavoriteService) myContainer.getComponentInstanceOfType(FavoriteService.class);

    SessionProviderService sessionProviderService =
        (SessionProviderService)
            myContainer.getComponentInstanceOfType(SessionProviderService.class);

    SessionProvider sessionProvider = sessionProviderService.getSystemSessionProvider(null);

    ManageableRepository manageableRepository = repositoryService.getRepository("repository");

    Session session = sessionProvider.getSession(COLLABORATION_WS, manageableRepository);
    Node rootNode = session.getRootNode();
    String[] names = new String[] {"root", "demo", "james", "john", "marry"};
    for (String name : names)
      if (rootNode.hasNode(name)) {
        rootNode.getNode(name).remove();
        rootNode.save();
      }
  }
Example #5
0
 public void setUp() throws Exception {
   super.setUp();
   rssService = (RSSService) container.getComponentInstanceOfType(RSSService.class);
 }