Examples of BookNewCargo


Examples of org.qi4j.sample.dcicargo.sample_b.context.interaction.booking.BookNewCargo

        throws Exception
    {
        try
        {
            thrown.expect( CannotCreateRouteSpecificationException.class, "Origin location can't be same as destination location." );
            new BookNewCargo( CARGOS, HONGKONG, HONGKONG, DAY24 ).getTrackingId();
        }
        catch( Exception ex )
        {
            ex.printStackTrace();
            throw ex;
View Full Code Here

Examples of org.qi4j.sample.dcicargo.sample_b.context.interaction.booking.BookNewCargo

    public void deviation_2b_DeadlineInThePastNotAccepted()
        throws Exception
    {
        deviation_2a_OriginAndDestinationSame();
        thrown.expect( CannotCreateRouteSpecificationException.class, "Arrival deadline is in the past or Today." );
        new BookNewCargo( CARGOS, HONGKONG, STOCKHOLM, day( -1 ) ).getTrackingId();
    }
View Full Code Here

Examples of org.qi4j.sample.dcicargo.sample_b.context.interaction.booking.BookNewCargo

    public void deviation_2b_DeadlineTodayIsTooEarly()
        throws Exception
    {
        deviation_2b_DeadlineInThePastNotAccepted();
        thrown.expect( CannotCreateRouteSpecificationException.class, "Arrival deadline is in the past or Today." );
        new BookNewCargo( CARGOS, HONGKONG, STOCKHOLM, day( 0 ) ).getTrackingId();
    }
View Full Code Here

Examples of org.qi4j.sample.dcicargo.sample_b.context.interaction.booking.BookNewCargo

    @Test
    public void deviation_2b_DeadlineTomorrowIsOkay()
        throws Exception
    {
        deviation_2b_DeadlineTodayIsTooEarly();
        new BookNewCargo( CARGOS, HONGKONG, STOCKHOLM, DAY1 ).getTrackingId();
    }
View Full Code Here

Examples of org.qi4j.sample.dcicargo.sample_b.context.interaction.booking.BookNewCargo

    public void step_2_CanCreateRouteSpecification()
        throws Exception
    {
        deviation_2b_DeadlineTomorrowIsOkay();
        UnitOfWork uow = module.currentUnitOfWork();
        trackingId = new BookNewCargo( CARGOS, HONGKONG, STOCKHOLM, DAY24 ).getTrackingId();
        cargo = uow.get( CargoEntity.class, trackingId.id().get() );
        assertThat( cargo.routeSpecification().get().origin().get(), is( equalTo( HONGKONG ) ) );
        assertThat( cargo.routeSpecification().get().destination().get(), is( equalTo( STOCKHOLM ) ) );
        assertThat( cargo.routeSpecification().get().arrivalDeadline().get(), is( equalTo( DAY24 ) ) );
    }
View Full Code Here

Examples of org.qi4j.sample.dcicargo.sample_b.context.interaction.booking.BookNewCargo

    public void step_3_CanDeriveInitialDeliveryData()
        throws Exception
    {
        step_2_CanCreateRouteSpecification();
        UnitOfWork uow = module.currentUnitOfWork();
        trackingId = new BookNewCargo( CARGOS, HONGKONG, STOCKHOLM, DAY24 ).getTrackingId();
        cargo = uow.get( CargoEntity.class, trackingId.id().get() );
        assertDelivery( null, null, null, null,
                        NOT_RECEIVED, notArrived,
                        NOT_ROUTED, directed, unknownETA, unknownLeg,
                        RECEIVE, HONGKONG, noSpecificDate, noVoyage );
View Full Code Here

Examples of org.qi4j.sample.dcicargo.sample_b.context.interaction.booking.BookNewCargo

    public void deviation_4a_TrackingIdTooShort()
        throws Exception
    {
        step_3_CanDeriveInitialDeliveryData();
        thrown.expect( ConstraintViolationException.class, "for value 'no'" );
        new BookNewCargo( CARGOS, HONGKONG, STOCKHOLM, DAY24 ).withTrackingId( "no" );
    }
View Full Code Here

Examples of org.qi4j.sample.dcicargo.sample_b.context.interaction.booking.BookNewCargo

    public void deviation_4a_TrackingIdNotTooShort()
        throws Exception
    {
        deviation_4a_TrackingIdTooShort();
        UnitOfWork uow = module.currentUnitOfWork();
        trackingId = new BookNewCargo( CARGOS, HONGKONG, STOCKHOLM, DAY24 ).withTrackingId( "yes" );
        cargo = uow.get( CargoEntity.class, trackingId.id().get() );
        assertThat( cargo.trackingId().get().id().get(), is( equalTo( "yes" ) ) );
    }
View Full Code Here

Examples of org.qi4j.sample.dcicargo.sample_b.context.interaction.booking.BookNewCargo

    public void deviation_4a_TrackingIdTooLong()
        throws Exception
    {
        deviation_4a_TrackingIdNotTooShort();
        thrown.expect( ConstraintViolationException.class, "for value '1234567890123456789012345678901'" );
        new BookNewCargo( CARGOS, HONGKONG, STOCKHOLM, DAY24 ).withTrackingId( "1234567890123456789012345678901" );
    }
View Full Code Here

Examples of org.qi4j.sample.dcicargo.sample_b.context.interaction.booking.BookNewCargo

    public void deviation_4a_TrackingIdNotTooLong()
        throws Exception
    {
        deviation_4a_TrackingIdTooLong();
        UnitOfWork uow = module.currentUnitOfWork();
        trackingId = new BookNewCargo( CARGOS, HONGKONG, STOCKHOLM, DAY24 ).withTrackingId( "123456789012345678901234567890" );
        cargo = uow.get( CargoEntity.class, trackingId.id().get() );
        assertThat( cargo.trackingId().get().id().get(), is( equalTo( "123456789012345678901234567890" ) ) );
    }
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.