Examples of BlueprintEntity


Examples of org.apache.ambari.server.orm.entities.BlueprintEntity

    replay(entityManagerProvider);
  }

  @Test
  public void testFindByName() {
    BlueprintEntity entity = new BlueprintEntity();

    // set expectations
    expect(entityManager.find(eq(BlueprintEntity.class), eq("test-cluster-name"))).andReturn(entity);
    replay(entityManager);

    BlueprintDAO dao = new BlueprintDAO();
    dao.entityManagerProvider = entityManagerProvider;
    BlueprintEntity result = dao.findByName("test-cluster-name");

    assertSame(result, entity);
    verify(entityManagerProvider, entityManager);
  }
View Full Code Here

Examples of org.apache.ambari.server.orm.entities.BlueprintEntity

    verify(entityManagerProvider, entityManager);
  }

  @Test
  public void testFindAll() {
    BlueprintEntity entity = new BlueprintEntity();
    TypedQuery<BlueprintEntity> query = createStrictMock(TypedQuery.class);

    // set expectations
    expect(entityManager.createNamedQuery(eq("allBlueprints"), eq(BlueprintEntity.class))).andReturn(query);
    expect(query.getResultList()).andReturn(Collections.singletonList(entity));
View Full Code Here

Examples of org.apache.ambari.server.orm.entities.BlueprintEntity

    verify(entityManagerProvider, entityManager, query);
  }

  @Test
  public void testRefresh() {
    BlueprintEntity entity = new BlueprintEntity();

    // set expectations
    entityManager.refresh(eq(entity));
    replay(entityManager);
View Full Code Here

Examples of org.apache.ambari.server.orm.entities.BlueprintEntity

    verify(entityManagerProvider, entityManager);
  }

  @Test
  public void testCreate() {
    BlueprintEntity entity = new BlueprintEntity();

    // set expectations
    entityManager.persist(eq(entity));
    replay(entityManager);
View Full Code Here

Examples of org.apache.ambari.server.orm.entities.BlueprintEntity

    verify(entityManagerProvider, entityManager);
  }

  @Test
  public void testMerge() {
    BlueprintEntity entity = new BlueprintEntity();
    BlueprintEntity entity2 = new BlueprintEntity();

    // set expectations
    expect(entityManager.merge(eq(entity))).andReturn(entity2);
    replay(entityManager);
View Full Code Here

Examples of org.apache.ambari.server.orm.entities.BlueprintEntity

    verify(entityManagerProvider, entityManager);
  }

  @Test
  public void testRemove() {
    BlueprintEntity entity = new BlueprintEntity();
    BlueprintEntity entity2 = new BlueprintEntity();

    // set expectations
    expect(entityManager.merge(eq(entity))).andReturn(entity2);
    entityManager.remove(eq(entity2));
    replay(entityManager);
View Full Code Here

Examples of org.apache.ambari.server.orm.entities.BlueprintEntity

  public void testGetResourcesNoPredicate() throws SystemException, UnsupportedPropertyException,
                                                   NoSuchParentResourceException, NoSuchResourceException {
    Request request = createNiceMock(Request.class);

    ResourceProvider provider = createProvider();
    BlueprintEntity entity = ((BlueprintResourceProvider) provider).toEntity(
        getTestProperties().iterator().next());

    List<BlueprintEntity> results = new ArrayList<BlueprintEntity>();
    results.add(entity);
View Full Code Here

Examples of org.apache.ambari.server.orm.entities.BlueprintEntity

    Request request = createNiceMock(Request.class);

    ResourceProvider provider = createProvider();
    Set<Map<String, Object>> testProperties = getTestProperties();
    setConfigurationProperties(testProperties);
    BlueprintEntity entity = ((BlueprintResourceProvider) provider).toEntity(
        testProperties.iterator().next());

    List<BlueprintEntity> results = new ArrayList<BlueprintEntity>();
    results.add(entity);
View Full Code Here

Examples of org.apache.ambari.server.orm.entities.BlueprintEntity

                                           NoSuchParentResourceException, NoSuchResourceException {

    Capture<BlueprintEntity> entityCapture = new Capture<BlueprintEntity>();

    ResourceProvider provider = createProvider();
    BlueprintEntity blueprintEntity = ((BlueprintResourceProvider) provider).toEntity(
        getTestProperties().iterator().next());

    // set expectations
    expect(dao.findByName(BLUEPRINT_NAME)).andReturn(blueprintEntity);
    dao.remove(capture(entityCapture));
View Full Code Here

Examples of org.apache.ambari.server.orm.entities.BlueprintEntity

    LOG.info("Creating Cluster '" + properties.get(CLUSTER_NAME_PROPERTY_ID) +
        "' based on blueprint '" + blueprintName + "'.");

    //todo: build up a proper topology object
    BlueprintEntity blueprint = getBlueprint(blueprintName);
    Stack stack = parseStack(blueprint);

    Map<String, HostGroup> blueprintHostGroups = parseBlueprintHostGroups(blueprint, stack);
    applyRequestInfoToHostGroups(properties, blueprintHostGroups);
    processConfigurations(processBlueprintConfigurations(blueprint), stack, blueprintHostGroups);
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.