コード例 #1
0
ファイル: TestRSSService.java プロジェクト: hailt/ecms
 /** 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();
 }
コード例 #2
0
ファイル: TestTaxonomyService.java プロジェクト: hailt/ecms
 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();
 }
コード例 #3
0
ファイル: TestTaxonomyService.java プロジェクト: hailt/ecms
 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);
 }
コード例 #4
0
ファイル: TestFavoriteService.java プロジェクト: hailt/ecms
  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();
      }
  }
コード例 #5
0
ファイル: TestRSSService.java プロジェクト: hailt/ecms
 public void setUp() throws Exception {
   super.setUp();
   rssService = (RSSService) container.getComponentInstanceOfType(RSSService.class);
 }