Package org.qi4j.sample.dcicargo.sample_a.data.shipping.delivery

Examples of org.qi4j.sample.dcicargo.sample_a.data.shipping.delivery.Delivery.nextExpectedHandlingEvent()


        assertThat( delivery.lastHandlingEvent().get(), is( equalTo( handlingEvent ) ) );
        assertThat( delivery.lastKnownLocation().get(), is( equalTo( HONGKONG ) ) );
        assertThat( delivery.currentVoyage().get(), is( equalTo( V100S ) ) );

        // We expect the cargo to be unloaded from voyage V100S in New York
        assertThat( delivery.nextExpectedHandlingEvent().get().handlingEventType().get(), is( equalTo( UNLOAD ) ) );
        assertThat( delivery.nextExpectedHandlingEvent().get().location().get(), is( equalTo( NEWYORK ) ) );
        assertThat( delivery.nextExpectedHandlingEvent().get().voyage().get(), is( equalTo( V100S ) ) );
    }

    @Test
View Full Code Here


        assertThat( delivery.lastKnownLocation().get(), is( equalTo( HONGKONG ) ) );
        assertThat( delivery.currentVoyage().get(), is( equalTo( V100S ) ) );

        // We expect the cargo to be unloaded from voyage V100S in New York
        assertThat( delivery.nextExpectedHandlingEvent().get().handlingEventType().get(), is( equalTo( UNLOAD ) ) );
        assertThat( delivery.nextExpectedHandlingEvent().get().location().get(), is( equalTo( NEWYORK ) ) );
        assertThat( delivery.nextExpectedHandlingEvent().get().voyage().get(), is( equalTo( V100S ) ) );
    }

    @Test
    public void deviation_4b_LOAD_2c_UnexpectedVoyageNotFromItinerary() throws Exception
View Full Code Here

        assertThat( delivery.currentVoyage().get(), is( equalTo( V100S ) ) );

        // We expect the cargo to be unloaded from voyage V100S in New York
        assertThat( delivery.nextExpectedHandlingEvent().get().handlingEventType().get(), is( equalTo( UNLOAD ) ) );
        assertThat( delivery.nextExpectedHandlingEvent().get().location().get(), is( equalTo( NEWYORK ) ) );
        assertThat( delivery.nextExpectedHandlingEvent().get().voyage().get(), is( equalTo( V100S ) ) );
    }

    @Test
    public void deviation_4b_LOAD_2c_UnexpectedVoyageNotFromItinerary() throws Exception
    {
View Full Code Here

        // Load onto unexpected voyage
        HandlingEvent handlingEvent = HANDLING_EVENTS.createHandlingEvent( day( 1 ), day( 1 ), trackingId, LOAD, HONGKONG, V400S );
        Delivery delivery = new BuildDeliverySnapshot( cargo, handlingEvent ).get();

        assertThat( delivery.isMisdirected().get(), is( equalTo( true ) ) );
        assertThat( delivery.nextExpectedHandlingEvent().get(), is( equalTo( null ) ) );
        assertThat( delivery.eta().get(), is( equalTo( null ) ) );

        assertThat( delivery.routingStatus().get(), is( equalTo( RoutingStatus.ROUTED ) ) );
        assertThat( delivery.transportStatus().get(), is( equalTo( TransportStatus.ONBOARD_CARRIER ) ) );
        assertThat( delivery.lastHandlingEvent().get(), is( equalTo( handlingEvent ) ) );
View Full Code Here

        assertThat( delivery.lastHandlingEvent().get(), is( equalTo( handlingEvent ) ) );
        assertThat( delivery.lastKnownLocation().get(), is( equalTo( NEWYORK ) ) );
        assertThat( delivery.currentVoyage().get(), is( equalTo( V200T ) ) );

        // We expect the cargo to be unloaded from voyage V200T in Dallas
        assertThat( delivery.nextExpectedHandlingEvent().get().handlingEventType().get(), is( equalTo( UNLOAD ) ) );
        assertThat( delivery.nextExpectedHandlingEvent().get().location().get(), is( equalTo( DALLAS ) ) );
        assertThat( delivery.nextExpectedHandlingEvent().get().voyage().get(), is( equalTo( V200T ) ) );
    }

View Full Code Here

        assertThat( delivery.lastKnownLocation().get(), is( equalTo( NEWYORK ) ) );
        assertThat( delivery.currentVoyage().get(), is( equalTo( V200T ) ) );

        // We expect the cargo to be unloaded from voyage V200T in Dallas
        assertThat( delivery.nextExpectedHandlingEvent().get().handlingEventType().get(), is( equalTo( UNLOAD ) ) );
        assertThat( delivery.nextExpectedHandlingEvent().get().location().get(), is( equalTo( DALLAS ) ) );
        assertThat( delivery.nextExpectedHandlingEvent().get().voyage().get(), is( equalTo( V200T ) ) );
    }


    @Test
View Full Code Here

        assertThat( delivery.currentVoyage().get(), is( equalTo( V200T ) ) );

        // We expect the cargo to be unloaded from voyage V200T in Dallas
        assertThat( delivery.nextExpectedHandlingEvent().get().handlingEventType().get(), is( equalTo( UNLOAD ) ) );
        assertThat( delivery.nextExpectedHandlingEvent().get().location().get(), is( equalTo( DALLAS ) ) );
        assertThat( delivery.nextExpectedHandlingEvent().get().voyage().get(), is( equalTo( V200T ) ) );
    }


    @Test
    public void deviation_4c_UNLOAD_1a_UnexpectedPort() throws Exception
View Full Code Here

        HandlingEvent handlingEvent = HANDLING_EVENTS.createHandlingEvent( day( 5 ), day( 5 ), trackingId, UNLOAD, TOKYO, V100S );
        Delivery delivery = new BuildDeliverySnapshot( cargo, handlingEvent ).get();
        cargo.delivery().set( delivery );

        assertThat( delivery.isMisdirected().get(), is( equalTo( true ) ) );
        assertThat( delivery.nextExpectedHandlingEvent().get(), is( equalTo( null ) ) );
        assertThat( delivery.eta().get(), is( equalTo( null ) ) );

        assertThat( delivery.routingStatus().get(), is( equalTo( RoutingStatus.ROUTED ) ) );
        assertThat( delivery.transportStatus().get(), is( equalTo( TransportStatus.IN_PORT ) ) );
        assertThat( delivery.lastHandlingEvent().get(), is( equalTo( handlingEvent ) ) );
View Full Code Here

        // Old planned arrival time is still satisfying new deadline
        assertTrue( routeSpec.arrivalDeadline().get().after( itinerary.finalArrivalDate() ) );

        // We don't know what's next before a new itinerary has been chosen
        assertThat( delivery.nextExpectedHandlingEvent().get(), is( equalTo( null ) ) );
        assertThat( delivery.eta().get(), is( equalTo( null ) ) );

        // Cargo is still misdirected (in unexpected location) according to old itinerary
        assertThat( delivery.isMisdirected().get(), is( equalTo( true ) ) );
View Full Code Here

        // When a cargo is rerouted the (often misdirected) last handling event is flagged as disregarded
        // since it doesn't have to be part of the new itinerary (this isn't in the Citerus version).

        // We now expect the cargo to be loaded onto voyage V400S in Tokyo heading to Hamburg
        assertThat( delivery.isMisdirected().get(), is( equalTo( false ) ) );
        assertThat( delivery.nextExpectedHandlingEvent().get().handlingEventType().get(), is( equalTo( LOAD ) ) );
        assertThat( delivery.nextExpectedHandlingEvent().get().location().get(), is( equalTo( TOKYO ) ) );
        assertThat( delivery.nextExpectedHandlingEvent().get().voyage().get(), is( equalTo( V400S ) ) );

        // Cargo is not misdirected anymore according to new itinerary. Cargo location is now expected to be in Tokyo.
    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.