Package org.apache.ambari.server.controller.spi

Examples of org.apache.ambari.server.controller.spi.SchemaFactory


*/
public class DefaultRendererTest {

  @Test
  public void testFinalizeProperties__instance_noProperties() {
    SchemaFactory schemaFactory = createNiceMock(SchemaFactory.class);
    Schema schema = createNiceMock(Schema.class);

    // schema expectations
    expect(schemaFactory.getSchema(Resource.Type.Component)).andReturn(schema).anyTimes();
    expect(schema.getKeyPropertyId(Resource.Type.Component)).andReturn("ServiceComponentInfo/component_name").anyTimes();
    expect(schema.getKeyPropertyId(Resource.Type.Service)).andReturn("ServiceComponentInfo/service_name").anyTimes();

    replay(schemaFactory, schema);

View Full Code Here


    verify(schemaFactory, schema);
  }

  @Test
  public void testFinalizeProperties__instance_properties() {
    SchemaFactory schemaFactory = createNiceMock(SchemaFactory.class);
    Schema schema = createNiceMock(Schema.class);

    // schema expectations
    expect(schemaFactory.getSchema(Resource.Type.Service)).andReturn(schema).anyTimes();
    expect(schema.getKeyPropertyId(Resource.Type.Service)).andReturn("ServiceInfo/service_name").anyTimes();
    expect(schema.getKeyPropertyId(Resource.Type.Cluster)).andReturn("ServiceInfo/cluster_name").anyTimes();

    replay(schemaFactory, schema);
View Full Code Here

    verify(schemaFactory, schema);
  }

  @Test
  public void testFinalizeProperties__collection_noProperties() {
    SchemaFactory schemaFactory = createNiceMock(SchemaFactory.class);
    Schema schema = createNiceMock(Schema.class);

    // schema expectations
    expect(schemaFactory.getSchema(Resource.Type.Service)).andReturn(schema).anyTimes();
    expect(schema.getKeyPropertyId(Resource.Type.Service)).andReturn("ServiceInfo/service_name").anyTimes();
    expect(schema.getKeyPropertyId(Resource.Type.Cluster)).andReturn("ServiceInfo/cluster_name").anyTimes();

    replay(schemaFactory, schema);
View Full Code Here

    verify(schemaFactory, schema);
  }

  @Test
  public void testFinalizeProperties__collection_properties() {
    SchemaFactory schemaFactory = createNiceMock(SchemaFactory.class);
    Schema schema = createNiceMock(Schema.class);

    // schema expectations
    expect(schemaFactory.getSchema(Resource.Type.Service)).andReturn(schema).anyTimes();
    expect(schema.getKeyPropertyId(Resource.Type.Service)).andReturn("ServiceInfo/service_name").anyTimes();
    expect(schema.getKeyPropertyId(Resource.Type.Cluster)).andReturn("ServiceInfo/cluster_name").anyTimes();

    replay(schemaFactory, schema);
View Full Code Here

    verify(schemaFactory, schema);
  }

  @Test
  public void testFinalizeProperties__instance_subResource_noProperties() {
    SchemaFactory schemaFactory = createNiceMock(SchemaFactory.class);
    Schema serviceSchema = createNiceMock(Schema.class);
    Schema componentSchema = createNiceMock(Schema.class);

    // schema expectations
    expect(schemaFactory.getSchema(Resource.Type.Service)).andReturn(serviceSchema).anyTimes();
    expect(serviceSchema.getKeyPropertyId(Resource.Type.Service)).andReturn("ServiceInfo/service_name").anyTimes();
    expect(serviceSchema.getKeyPropertyId(Resource.Type.Cluster)).andReturn("ServiceInfo/cluster_name").anyTimes();
    expect(schemaFactory.getSchema(Resource.Type.Component)).andReturn(componentSchema).anyTimes();
    expect(componentSchema.getKeyPropertyId(Resource.Type.Service)).andReturn("ServiceComponentInfo/service_name").anyTimes();
    expect(componentSchema.getKeyPropertyId(Resource.Type.Component)).andReturn("ServiceComponentInfo/component_name").anyTimes();

    replay(schemaFactory, serviceSchema, componentSchema);
View Full Code Here

    verify(schemaFactory, serviceSchema, componentSchema);
  }

  @Test
  public void testFinalizeProperties__instance_subResource_properties() {
    SchemaFactory schemaFactory = createNiceMock(SchemaFactory.class);
    Schema serviceSchema = createNiceMock(Schema.class);
    Schema componentSchema = createNiceMock(Schema.class);

    // schema expectations
    expect(schemaFactory.getSchema(Resource.Type.Service)).andReturn(serviceSchema).anyTimes();
    expect(serviceSchema.getKeyPropertyId(Resource.Type.Service)).andReturn("ServiceInfo/service_name").anyTimes();
    expect(serviceSchema.getKeyPropertyId(Resource.Type.Cluster)).andReturn("ServiceInfo/cluster_name").anyTimes();
    expect(schemaFactory.getSchema(Resource.Type.Component)).andReturn(componentSchema).anyTimes();
    expect(componentSchema.getKeyPropertyId(Resource.Type.Service)).andReturn("ServiceComponentInfo/service_name").anyTimes();
    expect(componentSchema.getKeyPropertyId(Resource.Type.Component)).andReturn("ServiceComponentInfo/component_name").anyTimes();

    replay(schemaFactory, serviceSchema, componentSchema);
View Full Code Here

    verify(schemaFactory, serviceSchema, componentSchema);
  }

  @Test
  public void testFinalizeProperties__collection_subResource_noProperties() {
    SchemaFactory schemaFactory = createNiceMock(SchemaFactory.class);
    Schema serviceSchema = createNiceMock(Schema.class);
    Schema componentSchema = createNiceMock(Schema.class);

    // schema expectations
    expect(schemaFactory.getSchema(Resource.Type.Service)).andReturn(serviceSchema).anyTimes();
    expect(serviceSchema.getKeyPropertyId(Resource.Type.Service)).andReturn("ServiceInfo/service_name").anyTimes();
    expect(serviceSchema.getKeyPropertyId(Resource.Type.Cluster)).andReturn("ServiceInfo/cluster_name").anyTimes();
    expect(schemaFactory.getSchema(Resource.Type.Component)).andReturn(componentSchema).anyTimes();
    expect(componentSchema.getKeyPropertyId(Resource.Type.Service)).andReturn("ServiceComponentInfo/service_name").anyTimes();
    expect(componentSchema.getKeyPropertyId(Resource.Type.Component)).andReturn("ServiceComponentInfo/component_name").anyTimes();

    replay(schemaFactory, serviceSchema, componentSchema);
View Full Code Here

    verify(schemaFactory, serviceSchema, componentSchema);
  }

  @Test
  public void testFinalizeProperties__collection_subResource_propertiesTopLevelOnly() {
    SchemaFactory schemaFactory = createNiceMock(SchemaFactory.class);
    Schema serviceSchema = createNiceMock(Schema.class);
    Schema componentSchema = createNiceMock(Schema.class);

    // schema expectations
    expect(schemaFactory.getSchema(Resource.Type.Service)).andReturn(serviceSchema).anyTimes();
    expect(serviceSchema.getKeyPropertyId(Resource.Type.Service)).andReturn("ServiceInfo/service_name").anyTimes();
    expect(serviceSchema.getKeyPropertyId(Resource.Type.Cluster)).andReturn("ServiceInfo/cluster_name").anyTimes();
    expect(schemaFactory.getSchema(Resource.Type.Component)).andReturn(componentSchema).anyTimes();
    expect(componentSchema.getKeyPropertyId(Resource.Type.Service)).andReturn("ServiceComponentInfo/service_name").anyTimes();
    expect(componentSchema.getKeyPropertyId(Resource.Type.Component)).andReturn("ServiceComponentInfo/component_name").anyTimes();

    replay(schemaFactory, serviceSchema, componentSchema);
View Full Code Here

TOP

Related Classes of org.apache.ambari.server.controller.spi.SchemaFactory

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.