Package org.apache.ambari.server.api.query

Examples of org.apache.ambari.server.api.query.QueryInfo


    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);

    QueryInfo rootQuery = new QueryInfo(new ServiceResourceDefinition(), new HashSet<String>());
    TreeNode<QueryInfo> queryTree = new TreeNodeImpl<QueryInfo>(null, rootQuery, "Service");

    DefaultRenderer renderer = new DefaultRenderer();
    renderer.init(schemaFactory);
    TreeNode<Set<String>> propertyTree = renderer.finalizeProperties(queryTree, false);
View Full Code Here


    replay(schemaFactory, schema);

    HashSet<String> serviceProperties = new HashSet<String>();
    serviceProperties.add("foo/bar");
    QueryInfo rootQuery = new QueryInfo(new ServiceResourceDefinition(), serviceProperties);
    TreeNode<QueryInfo> queryTree = new TreeNodeImpl<QueryInfo>(null, rootQuery, "Service");

    DefaultRenderer renderer = new DefaultRenderer();
    renderer.init(schemaFactory);
    TreeNode<Set<String>> propertyTree = renderer.finalizeProperties(queryTree, false);
View Full Code Here

    expect(schema.getKeyPropertyId(Resource.Type.Cluster)).andReturn("ServiceInfo/cluster_name").anyTimes();

    replay(schemaFactory, schema);

    HashSet<String> serviceProperties = new HashSet<String>();
    QueryInfo rootQuery = new QueryInfo(new ServiceResourceDefinition(), serviceProperties);
    TreeNode<QueryInfo> queryTree = new TreeNodeImpl<QueryInfo>(null, rootQuery, "Service");

    DefaultRenderer renderer = new DefaultRenderer();
    renderer.init(schemaFactory);
    TreeNode<Set<String>> propertyTree = renderer.finalizeProperties(queryTree, true);
View Full Code Here

    replay(schemaFactory, schema);

    HashSet<String> serviceProperties = new HashSet<String>();
    serviceProperties.add("foo/bar");
    QueryInfo rootQuery = new QueryInfo(new ServiceResourceDefinition(), serviceProperties);
    TreeNode<QueryInfo> queryTree = new TreeNodeImpl<QueryInfo>(null, rootQuery, "Service");

    DefaultRenderer renderer = new DefaultRenderer();
    renderer.init(schemaFactory);
    TreeNode<Set<String>> propertyTree = renderer.finalizeProperties(queryTree, true);
View Full Code Here

    expect(componentSchema.getKeyPropertyId(Resource.Type.Component)).andReturn("ServiceComponentInfo/component_name").anyTimes();

    replay(schemaFactory, serviceSchema, componentSchema);

    HashSet<String> serviceProperties = new HashSet<String>();
    QueryInfo rootQuery = new QueryInfo(new ServiceResourceDefinition(), serviceProperties);
    TreeNode<QueryInfo> queryTree = new TreeNodeImpl<QueryInfo>(null, rootQuery, "Service");
    queryTree.addChild(new QueryInfo(new ComponentResourceDefinition(), new HashSet<String>()), "Component");

    DefaultRenderer renderer = new DefaultRenderer();
    renderer.init(schemaFactory);
    TreeNode<Set<String>> propertyTree = renderer.finalizeProperties(queryTree, false);
View Full Code Here

    replay(schemaFactory, serviceSchema, componentSchema);

    HashSet<String> serviceProperties = new HashSet<String>();
    serviceProperties.add("foo/bar");
    QueryInfo rootQuery = new QueryInfo(new ServiceResourceDefinition(), serviceProperties);
    TreeNode<QueryInfo> queryTree = new TreeNodeImpl<QueryInfo>(null, rootQuery, "Service");
    HashSet<String> componentProperties = new HashSet<String>();
    componentProperties.add("goo/car");
    queryTree.addChild(new QueryInfo(new ComponentResourceDefinition(), componentProperties), "Component");

    DefaultRenderer renderer = new DefaultRenderer();
    renderer.init(schemaFactory);
    TreeNode<Set<String>> propertyTree = renderer.finalizeProperties(queryTree, false);
View Full Code Here

    expect(componentSchema.getKeyPropertyId(Resource.Type.Component)).andReturn("ServiceComponentInfo/component_name").anyTimes();

    replay(schemaFactory, serviceSchema, componentSchema);

    HashSet<String> serviceProperties = new HashSet<String>();
    QueryInfo rootQuery = new QueryInfo(new ServiceResourceDefinition(), serviceProperties);
    TreeNode<QueryInfo> queryTree = new TreeNodeImpl<QueryInfo>(null, rootQuery, "Service");
    queryTree.addChild(new QueryInfo(new ComponentResourceDefinition(), new HashSet<String>()), "Component");

    DefaultRenderer renderer = new DefaultRenderer();
    renderer.init(schemaFactory);
    TreeNode<Set<String>> propertyTree = renderer.finalizeProperties(queryTree, true);
View Full Code Here

    replay(schemaFactory, serviceSchema, componentSchema);

    HashSet<String> serviceProperties = new HashSet<String>();
    serviceProperties.add("foo/bar");
    QueryInfo rootQuery = new QueryInfo(new ServiceResourceDefinition(), serviceProperties);
    TreeNode<QueryInfo> queryTree = new TreeNodeImpl<QueryInfo>(null, rootQuery, "Service");
    queryTree.addChild(new QueryInfo(new ComponentResourceDefinition(), new HashSet<String>()), "Component");

    DefaultRenderer renderer = new DefaultRenderer();
    renderer.init(schemaFactory);
    TreeNode<Set<String>> propertyTree = renderer.finalizeProperties(queryTree, true);
View Full Code Here

* ClusterBlueprintRenderer unit tests.
*/
public class ClusterBlueprintRendererTest {
  @Test
  public void testFinalizeProperties__instance() {
    QueryInfo rootQuery = new QueryInfo(new ClusterResourceDefinition(), new HashSet<String>());
    TreeNode<QueryInfo> queryTree = new TreeNodeImpl<QueryInfo>(null, rootQuery, "Cluster");
    rootQuery.getProperties().add("foo/bar");
    rootQuery.getProperties().add("prop1");

    QueryInfo hostInfo = new QueryInfo(new HostResourceDefinition(), new HashSet<String>());
    queryTree.addChild(hostInfo, "Host");

    QueryInfo hostComponentInfo = new QueryInfo(new HostComponentResourceDefinition(), new HashSet<String>());
    queryTree.getChild("Host").addChild(hostComponentInfo, "HostComponent");

    ClusterBlueprintRenderer renderer = new ClusterBlueprintRenderer();
    TreeNode<Set<String>> propertyTree = renderer.finalizeProperties(queryTree, false);

View Full Code Here

    assertTrue(propertyTree.getChild("Host/HostComponent").getObject().contains("HostRoles/component_name"));
  }

  @Test
  public void testFinalizeProperties__instance_noComponentNode() {
    QueryInfo rootQuery = new QueryInfo(new ClusterResourceDefinition(), new HashSet<String>());
    TreeNode<QueryInfo> queryTree = new TreeNodeImpl<QueryInfo>(null, rootQuery, "Cluster");
    rootQuery.getProperties().add("foo/bar");
    rootQuery.getProperties().add("prop1");

    ClusterBlueprintRenderer renderer = new ClusterBlueprintRenderer();
    TreeNode<Set<String>> propertyTree = renderer.finalizeProperties(queryTree, false);

    Set<String> rootProperties = propertyTree.getObject();
View Full Code Here

TOP

Related Classes of org.apache.ambari.server.api.query.QueryInfo

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.