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.InspectUnloadedCargo


                    {
                        new InspectArrivedCargo( cargo, c.handlingEvent ).inspect();
                    }
                    else
                    {
                        new InspectUnloadedCargo( cargo, c.handlingEvent ).inspect();
                    }
                    break;

                case CUSTOMS:
                    new InspectCargoInCustoms( cargo, c.handlingEvent ).inspect();
View Full Code Here


        throws Exception
    {
        handlingEvent = HANDLING_EVENTS.createHandlingEvent( DAY1, DAY1, trackingId, UNLOAD, STOCKHOLM, V205 );
        try
        {
            new InspectUnloadedCargo( cargo, handlingEvent ).inspect();
            fail();
        }
        catch( InspectionFailedException e )
        {
            assertMessage( e, "INTERNAL ERROR: Can only inspect unloaded cargo that hasn't arrived at destination" );
View Full Code Here

        // Unload in Chicago (without an itinerary!)
        handlingEvent = HANDLING_EVENTS.createHandlingEvent( DAY5, DAY5, trackingId, UNLOAD, CHICAGO, V201 );
        try
        {
            new InspectUnloadedCargo( cargo, handlingEvent ).inspect();
            fail();
        }
        catch( CargoNotRoutedException e )
        {
            assertMessage( e, "NOT ROUTED while being handled!" );
View Full Code Here

        // Unload in Hong Kong (with wrong itinerary)
        handlingEvent = HANDLING_EVENTS.createHandlingEvent( DAY1, DAY1, trackingId, UNLOAD, HONGKONG, V201 );
        try
        {
            new InspectUnloadedCargo( 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, ONBOARD_CARRIER, MISROUTED, leg1 ) );

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

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

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

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

        handlingEvent = HANDLING_EVENTS.createHandlingEvent( DAY5, DAY5, trackingId, UNLOAD, CHICAGO, V201 );
        new InspectUnloadedCargo( cargo, handlingEvent ).inspect();

        // Itinerary progresses to next leg
        assertDelivery( UNLOAD, CHICAGO, DAY5, V201,
                        IN_PORT, notArrived,
                        ROUTED, directed, itinerary.eta(), leg2,
View Full Code Here

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

                                        ROUTED, misdirected, itinerary.eta(), leg3,
                                        nextHandlingEvent( UNLOAD, HONGKONG, DAY6, V201 ) ) );

        // Unload in new route specification origin (load location of itinerary leg 1)
        handlingEvent = HANDLING_EVENTS.createHandlingEvent( DAY1, DAY1, trackingId, UNLOAD, HONGKONG, V204 );
        new InspectUnloadedCargo( cargo, handlingEvent ).inspect();

        // Itinerary progress starts over from leg 1 again
        assertDelivery( UNLOAD, HONGKONG, DAY1, V204,
                        IN_PORT, notArrived,
                        ROUTED, directed, itinerary.eta(), leg1,
View Full Code Here

                                        ROUTED, directed, itinerary.eta(), leg2,
                                        nextHandlingEvent( UNLOAD, NEWYORK, DAY6, V201 ) ) );

        // Unexpected unload in origin
        handlingEvent = HANDLING_EVENTS.createHandlingEvent( DAY6, DAY6, trackingId, UNLOAD, HONGKONG, V201 );
        new InspectUnloadedCargo( cargo, handlingEvent ).inspect();

        // Itinerary progress starts over from leg 1 again
        assertDelivery( UNLOAD, HONGKONG, DAY6, V201,
                        IN_PORT, notArrived,
                        ROUTED, directed, itinerary.eta(), leg1,
View Full Code Here

TOP

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

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.