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


                // Step 2 - Delegate inspection

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

                case LOAD:
                    new InspectLoadedCargo( cargo, c.handlingEvent ).inspect();
                    break;
View Full Code Here


                        LOAD, CHICAGO, DAY5, V201 );

        // Receive cargo again
        handlingEvent = HANDLING_EVENTS.createHandlingEvent( DAY2, DAY2, trackingId, RECEIVE, HONGKONG, noVoyage );
        thrown.expect( InspectionFailedException.class, "INTERNAL ERROR: Can't receive cargo again" );
        new InspectReceivedCargo( cargo, handlingEvent ).inspect();
    }
View Full Code Here

        cargo.delivery().set( delivery( TODAY, NOT_RECEIVED, NOT_ROUTED, leg1 ) );

        // Receive cargo in Hong Kong (without an itinerary!)
        handlingEvent = HANDLING_EVENTS.createHandlingEvent( DAY1, DAY1, trackingId, RECEIVE, HONGKONG, noVoyage );

        new InspectReceivedCargo( cargo, handlingEvent ).inspect();

        assertDelivery( RECEIVE, HONGKONG, DAY1, noVoyage,
                        IN_PORT, notArrived,
                        NOT_ROUTED, directed, unknownETA, unknownLeg,
                        unknownNextHandlingEvent );
View Full Code Here

                        MISROUTED, directed, unknownETA, unknownLeg,
                        unknownNextHandlingEvent );

        // Receive in cargo origin (Hong Kong) having a wrong itinerary
        handlingEvent = HANDLING_EVENTS.createHandlingEvent( DAY1, DAY1, trackingId, RECEIVE, HONGKONG, noVoyage );
        new InspectReceivedCargo( cargo, handlingEvent ).inspect();

        // Remains misrouted and directed
        assertDelivery( RECEIVE, HONGKONG, DAY1, noVoyage,
                        IN_PORT, notArrived,
                        MISROUTED, directed, unknownETA, unknownLeg,
View Full Code Here

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

        handlingEvent = HANDLING_EVENTS.createHandlingEvent( DAY1, DAY1, trackingId, RECEIVE, NEWYORK, noVoyage );

        new InspectReceivedCargo( cargo, handlingEvent ).inspect();

        // Remains misrouted and directed
        assertDelivery( RECEIVE, NEWYORK, DAY1, noVoyage,
                        IN_PORT, notArrived,
                        MISROUTED, directed, unknownETA, unknownLeg,
View Full Code Here

                        unknownNextHandlingEvent );

        // Receipt in cargo destination = no transportation.
        // This must be a mistake. Cargo owner should be notified.
        handlingEvent = HANDLING_EVENTS.createHandlingEvent( DAY1, DAY1, trackingId, RECEIVE, STOCKHOLM, noVoyage );
        new InspectReceivedCargo( cargo, handlingEvent ).inspect();

        // Remains misrouted and directed
        assertDelivery( RECEIVE, STOCKHOLM, DAY1, noVoyage,
                        IN_PORT, notArrived,
                        MISROUTED, directed, unknownETA, unknownLeg,
View Full Code Here

        cargo.itinerary().set( wrongItinerary );
        cargo.delivery().set( delivery( TODAY, NOT_RECEIVED, MISROUTED, unknownLeg ) );

        handlingEvent = HANDLING_EVENTS.createHandlingEvent( DAY1, DAY1, trackingId, RECEIVE, HANGZHOU, noVoyage );

        new InspectReceivedCargo( cargo, handlingEvent ).inspect();

        // Remains misrouted and directed
        assertDelivery( RECEIVE, HANGZHOU, DAY1, noVoyage,
                        IN_PORT, notArrived,
                        MISROUTED, directed, unknownETA, unknownLeg,
View Full Code Here

        // Receive cargo in some location of valid itinerary - should this be accepted?!
        handlingEvent = HANDLING_EVENTS.createHandlingEvent( DAY1, DAY1, trackingId, RECEIVE, NEWYORK, noVoyage );
        try
        {
            new InspectReceivedCargo( cargo, handlingEvent ).inspect();
            fail();
        }
        catch( CargoMisdirectedException e )
        {
            assertMessage( e, "MISDIRECTED! Itinerary expected receipt in Hongkong (CNHKG)" );
View Full Code Here

        // Receipt in cargo/routeSpec destination = no transportation.
        // This must be a unintended booking. Cargo owner should be notified.
        handlingEvent = HANDLING_EVENTS.createHandlingEvent( DAY1, DAY1, trackingId, RECEIVE, STOCKHOLM, noVoyage );
        try
        {
            new InspectReceivedCargo( cargo, handlingEvent ).inspect();
            fail();
        }
        catch( CargoMisdirectedException e )
        {
            assertMessage( e, "MISDIRECTED! Itinerary expected receipt in Hongkong (CNHKG)" );
View Full Code Here

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

        handlingEvent = HANDLING_EVENTS.createHandlingEvent( DAY1, DAY1, trackingId, RECEIVE, HANGZHOU, noVoyage );
        thrown.expect( CargoMisdirectedException.class, "MISDIRECTED! Itinerary expected receipt in Hongkong (CNHKG)" );
        new InspectReceivedCargo( cargo, handlingEvent ).inspect();
    }
View Full Code Here

TOP

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

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.