@Before
  public void setUp() {
    owner = new Owner("test-owner", "Test Owner");
    owner = ownerCurator.create(owner);

    e = new Environment("env1", "Env 1", owner);
    envCurator.create(e);

    p = TestUtil.createProduct(owner);
    c =
        new Content(
            this.owner,
            "testcontent",
            "contentId1",
            "testcontent",
            "yum",
            "red hat",
            "http://example.com",
            "http://example.com/gpg.key",
            "test-arch");
    contentCurator.create(c);
    p.addContent(c);
    productCurator.create(p);

    envContent = new EnvironmentContent(e, c, true);
    envContent = envContentCurator.create(envContent);
  }
Esempio n. 2
0
  @Before
  public void setUp() {
    config.setProperty(ConfigProperties.INTEGER_ATTRIBUTES, "product.count, product.multiplier");
    config.setProperty(ConfigProperties.NON_NEG_INTEGER_ATTRIBUTES, "product.pos_count");
    config.setProperty(
        ConfigProperties.LONG_ATTRIBUTES, "product.long_count, product.long_multiplier");
    config.setProperty(ConfigProperties.NON_NEG_LONG_ATTRIBUTES, "product.long_pos_count");
    config.setProperty(
        ConfigProperties.BOOLEAN_ATTRIBUTES, "product.bool_val_str, product.bool_val_num");

    this.owner = createOwner();
    ownerCurator.create(owner);

    product = TestUtil.createProduct(owner);
    productCurator.create(product);

    providedProduct = TestUtil.createProduct(owner);
    productCurator.create(providedProduct);

    Set<Product> providedProducts = new HashSet<Product>();
    providedProducts.add(providedProduct);

    derivedProduct = TestUtil.createProduct(owner);
    productCurator.create(derivedProduct);

    derivedProvidedProduct = TestUtil.createProduct(owner);
    productCurator.create(derivedProvidedProduct);

    Set<Product> derivedProvidedProducts = new HashSet<Product>();
    derivedProvidedProducts.add(derivedProvidedProduct);

    pool =
        new Pool(
            owner,
            product,
            providedProducts,
            16L,
            TestUtil.createDate(2006, 10, 21),
            TestUtil.createDate(2020, 1, 1),
            "1",
            "2",
            "3");

    pool.setDerivedProduct(derivedProduct);
    pool.setDerivedProvidedProducts(derivedProvidedProducts);
    poolCurator.create(pool);
  }