Package org.qi4j.sample.dcicargo.sample_a.data.entity

Examples of org.qi4j.sample.dcicargo.sample_a.data.entity.HandlingEventsEntity


    public void deviation_4e_CLAIM_1a_CargoIsNotInDestinationPort() throws Exception
    {
        deviation_4d_CUSTOMS_1a_CargoIsInDestinationPort();

        UnitOfWork uow = module.currentUnitOfWork();
        HandlingEventsEntity HANDLING_EVENTS = uow.get( HandlingEventsEntity.class, HandlingEventsEntity.HANDLING_EVENTS_ID );

        // Cargo was claimed but not at destination location
        HandlingEvent handlingEvent = HANDLING_EVENTS.createHandlingEvent( day( 1 ), day( 16 ), trackingId, CLAIM, HELSINKI, null );
        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 ) ) );
View Full Code Here


    public void deviation_4e_CLAIM_1b_CargoIsInDestinationPort() throws Exception
    {
        deviation_4e_CLAIM_1a_CargoIsNotInDestinationPort();

        UnitOfWork uow = module.currentUnitOfWork();
        HandlingEventsEntity HANDLING_EVENTS = uow.get( HandlingEventsEntity.class, HandlingEventsEntity.HANDLING_EVENTS_ID );

        // Cargo was claimed by customer at destination location
        HandlingEvent handlingEvent = HANDLING_EVENTS.createHandlingEvent( day( 16 ), day( 16 ), trackingId, CLAIM, STOCKHOLM, null );
        Delivery delivery = new BuildDeliverySnapshot( cargo, handlingEvent ).get();

        assertThat( delivery.isMisdirected().get(), is( equalTo( false ) ) );
        assertThat( delivery.routingStatus().get(), is( equalTo( RoutingStatus.ROUTED ) ) );
        assertThat( delivery.transportStatus().get(), is( equalTo( TransportStatus.CLAIMED ) ) );
View Full Code Here

    public void deviation_3a_CargoIsMisdirected()
        throws Exception
    {
        // Create misdirected handling event for cargo (receipt in Shanghai is unexpected)
        UnitOfWork uow = module.currentUnitOfWork();
        HandlingEventsEntity HANDLING_EVENTS = uow.get( HandlingEventsEntity.class, HandlingEventsEntity.HANDLING_EVENTS_ID );
        handlingEvent = HANDLING_EVENTS.createHandlingEvent( day( 0 ), day( 0 ), trackingId, HandlingEventType.RECEIVE, SHANGHAI, null );
        Delivery delivery = new BuildDeliverySnapshot( cargo, handlingEvent ).get();
        cargo.delivery().set( delivery );
        assertThat( cargo.delivery().get().isMisdirected().get(), is( equalTo( true ) ) );

        logger.info( "  Handling cargo 'ABC' (misdirected):" );
View Full Code Here

    @Test
    public void deviation_3b_CargoHasArrived()
        throws Exception
    {
        UnitOfWork uow = module.currentUnitOfWork();
        HandlingEventsEntity HANDLING_EVENTS = uow.get( HandlingEventsEntity.class, HandlingEventsEntity.HANDLING_EVENTS_ID );
        handlingEvent = HANDLING_EVENTS.createHandlingEvent( day( 15 ), day( 15 ), trackingId, HandlingEventType.UNLOAD, STOCKHOLM, V300A );
        Delivery delivery = new BuildDeliverySnapshot( cargo, handlingEvent ).get();
        cargo.delivery().set( delivery );
        assertThat( cargo.delivery().get().isUnloadedAtDestination().get(), is( equalTo( true ) ) );

        logger.info( "  Handling cargo 'ABC' (arrived):" );
View Full Code Here

    public void step_3_CargoIsCorrectlyInTransit()
        throws Exception
    {
        logger.info( "  Handling cargo 'ABC' (unloaded in Dallas):" );
        UnitOfWork uow = module.currentUnitOfWork();
        HandlingEventsEntity HANDLING_EVENTS = uow.get( HandlingEventsEntity.class, HandlingEventsEntity.HANDLING_EVENTS_ID );
        handlingEvent = HANDLING_EVENTS.createHandlingEvent( day( 12 ), day( 12 ), trackingId, HandlingEventType.UNLOAD, DALLAS, V200T );
        cargo.delivery().set( new BuildDeliverySnapshot( cargo, handlingEvent ).get() );
        assertThat( cargo.delivery().get().isMisdirected().get(), is( equalTo( false ) ) );
        new InspectCargo( handlingEvent ).inspect();

        logger.info( "  Cargo was correctly directed." );
View Full Code Here

TOP

Related Classes of org.qi4j.sample.dcicargo.sample_a.data.entity.HandlingEventsEntity

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.