Package org.apache.oodt.cas.filemgr.structs

Examples of org.apache.oodt.cas.filemgr.structs.ProductPage


        assertNotNull(myCat.getFirstPage(type).getPageProducts());
        assertEquals(catPageSize, myCat.getFirstPage(type).getPageProducts()
                .size());
        assertNotNull(myCat.getFirstPage(type).getPageProducts().get(0));
        assertEquals("ShouldBeFirstForPage.txt", ((Product)myCat.getFirstPage(type).getPageProducts().get(0)).getProductName());
        ProductPage page = myCat.getNextPage(type, myCat.getFirstPage(type));
        assertNotNull(page);
        assertNotNull(page.getPageProducts());
        assertEquals(1, page.getPageProducts().size());
        assertEquals(2, page.getTotalPages());
        assertNotNull(page.getPageProducts().get(0));
        Product retProd = ((Product) page.getPageProducts().get(0));
        assertEquals("test", retProd.getProductName());

    }
View Full Code Here


               return pt;
            }

            @Override
            public ProductPage getFirstPage(ProductType pt) {
               ProductPage pp = new ProductPage();
               pp.setPageNum(PAGE_NUM);
               pp.setTotalPages(TOTAL_PAGES);
               pp.setPageSize(PAGE_SIZE);
               Product p = new Product();
               p.setProductId(PRODUCT_ID);
               p.setProductName(PRODUCT_NAME);
               p.setProductType(pt);
               p.setProductStructure(PRODUCT_STRUCTURE);
               p.setTransferStatus(PRODUCT_STATUS);
               pp.setPageProducts(Lists.newArrayList(p));
               return pp;
            }
         };
      }
View Full Code Here

        type.setName("GenericFile");
        assertNotNull(myCat.getFirstPage(type));
        assertNotNull(myCat.getFirstPage(type).getPageProducts());
        assertEquals(catPageSize, myCat.getFirstPage(type).getPageProducts()
                .size());
        ProductPage page = myCat.getNextPage(type, myCat.getFirstPage(type));
        assertNotNull(page);
        assertNotNull(page.getPageProducts());
        assertEquals(1, page.getPageProducts().size());
        assertEquals(2, page.getTotalPages());
        assertNotNull(page.getPageProducts().get(0));
        Product retProd = ((Product) page.getPageProducts().get(0));
        assertEquals("ShouldBeFirstForPage.txt", retProd.getProductName());
    }
View Full Code Here

            fail(e.getMessage());
      }
      query.addCriterion(bqc);
     
      // Perform the query and validate results
      ProductPage page = null;
      try{
        page = myCat.pagedQuery(query, testProduct.getProductType(), 1);
      }catch (Exception e){
        e.printStackTrace();
            fail(e.getMessage());
      }
      assertEquals(page.getPageProducts().size(), 1);
      assertEquals(page.getPageProducts().get(0).getProductName(), "test1");
      assertEquals(page.getPageNum(), 1);
      assertEquals(page.getTotalPages(), 1);
    }
View Full Code Here

               return pt;
            }

            @Override
            public ProductPage getLastPage(ProductType pt) {
               ProductPage pp = new ProductPage();
               pp.setPageNum(PAGE_NUM);
               pp.setTotalPages(TOTAL_PAGES);
               pp.setPageSize(PAGE_SIZE);
               Product p = new Product();
               p.setProductId(PRODUCT_ID);
               p.setProductName(PRODUCT_NAME);
               p.setProductType(pt);
               p.setProductStructure(PRODUCT_STRUCTURE);
               p.setTransferStatus(PRODUCT_STATUS);
               pp.setPageProducts(Lists.newArrayList(p));
               return pp;
            }
         };
      }
View Full Code Here

   @Override
   public ProductPage getFirstPage(ProductType type) {
      lastMethodCallDetails = new MethodCallDetails("getFirstPage",
            Lists.newArrayList((Object) type));
      ProductPage pp = new ProductPage();
      pp.setNumOfHits(0);
      pp.setPageProducts(new ArrayList<Product>());
      pp.setPageSize(10);
      pp.setTotalPages(0);
      pp.setPageNum(1);
      return pp;
   }
View Full Code Here

   @Override
   public ProductPage getLastPage(ProductType type) {
      lastMethodCallDetails = new MethodCallDetails("getLastPage",
            Lists.newArrayList((Object) type));
      ProductPage pp = new ProductPage();
      pp.setNumOfHits(0);
      pp.setPageProducts(new ArrayList<Product>());
      pp.setPageSize(10);
      pp.setTotalPages(0);
      pp.setPageNum(1);
      return pp;
   }
View Full Code Here

   @Override
   public ProductPage getNextPage(ProductType type, ProductPage curPage) {
      lastMethodCallDetails = new MethodCallDetails("getNextPage",
            Lists.newArrayList((Object) type, curPage));
      ProductPage pp = new ProductPage();
      pp.setNumOfHits(0);
      pp.setPageProducts(new ArrayList<Product>());
      pp.setPageSize(10);
      pp.setTotalPages(0);
      pp.setPageNum(curPage.getPageNum() + 1);
      return pp;
   }
View Full Code Here

   @Override
   public ProductPage getPrevPage(ProductType type, ProductPage curPage) {
      lastMethodCallDetails = new MethodCallDetails("getPrevPage",
            Lists.newArrayList((Object) type, curPage));
      ProductPage pp = new ProductPage();
      pp.setNumOfHits(0);
      pp.setPageProducts(new ArrayList<Product>());
      pp.setPageSize(10);
      pp.setTotalPages(0);
      pp.setPageNum(curPage.getPageNum() - 1);
      return pp;
   }
View Full Code Here

             */
            if (totalPages == 0) {
                return ProductPage.blankPage();
            }

            ProductPage retPage = new ProductPage();
            retPage.setPageNum(pageNum);
            retPage.setPageSize(this.pageSize);
            retPage.setTotalPages(totalPages);

            List productIds = paginateQuery(query, type, pageNum);

            if (productIds != null && productIds.size() > 0) {
                List products = new Vector(productIds.size());

                for (Iterator i = productIds.iterator(); i.hasNext();) {
                    String productId = (String) i.next();
                    Product p = getProductById(productId);
                    products.add(p);
                }

                retPage.setPageProducts(products);
            }

            return retPage;
        }
View Full Code Here

TOP

Related Classes of org.apache.oodt.cas.filemgr.structs.ProductPage

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.