Package org.apache.oodt.cas.crawl.action

Examples of org.apache.oodt.cas.crawl.action.CrawlerAction


      // Test actionRepo == null.
      assertTrue(pc.performPreIngestActions(p, m));

      // Test actionRepo != null and performAction return true.
      CrawlerAction action = createMock(CrawlerAction.class);
      expect(action.getId()).andReturn("ActionId");
      expect(action.getDescription()).andReturn("Action Description");
      expect(action.performAction(p, m)).andReturn(true);
      replay(action);

      pc.actionRepo = createMock(CrawlerActionRepo.class);
      expect(pc.actionRepo.getPreIngestActions())
         .andReturn(Lists.newArrayList(action));
      replay(pc.actionRepo);

      assertTrue(pc.performPreIngestActions(p, m));
      verify(action);
      verify(pc.actionRepo);

      // Test actionRepo != null and performAction return false.
      action = createMock(CrawlerAction.class);
      expect(action.getId()).andReturn("ActionId");
      expect(action.getDescription()).andReturn("Action Description");
      expect(action.performAction(p, m)).andReturn(false);
      expect(action.getId()).andReturn("ActionId");
      expect(action.getDescription()).andReturn("Action Description");
      replay(action);

      pc.actionRepo = createMock(CrawlerActionRepo.class);
      expect(pc.actionRepo.getPreIngestActions())
         .andReturn(Lists.newArrayList(action));
View Full Code Here


      // Test actionRepo == null.
      assertTrue(pc.performPostIngestOnSuccessActions(p, m));

      // Test actionRepo != null and performAction return true.
      CrawlerAction action = createMock(CrawlerAction.class);
      expect(action.getId()).andReturn("ActionId");
      expect(action.getDescription()).andReturn("Action Description");
      expect(action.performAction(p, m)).andReturn(true);
      replay(action);

      pc.actionRepo = createMock(CrawlerActionRepo.class);
      expect(pc.actionRepo.getPostIngestOnSuccessActions())
         .andReturn(Lists.newArrayList(action));
      replay(pc.actionRepo);

      assertTrue(pc.performPostIngestOnSuccessActions(p, m));
      verify(action);
      verify(pc.actionRepo);

      // Test actionRepo != null and performAction return false.
      action = createMock(CrawlerAction.class);
      expect(action.getId()).andReturn("ActionId");
      expect(action.getDescription()).andReturn("Action Description");
      expect(action.performAction(p, m)).andReturn(false);
      expect(action.getId()).andReturn("ActionId");
      expect(action.getDescription()).andReturn("Action Description");
      replay(action);

      pc.actionRepo = createMock(CrawlerActionRepo.class);
      expect(pc.actionRepo.getPostIngestOnSuccessActions())
         .andReturn(Lists.newArrayList(action));
View Full Code Here

      // Test actionRepo == null.
      assertTrue(pc.performPostIngestOnFailActions(p, m));

      // Test actionRepo != null and performAction return true.
      CrawlerAction action = createMock(CrawlerAction.class);
      expect(action.getId()).andReturn("ActionId");
      expect(action.getDescription()).andReturn("Action Description");
      expect(action.performAction(p, m)).andReturn(true);
      replay(action);

      pc.actionRepo = createMock(CrawlerActionRepo.class);
      expect(pc.actionRepo.getPostIngestOnFailActions())
         .andReturn(Lists.newArrayList(action));
      replay(pc.actionRepo);

      assertTrue(pc.performPostIngestOnFailActions(p, m));
      verify(action);
      verify(pc.actionRepo);

      // Test actionRepo != null and performAction return false.
      action = createMock(CrawlerAction.class);
      expect(action.getId()).andReturn("ActionId");
      expect(action.getDescription()).andReturn("Action Description");
      expect(action.performAction(p, m)).andReturn(false);
      expect(action.getId()).andReturn("ActionId");
      expect(action.getDescription()).andReturn("Action Description");
      replay(action);

      pc.actionRepo = createMock(CrawlerActionRepo.class);
      expect(pc.actionRepo.getPostIngestOnFailActions())
         .andReturn(Lists.newArrayList(action));
View Full Code Here

      // Test no actions.
      assertTrue(pc.performProductCrawlerActions(
            Collections.<CrawlerAction>emptyList(), p, m));

      // Test 1 action pass.
      CrawlerAction action = createMock(CrawlerAction.class);
      expect(action.getId()).andReturn("ActionId");
      expect(action.getDescription()).andReturn("Action Description");
      expect(action.performAction(p, m)).andReturn(true);
      replay(action);
      assertTrue(pc.performProductCrawlerActions(
            Lists.newArrayList(action), p, m));
      verify(action);

      // Test 1 action fail.
      action = createMock(CrawlerAction.class);
      expect(action.getId()).andReturn("ActionId");
      expect(action.getDescription()).andReturn("Action Description");
      expect(action.performAction(p, m)).andReturn(false);
      expect(action.getId()).andReturn("ActionId");
      expect(action.getDescription()).andReturn("Action Description");
      replay(action);
      assertFalse(pc.performProductCrawlerActions(
            Lists.newArrayList(action), p, m));
      verify(action);

      // Test 1 action pass and 1 action fail.
      CrawlerAction passAction = createMock(CrawlerAction.class);
      expect(passAction.getId()).andReturn("ActionId");
      expect(passAction.getDescription()).andReturn("Action Description");
      expect(passAction.performAction(p, m)).andReturn(true);
      replay(passAction);
      CrawlerAction failAction = createMock(CrawlerAction.class);
      expect(failAction.getId()).andReturn("ActionId");
      expect(failAction.getDescription()).andReturn("Action Description");
      expect(failAction.performAction(p, m)).andReturn(false);
      expect(failAction.getId()).andReturn("ActionId");
      expect(failAction.getDescription()).andReturn("Action Description");
      replay(failAction);
      assertFalse(pc.performProductCrawlerActions(
            Lists.newArrayList(passAction, failAction), p, m));
      verify(passAction);
      verify(failAction);
View Full Code Here

TOP

Related Classes of org.apache.oodt.cas.crawl.action.CrawlerAction

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.