Class BasecommerceTest

    • Constructor Detail

      • BasecommerceTest

        public BasecommerceTest()
    • Method Detail

      • setUp

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

        public void testMultiAddressCalculation()
                                         throws JaloDeliveryModeException,
                                                JaloPriceFactoryException
        Scenario: 1
        testProduct0 -> deliveryModeCode1( delivery cost:= 4.2 )
        testProduct1 -> deliveryModeCode1( delivery cost:= 4.2 )
        ==> package no.1 ( delivery cost:= 4.2 )
        testProduct2 -> deliveryModeCode3( delivery cost:= 3.8 )
        ==> package no.2 ( delivery cost:= 3.8 )
        usage of DefaultMultiAddressDeliveryCostsStrategy -> total sum of delivery costs: 8.0

        Scenario: 2
        usage of DefaultDeliveryCostsStrategy -> total sum of delivery costs: 0.0

        Scenario: 3
        testProduct0 -> deliveryModeCode1( delivery cost:= 4.2 )
        testProduct1 -> deliveryModeCode1( delivery cost:= 4.2 )
        ==> package no.1 ( delivery cost:= 4.2 )
        testProduct2 -> deliveryMode is null -> fallback to delivery mode of order( delivery cost:= 0.0 )
        ==> package no.2 ( delivery cost:= 0.0 )
        usage of DefaultMultiAddressDeliveryCostsStrategy -> total sum of delivery costs: 4.2

        Scenario: 4
        testProduct0 -> deliveryAddress is null -> fallback to delivery address of order -> additional package
        ==> package no.1 ( delivery cost:= 4.2 )
        ==> package no.2 ( delivery cost:= 4.2 )
        ==> package no.3 ( delivery cost:= 0.0 )
        usage of DefaultMultiAddressDeliveryCostsStrategy -> total sum of delivery costs: 8.4
        Throws:
        JaloPriceFactoryException
        JaloDeliveryModeException
      • createCoreData

        public static void createCoreData()
                                   throws java.lang.Exception
        Throws:
        java.lang.Exception
      • createDefaultCatalog

        public static void createDefaultCatalog()
                                         throws java.lang.Exception
        Throws:
        java.lang.Exception