Examples of IvoryService


Examples of org.apache.ambari.server.controller.ivory.IvoryService

    verify(service);
  }

  @Test
  public void testGetKeyPropertyIds() throws Exception {
    IvoryService service = createMock(IvoryService.class);

    Map<Resource.Type, String> keyPropertyIds = PropertyHelper.getKeyPropertyIds(Resource.Type.DRTargetCluster);

    TargetClusterResourceProvider provider = new TargetClusterResourceProvider(service,
        PropertyHelper.getPropertyIds(Resource.Type.DRTargetCluster),
View Full Code Here

Examples of org.apache.ambari.server.controller.ivory.IvoryService

* Tests for FeedResourceProvider.
*/
public class FeedResourceProviderTest {
  @Test
  public void testCreateResources() throws Exception {
    IvoryService service = createMock(IvoryService.class);

    Set<Map<String, Object>> propertySet = new HashSet<Map<String, Object>>();

    Map<String, Object> properties = new HashMap<String, Object>();

    properties.put(FeedResourceProvider.FEED_NAME_PROPERTY_ID, "Feed1");
    properties.put(FeedResourceProvider.FEED_DESCRIPTION_PROPERTY_ID, "desc");
    properties.put(FeedResourceProvider.FEED_SCHEDULE_PROPERTY_ID, "sched");
    properties.put(FeedResourceProvider.FEED_STATUS_PROPERTY_ID, "SUBMITTED");
    properties.put(FeedResourceProvider.FEED_SOURCE_CLUSTER_NAME_PROPERTY_ID, "source");
    properties.put(FeedResourceProvider.FEED_TARGET_CLUSTER_NAME_PROPERTY_ID, "target");

    // set expectations
    service.submitFeed(FeedResourceProvider.getFeed("Feed1", properties));

    // replay
    replay(service);

    propertySet.add(properties);
View Full Code Here

Examples of org.apache.ambari.server.controller.ivory.IvoryService

    verify(service);
  }

  @Test
  public void testGetResources() throws Exception {
    IvoryService service = createMock(IvoryService.class);

    Set<Map<String, Object>> propertySet = new HashSet<Map<String, Object>>();

    Map<String, Object> properties = new HashMap<String, Object>();

    List<String> feedNames = new LinkedList<String>();
    feedNames.add("Feed1");
    feedNames.add("Feed2");
    feedNames.add("Feed3");

    Map<String,String> props = new HashMap<String, String>();

    Feed feed1 = new Feed("Feed1", "d", "s", "sch", "source", "st", "end", "l", "a", "target", "st", "end", "l", "a", props);
    Feed feed2 = new Feed("Feed2", "d", "s", "sch", "source", "st", "end", "l", "a", "target", "st", "end", "l", "a", props);
    Feed feed3 = new Feed("Feed3", "d", "s", "sch", "source", "st", "end", "l", "a", "target", "st", "end", "l", "a", props);

    // set expectations
    expect(service.getFeedNames()).andReturn(feedNames);

    expect(service.getFeed("Feed1")).andReturn(feed1);
    expect(service.getFeed("Feed2")).andReturn(feed2);
    expect(service.getFeed("Feed3")).andReturn(feed3);

    // replay
    replay(service);

    propertySet.add(properties);
View Full Code Here

Examples of org.apache.ambari.server.controller.ivory.IvoryService

    verify(service);
  }

  @Test
  public void testUpdateResources() throws Exception {
    IvoryService service = createMock(IvoryService.class);

    Set<Map<String, Object>> propertySet = new HashSet<Map<String, Object>>();

    Map<String, Object> properties = new HashMap<String, Object>();

    properties.put(FeedResourceProvider.FEED_NAME_PROPERTY_ID, "Feed1");
    properties.put(FeedResourceProvider.FEED_DESCRIPTION_PROPERTY_ID, "desc");
    properties.put(FeedResourceProvider.FEED_SCHEDULE_PROPERTY_ID, "sched");
    properties.put(FeedResourceProvider.FEED_STATUS_PROPERTY_ID, "WAITING");
    properties.put(FeedResourceProvider.FEED_SOURCE_CLUSTER_NAME_PROPERTY_ID, "source");
    properties.put(FeedResourceProvider.FEED_TARGET_CLUSTER_NAME_PROPERTY_ID, "target");

    List<String> feedNames = new LinkedList<String>();
    feedNames.add("Feed1");

    Map<String,String> props = new HashMap<String, String>();

    Feed feed1 = new Feed("Feed1", "desc", "WAITING", "sched", "source", "st", "end", "l", "a", "target", "st", "end", "l", "a", props);

    // set expectations
    expect(service.getFeedNames()).andReturn(feedNames);

    expect(service.getFeed("Feed1")).andReturn(feed1);

    service.updateFeed(feed1);

    // replay
    replay(service);

    propertySet.add(properties);
View Full Code Here

Examples of org.apache.ambari.server.controller.ivory.IvoryService

    verify(service);
  }

  @Test
  public void testDeleteResources() throws Exception {
    IvoryService service = createMock(IvoryService.class);

    List<String> feedNames = new LinkedList<String>();
    feedNames.add("Feed1");

    Map<String,String> props = new HashMap<String, String>();

    Feed feed1 = new Feed("Feed1", "d", "s", "sch", "source", "st", "end", "l", "a", "target", "st", "end", "l", "a", props);

    // set expectations
    expect(service.getFeedNames()).andReturn(feedNames);

    expect(service.getFeed("Feed1")).andReturn(feed1);

    service.deleteFeed("Feed1");

    // replay
    replay(service);

    FeedResourceProvider provider = new FeedResourceProvider(service,
View Full Code Here

Examples of org.apache.ambari.server.controller.ivory.IvoryService

    verify(service);
  }

  @Test
  public void testGetKeyPropertyIds() throws Exception {
    IvoryService service = createMock(IvoryService.class);

    Map<Resource.Type, String> keyPropertyIds = PropertyHelper.getKeyPropertyIds(Resource.Type.DRFeed);

    FeedResourceProvider provider = new FeedResourceProvider(service,
        PropertyHelper.getPropertyIds(Resource.Type.DRFeed),
View Full Code Here

Examples of org.apache.ambari.server.controller.ivory.IvoryService

    propertyIds.add("cat4/sub2/sub3/bat");
    propertyIds.add("cat5/subcat5/map");

    Map<Resource.Type, String> keyPropertyIds = new HashMap<Resource.Type, String>();

    IvoryService ivoryService = createMock(IvoryService.class);

    AbstractResourceProvider provider =
        (AbstractResourceProvider) AbstractDRResourceProvider.getResourceProvider(
            Resource.Type.DRFeed,
            propertyIds,
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.