Class DefaultPagedB2BDocumentDaoTest

    • Field Detail

      • sdf

        public static final java.text.SimpleDateFormat sdf
    • Constructor Detail

      • DefaultPagedB2BDocumentDaoTest

        public DefaultPagedB2BDocumentDaoTest()
    • Method Detail

      • setUp

        public void setUp()
                   throws java.lang.Exception
        Throws:
        java.lang.Exception
      • shouldReturnAllDocumentsAscSort

        public void shouldReturnAllDocumentsAscSort()
      • shouldReturnAllDocumentsDescSort

        public void shouldReturnAllDocumentsDescSort()
      • shouldReturnOnlyDocumentsWherePurchaseOrder

        public void shouldReturnOnlyDocumentsWherePurchaseOrder()
      • shouldReturnOnlyDocumentsLikeNote

        public void shouldReturnOnlyDocumentsLikeNote()
      • shouldReturnOnlyFirstPageSortByDueDate

        public void shouldReturnOnlyFirstPageSortByDueDate()
      • shouldReturnSecondPageSortByAmount

        public void shouldReturnSecondPageSortByAmount()
      • shouldReturnDocumentAssociateToUser

        public void shouldReturnDocumentAssociateToUser()
      • shouldReturnOpenDocuments

        public void shouldReturnOpenDocuments()
      • shouldReturnProntoServicesDocuments

        public void shouldReturnProntoServicesDocuments()
      • shouldReturnEmptyResultForServicesWestDocuments

        public void shouldReturnEmptyResultForServicesWestDocuments()
      • shouldReturnDocumentsBetweenAmountRange

        public void shouldReturnDocumentsBetweenAmountRange()
      • shouldReturnDocumentsBetweenOpenamountRange

        public void shouldReturnDocumentsBetweenOpenamountRange()
      • shouldReturnDocumentsBetweenDateRange

        public void shouldReturnDocumentsBetweenDateRange()
                                                   throws java.text.ParseException
        Throws:
        java.text.ParseException
      • shouldReturnDocumentsBetweenDueDateRange

        public void shouldReturnDocumentsBetweenDueDateRange()
                                                      throws java.text.ParseException
        Throws:
        java.text.ParseException
      • shouldNotReturnResult

        public void shouldNotReturnResult()
      • shouldGetErrorCriteriaNotFound

        public void shouldGetErrorCriteriaNotFound()
      • shouldGetErrorInvalidPage

        public void shouldGetErrorInvalidPage()
      • shouldReturnAllPagedDocumentsSortedByDefaultSort

        public void shouldReturnAllPagedDocumentsSortedByDefaultSort()
        This test should return all results except the documents whose documentType.displayInAllList=false. Total documents are 15 in the testB2bdocument.csv, but the search result will only return 14 since, documentType.displayInAllList for Statement is set to false
      • shouldReturnAllPagedDocumentsFilteredByDocumentTypeSortedByDefaultSort

        public void shouldReturnAllPagedDocumentsFilteredByDocumentTypeSortedByDefaultSort()
        This test should return all results including the documents whose documentType.displayInAllList=false. Total documents are 15 in the testB2bdocument.csv, since the search criteria is documentType, result will return all documents i.e. 15
      • shouldReturnAllPagedDocumentsFilteredByDocumentNumberRange

        public void shouldReturnAllPagedDocumentsFilteredByDocumentNumberRange()
        This test should return all results including the documents whose documentType.displayInAllList=false. Total documents are 15 in the testB2bdocument.csv, since the search criteria is documentNumber, result will return all documents i.e. 15
      • shouldReturnAllPagedDocumentsForProntoGoodsFilteredByDocumentNumberRange

        public void shouldReturnAllPagedDocumentsForProntoGoodsFilteredByDocumentNumberRange()
        This test should return only 1 result including the document whose documentType.displayInAllList=false. Since the search criteria is documentNumber From: STA for Unit Pronto Goods, result will return only 1 document
      • shouldReturnAllPagedDocumentsSortedByDocumentStatusDesc

        public void shouldReturnAllPagedDocumentsSortedByDocumentStatusDesc()
        This test returns 5 results as page size is set to 5, sorted byDocumentStatusDesc.
      • shouldReturnPagedDocumentsWithPurchaseOrder

        public void shouldReturnPagedDocumentsWithPurchaseOrder()
        This test returns 1 result, since the test data contains only 1 document with type Purchase Order sorted byDocumentStatusDesc.
      • shouldReturnPagedDocumentsWithInvoiceForPronto

        public void shouldReturnPagedDocumentsWithInvoiceForPronto()
        This test returns 3 results, for unit "Pronto" sorted byDocumentNumberDesc with documentType "Invoice".
      • shouldReturnOnlyFirstPageSortedByDueDateAsc

        public void shouldReturnOnlyFirstPageSortedByDueDateAsc()
        This test should return only 2 results as set on pageSize, sorted by "byDueDateAsc". It should return documents with number CRN-005 & CRN-006 as the dueDate for these documents is the earliest.
      • shouldReturnSecondPageSortedByOriginalAmountAsc

        public void shouldReturnSecondPageSortedByOriginalAmountAsc()
        This test will return total of 2 results, sorted by "byOriginalAmountAsc" but on page 1. That's why 3rd & 4th document's amount is compared.
      • shouldReturnPagedDocumentAssociatedToUserSortedByOpenAmountDesc

        public void shouldReturnPagedDocumentAssociatedToUserSortedByOpenAmountDesc()
        This test will return total of 3 results, sorted by "byOpenAmountDesc" for the user mark.rivers@rustic-hw.com.
      • shouldReturnPagedOpenDocumentsSortedByOpenAmountAsc

        public void shouldReturnPagedOpenDocumentsSortedByOpenAmountAsc()
        This test will return total of 10 results cause of the page size set to 10, sorted by "byOpenAmountDesc" with documentStatus "Open".
      • shouldReturnPagedOpenDocumentsForProntoServicesSortedByCreationDateAsc

        public void shouldReturnPagedOpenDocumentsForProntoServicesSortedByCreationDateAsc()
        This test will return total of 2 results, for unit "Pronto Services" with documentStatus "Open".
      • shouldReturnNoOpenDocumentsForServicesWest

        public void shouldReturnNoOpenDocumentsForServicesWest()
        This test will return total of 0 results, for unit "Services West" with documentStatus "Open". Since the test data does not contain any documents for Services West.
      • shouldReturnPagedOpenDocumentsForAmountRange

        public void shouldReturnPagedOpenDocumentsForAmountRange()
        This test will return total of 1 result, filtered by amount from "75.30" to "76.31" with documentStatus "Open".
      • shouldReturnPagedOpenDocumentsForCustomRetailFilteredByAmountRange

        public void shouldReturnPagedOpenDocumentsForCustomRetailFilteredByAmountRange()
        This test will return total of 1 result, for unit "Custom Retail" filtered by amount from "24" to "27" with documentStatus "Open".
      • shouldReturnPagedOpenDocumentsFilteredByDateRange

        public void shouldReturnPagedOpenDocumentsFilteredByDateRange()
                                                               throws java.text.ParseException
        This test will return total of 2 result, filtered by date from "08/10/2013" to "08/11/2013" with documentStatus "Open", "sorted byDocumentDateAsc".
        Throws:
        java.text.ParseException
      • shouldReturnPagedOpenDocumentsForCustomRetailFilteredByDateRange

        public void shouldReturnPagedOpenDocumentsForCustomRetailFilteredByDateRange()
                                                                              throws java.text.ParseException
        This test will return total of 1 result, for unit "Custom Retail" filtered by date from "08/09/2013" to "08/11/2013" with documentStatus "Open".
        Throws:
        java.text.ParseException
      • shouldReturnPagedClosedDocumentsFilteredByDocumentNumberRange

        public void shouldReturnPagedClosedDocumentsFilteredByDocumentNumberRange()
        This test will return total of 1 result, filtered by documentNumber from "CRN-003" to "CRN-006" with documentStatus "Closed".
      • shouldReturnPagedClosedDocumentsForCustomRetailFilteredByDocumentNumberRange

        public void shouldReturnPagedClosedDocumentsForCustomRetailFilteredByDocumentNumberRange()
        This test will return total of 1 result, for unit "Custom Retail" filtered by documentNumber from "DBN-001" to "DBN-002" with documentStatus "Closed".
      • shouldReturnPagedDocumentsForServicesEastFilteredByDocumentNumber

        public void shouldReturnPagedDocumentsForServicesEastFilteredByDocumentNumber()
        This test will return total of 3 result, for unit "Services East" filtered by documentNumber with wildcard search on "005".
      • shouldNotReturnResultFilteredByDocumentType

        public void shouldNotReturnResultFilteredByDocumentType()
        This test will return total of 0 result, filtered by documentType "UNKNOWN"
      • shouldNotReturnResultForServicesEastFilteredByDocumentType

        public void shouldNotReturnResultForServicesEastFilteredByDocumentType()
        This test will return total of 0 result, for unit "Services East" filtered by documentType "UNKNOWN"