Package org.qi4j.sample.dcicargo.sample_b.context.interaction.handling.inspection.event

Examples of org.qi4j.sample.dcicargo.sample_b.context.interaction.handling.inspection.event.InspectLoadedCargo


                case RECEIVE:
                    new InspectReceivedCargo( cargo, c.handlingEvent ).inspect();
                    break;

                case LOAD:
                    new InspectLoadedCargo( cargo, c.handlingEvent ).inspect();
                    break;

                case UNLOAD:
                    if( c.handlingLocation.equals( c.destination ) )
                    {
View Full Code Here


        // V202 doesn't expect a load in Hongkong - can't determine much more before we get a correct voyage schedule
        handlingEvent = HANDLING_EVENTS.createHandlingEvent( DAY1, DAY1, trackingId, LOAD, HONGKONG, V202 );
        try
        {
            new InspectLoadedCargo( cargo, handlingEvent ).inspect();
            fail();
        }
        catch( UnexpectedCarrierException e )
        {
            assertMessage( e, "Carrier of voyage V202 didn't expect a load in Hongkong (CNHKG)" );
View Full Code Here

        cargo.itinerary().set( itinerary );
        cargo.delivery().set( delivery( TODAY, IN_PORT, ROUTED, leg1 ) );

        //
        handlingEvent = HANDLING_EVENTS.createHandlingEvent( DAY1, DAY1, trackingId, LOAD, HONGKONG, V201 );
        new InspectLoadedCargo( cargo, handlingEvent ).inspect();
        assertDelivery( LOAD, HONGKONG, DAY1, V201,
                        ONBOARD_CARRIER, notArrived,
                        ROUTED, directed, itinerary.eta(), leg1,
                        UNLOAD, CHICAGO, DAY5, V201 );   // Arrival date 1 is planned
    }
View Full Code Here

        cargo.itinerary().set( itinerary );
        cargo.delivery().set( delivery( TODAY, IN_PORT, ROUTED, leg1 ) );

        //
        handlingEvent = HANDLING_EVENTS.createHandlingEvent( DAY2, DAY2, trackingId, LOAD, HONGKONG, V201 );
        new InspectLoadedCargo( cargo, handlingEvent ).inspect();
        assertDelivery( LOAD, HONGKONG, DAY2, V201,
                        ONBOARD_CARRIER, notArrived,
                        ROUTED, directed, itinerary.eta(), leg1,
                        UNLOAD, CHICAGO, DAY6, V201 )// Arrival date has been postponed 1 day
    }
View Full Code Here

        // Load cargo in Hong Kong (without an itinerary!)
        handlingEvent = HANDLING_EVENTS.createHandlingEvent( DAY1, DAY1, trackingId, LOAD, HONGKONG, V201 );
        try
        {
            new InspectLoadedCargo( cargo, handlingEvent ).inspect();
            fail();
        }
        catch( CargoNotRoutedException e )
        {
            assertMessage( e, "NOT ROUTED while being handled!" );
View Full Code Here

        // Load cargo in Hong Kong (with wrong itinerary)
        handlingEvent = HANDLING_EVENTS.createHandlingEvent( DAY1, DAY1, trackingId, LOAD, HONGKONG, V201 );
        try
        {
            // Load in any location is unexpected when itinerary is wrong
            new InspectLoadedCargo( cargo, handlingEvent ).inspect();
            fail();
        }
        catch( CargoMisroutedException e )
        {
            assertMessage( e, "MISROUTED! Route specification is not satisfied with itinerary" );
View Full Code Here

        cargo.itinerary().set( wrongItinerary );
        cargo.delivery().set( delivery( TODAY, IN_PORT, MISROUTED, leg1 ) );

        handlingEvent = HANDLING_EVENTS.createHandlingEvent( DAY1, DAY1, trackingId, LOAD, NEWYORK, V201 );
        thrown.expect( CargoMisroutedException.class, "MISROUTED! Route specification is not satisfied with itinerary" );
        new InspectLoadedCargo( cargo, handlingEvent ).inspect();
    }
View Full Code Here

        cargo.itinerary().set( wrongItinerary );
        cargo.delivery().set( delivery( TODAY, IN_PORT, MISROUTED, leg1 ) );

        handlingEvent = HANDLING_EVENTS.createHandlingEvent( DAY1, DAY1, trackingId, LOAD, ROTTERDAM, V205 );
        thrown.expect( CargoMisroutedException.class, "MISROUTED! Route specification is not satisfied with itinerary" );
        new InspectLoadedCargo( cargo, handlingEvent ).inspect();
    }
View Full Code Here

        // Assign satisfying route going to Stockholm
        cargo.itinerary().set( itinerary );
        cargo.delivery().set( delivery( TODAY, IN_PORT, ROUTED, leg1 ) );

        handlingEvent = HANDLING_EVENTS.createHandlingEvent( DAY1, DAY1, trackingId, LOAD, HONGKONG, V201 );
        new InspectLoadedCargo( cargo, handlingEvent ).inspect();

        assertDelivery( LOAD, HONGKONG, DAY1, V201,
                        ONBOARD_CARRIER, notArrived,
                        ROUTED, directed, itinerary.eta(), leg1,
                        UNLOAD, CHICAGO, DAY5, V201 );
View Full Code Here

        Integer badLegIndex = 7;
        cargo.delivery().set( delivery( handlingEvent, ONBOARD_CARRIER, notArrived,
                                        ROUTED, directed, unknownETA, badLegIndex, unknownNextHandlingEvent ) );
        try
        {
            new InspectLoadedCargo( cargo, handlingEvent ).inspect();
            fail();
        }
        catch( InspectionFailedException e )
        {
            assertMessage( e, "INTERNAL ERROR: Itinerary progress index '7' is invalid!" );
View Full Code Here

TOP

Related Classes of org.qi4j.sample.dcicargo.sample_b.context.interaction.handling.inspection.event.InspectLoadedCargo

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.