Examples of ProductResource


Examples of org.apache.oodt.cas.product.jaxrs.resources.ProductResource

      Product product = client.getProductById(productId);
      product.setProductReferences(client.getProductReferences(product));

      // Create the product resource, add the product data and return the
      // resource as the HTTP response.
      return new ProductResource(product, client.getMetadata(product),
        product.getProductReferences(), getContextWorkingDir());
    }
    catch (Exception e)
    {
      String message = "Unable to find the requested resource.";
View Full Code Here

Examples of org.apache.oodt.cas.product.jaxrs.resources.ProductResource

      for (ProductType productType : productTypes)
      {
        for (Product product : client.getProductsByProductType(productType))
        {
          product.setProductReferences(client.getProductReferences(product));
          resource.addProductResource(new ProductResource(product,
            client.getMetadata(product), product.getProductReferences(),
            new File(productDirPath)));
        }
      }
      return resource;
View Full Code Here

Examples of org.candlepin.resource.ProductResource

    @Test(expected = BadRequestException.class)
    public void testDeleteProductWithSubscriptions() {
        ProductServiceAdapter pa = mock(ProductServiceAdapter.class);
        I18n i18n = I18nFactory.getI18n(getClass(), Locale.US, I18nFactory.FALLBACK);
        ProductResource pr = new ProductResource(pa, null, null, null, i18n);
        Product p = mock(Product.class);
        when(pa.getProductById(eq("10"))).thenReturn(p);
        Set<Subscription> subs = new HashSet<Subscription>();
        Subscription s = mock(Subscription.class);
        subs.add(s);
        when(pa.productHasSubscriptions(eq(p))).thenReturn(true);

        pr.deleteProduct("10");
    }
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.