Package org.apache.ambari.server.view.configuration

Examples of org.apache.ambari.server.view.configuration.InstanceConfig


    Assert.assertEquals(viewDefinition, viewInstanceDefinition.getViewEntity());
  }

  @Test
  public void testGetConfiguration() throws Exception {
    InstanceConfig instanceConfig = InstanceConfigTest.getInstanceConfigs().get(0);
    ViewEntity viewDefinition = ViewEntityTest.getViewEntity();
    ViewInstanceEntity viewInstanceDefinition = new ViewInstanceEntity(viewDefinition, instanceConfig);

    Assert.assertEquals(instanceConfig, viewInstanceDefinition.getConfiguration());
  }
View Full Code Here


  }

  @Test
  public void testGetLabel() throws Exception {
    // with an instance label
    InstanceConfig instanceConfig = InstanceConfigTest.getInstanceConfigs(xml_with_instance_label).get(0);
    ViewEntity viewDefinition = ViewEntityTest.getViewEntity();
    ViewInstanceEntity viewInstanceDefinition = new ViewInstanceEntity(viewDefinition, instanceConfig);

    Assert.assertEquals("My Instance 1!", viewInstanceDefinition.getLabel());
View Full Code Here

    Assert.assertEquals("My View!", viewInstanceDefinition.getLabel());
  }

  @Test
  public void testGetDescription() throws Exception {
    InstanceConfig instanceConfig = InstanceConfigTest.getInstanceConfigs(xml_with_instance_label).get(0);
    ViewEntity viewDefinition = ViewEntityTest.getViewEntity();
    ViewInstanceEntity viewInstanceDefinition = new ViewInstanceEntity(viewDefinition, instanceConfig);

    Assert.assertEquals("This is an instance description.", viewInstanceDefinition.getDescription());
View Full Code Here

    Assert.assertNull(viewInstanceDefinition.getDescription());
  }

  @Test
  public void testIsVisible() throws Exception {
    InstanceConfig instanceConfig = InstanceConfigTest.getInstanceConfigs(xml_with_instance_label).get(0);
    ViewEntity viewDefinition = ViewEntityTest.getViewEntity();
    ViewInstanceEntity viewInstanceDefinition = new ViewInstanceEntity(viewDefinition, instanceConfig);

    Assert.assertTrue(viewInstanceDefinition.isVisible());
View Full Code Here

    Assert.assertTrue(viewInstanceDefinition.isVisible());
  }

  @Test
  public void testGetIcon() throws Exception {
    InstanceConfig instanceConfig = InstanceConfigTest.getInstanceConfigs(xml_with_instance_label).get(0);
    ViewEntity viewDefinition = ViewEntityTest.getViewEntity();
    ViewInstanceEntity viewInstanceDefinition = new ViewInstanceEntity(viewDefinition, instanceConfig);
    Assert.assertEquals("/this/is/the/icon/url/instance_1_icon.png", viewInstanceDefinition.getIcon());

    viewInstanceDefinition.setIcon("/a/different/icon.png");
View Full Code Here

    Assert.assertEquals("/this/is/the/icon/url/icon.png", viewInstanceDefinition.getIcon());
  }

  @Test
  public void testGetIcon64() throws Exception {
    InstanceConfig instanceConfig = InstanceConfigTest.getInstanceConfigs(xml_with_instance_label).get(0);
    ViewEntity viewDefinition = ViewEntityTest.getViewEntity();
    ViewInstanceEntity viewInstanceDefinition = new ViewInstanceEntity(viewDefinition, instanceConfig);
    Assert.assertEquals("/this/is/the/icon/url/instance_1_icon64.png", viewInstanceDefinition.getIcon64());

    viewInstanceDefinition.setIcon64("/a/different/icon.png");
View Full Code Here

    Assert.assertEquals("monkey", dataMap.get("key4"));
    Assert.assertEquals("runner", dataMap.get("key5"));
  }

  public static ViewInstanceEntity getViewInstanceEntity() throws Exception {
    InstanceConfig instanceConfig = InstanceConfigTest.getInstanceConfigs().get(0);
    ViewEntity viewDefinition = ViewEntityTest.getViewEntity();
    return new ViewInstanceEntity(viewDefinition, instanceConfig);
  }
View Full Code Here

  }

  public static Set<ViewInstanceEntity> getViewInstanceEntities(ViewEntity viewDefinition) throws Exception {
    Set<ViewInstanceEntity> entities = new HashSet<ViewInstanceEntity>();

    InstanceConfig instanceConfig = InstanceConfigTest.getInstanceConfigs().get(0);
    entities.add(new ViewInstanceEntity(viewDefinition, instanceConfig));
    instanceConfig = InstanceConfigTest.getInstanceConfigs().get(1);
    entities.add(new ViewInstanceEntity(viewDefinition, instanceConfig));

    return entities;
View Full Code Here

                                     SchemaManager schemaManager)
      throws Exception {
    ViewConfig viewConfig = ViewConfigTest.getConfig(xml);
    ViewEntity viewDefinition = ViewEntityTest.getViewEntity(viewConfig);

    InstanceConfig instanceConfig = InstanceConfigTest.getInstanceConfigs().get(0);
    ViewInstanceEntity viewInstanceEntity = new ViewInstanceEntity(viewDefinition, instanceConfig);

    setPersistenceEntities(viewInstanceEntity);

    Injector injector = Guice.createInjector(
View Full Code Here

  @Test
  public void testAddInstanceDefinition() throws Exception {
    ViewRegistry registry = ViewRegistry.getInstance();

    ViewEntity viewEntity = ViewEntityTest.getViewEntity();
    InstanceConfig instanceConfig = InstanceConfigTest.getInstanceConfigs().get(0);

    ViewInstanceEntity viewInstanceEntity = new ViewInstanceEntity(viewEntity, instanceConfig);

    registry.addDefinition(viewEntity);
    registry.addInstanceDefinition(viewEntity, viewInstanceEntity);
View Full Code Here

TOP

Related Classes of org.apache.ambari.server.view.configuration.InstanceConfig

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.