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

Examples of org.qi4j.sample.dcicargo.sample_a.data.shipping.cargo.Cargos$Mixin


        V200T = uow.get( Voyage.class, "V200T" );
        V300A = uow.get( Voyage.class, "V300A" );
        V400S = uow.get( Voyage.class, "V400S" );
        V500S = uow.get( Voyage.class, "V500S" );

        Cargos CARGOS = uow.get( Cargos.class, CargosEntity.CARGOS_ID );
        trackingId = new BookNewCargo( CARGOS, HONGKONG, STOCKHOLM, day( 17 ) ).createCargo( "ABC" );
        cargo = uow.get( Cargo.class, trackingId.id().get() );

        itinerary = itinerary(
            leg( V100S, HONGKONG, NEWYORK, day( 1 ), day( 8 ) ),
View Full Code Here


    {
        deviation_2c_ItineraryIsUnknown_buildFromRouteSpecification();

        UnitOfWork uow = module.currentUnitOfWork();
        RouteSpecification routeSpec = routeSpecification( HONGKONG, STOCKHOLM, day( 20 ) );
        Cargos CARGOS = uow.get( Cargos.class, CargosEntity.CARGOS_ID );
        Delivery delivery = new BuildDeliverySnapshot( routeSpec ).get();
        Cargo cargo = CARGOS.createCargo( routeSpec, delivery, "ABCD" );

        // Same as previous test (just build from cargo instead)
        assertThat( delivery.timestamp().get().after( TODAY ), is( equalTo( true ) ) ); // TODAY is set first
        assertThat( delivery.routingStatus().get(), is( equalTo( RoutingStatus.NOT_ROUTED ) ) );
        assertThat( delivery.transportStatus().get(), is( equalTo( TransportStatus.NOT_RECEIVED ) ) );
View Full Code Here

    @Test( expected = RouteException.class )
    public void deviation2a_OriginAndDestinationSame() throws Exception
    {
        UnitOfWork uow = module.currentUnitOfWork();
        Location HONGKONG = uow.get( Location.class, CNHKG.code().get() );
        Cargos CARGOS = uow.get( Cargos.class, CargosEntity.CARGOS_ID );
        new BookNewCargo( CARGOS, HONGKONG, HONGKONG, day( 17 ) ).book();
    }
View Full Code Here

    public void deviation_2b_1_DeadlineInThePastNotAccepted() throws Exception
    {
        UnitOfWork uow = module.currentUnitOfWork();
        Location HONGKONG = uow.get( Location.class, CNHKG.code().get() );
        Location STOCKHOLM = uow.get( Location.class, SESTO.code().get() );
        Cargos CARGOS = uow.get( Cargos.class, CargosEntity.CARGOS_ID );
        new BookNewCargo( CARGOS, HONGKONG, STOCKHOLM, day( -1 ) ).book();
    }
View Full Code Here

    public void deviation_2b_2_DeadlineTodayIsTooEarly() throws Exception
    {
        UnitOfWork uow = module.currentUnitOfWork();
        Location HONGKONG = uow.get( Location.class, CNHKG.code().get() );
        Location STOCKHOLM = uow.get( Location.class, SESTO.code().get() );
        Cargos CARGOS = uow.get( Cargos.class, CargosEntity.CARGOS_ID );
        new BookNewCargo( CARGOS, HONGKONG, STOCKHOLM, day( 0 ) ).book();
    }
View Full Code Here

    public void deviation_2b_3_DeadlineTomorrowIsOkay() throws Exception
    {
        UnitOfWork uow = module.currentUnitOfWork();
        Location HONGKONG = uow.get( Location.class, CNHKG.code().get() );
        Location STOCKHOLM = uow.get( Location.class, SESTO.code().get() );
        Cargos CARGOS = uow.get( Cargos.class, CargosEntity.CARGOS_ID );
        new BookNewCargo( CARGOS, HONGKONG, STOCKHOLM, day( 1 ) ).book();
    }
View Full Code Here

    public void step_2_CreateNewCargo() throws Exception
    {
        UnitOfWork uow = module.currentUnitOfWork();
        Location HONGKONG = uow.get( Location.class, CNHKG.code().get() );
        Location STOCKHOLM = uow.get( Location.class, SESTO.code().get() );
        Cargos CARGOS = uow.get( Cargos.class, CargosEntity.CARGOS_ID );
        // Create cargo with valid input from customer
        TrackingId trackingId = new BookNewCargo( CARGOS, HONGKONG, STOCKHOLM, day( 17 ) ).book();

        // Retrieve created cargo from store
        Cargo cargo = uow.get( Cargo.class, trackingId.id().get() );
View Full Code Here

    @Before
    public void beforeEachTest()
        throws Exception
    {
        UnitOfWork uow = module.currentUnitOfWork();
        Cargos CARGOS = uow.get( Cargos.class, CargosEntity.CARGOS_ID );
        Location HONGKONG = uow.get( Location.class, CNHKG.code().get() );
        SHANGHAI = uow.get( Location.class, CNSHA.code().get() );
        STOCKHOLM = uow.get( Location.class, SESTO.code().get() );
        Location NEWYORK = uow.get( Location.class, USNYC.code().get() );
        DALLAS = uow.get( Location.class, USDAL.code().get() );
View Full Code Here

    public void deviation_3a_NoRoutesCanBeThatFast() throws Exception
    {
        UnitOfWork uow = module.currentUnitOfWork();
        Location HONGKONG = uow.get( Location.class, CNHKG.code().get() );
        Location STOCKHOLM = uow.get( Location.class, SESTO.code().get() );
        Cargos CARGOS = uow.get( Cargos.class, CargosEntity.CARGOS_ID );
        TrackingId trackingId = new BookNewCargo( CARGOS, HONGKONG, STOCKHOLM, day( 1 ) ).book();
        Cargo cargo = uow.get( Cargo.class, trackingId.id().get() );

        // No routes will be found
        new BookNewCargo( cargo ).routeCandidates();
View Full Code Here

    public void step_3_CalculatePossibleRoutes() throws Exception
    {
        UnitOfWork uow = module.currentUnitOfWork();
        Location HONGKONG = uow.get( Location.class, CNHKG.code().get() );
        Location STOCKHOLM = uow.get( Location.class, SESTO.code().get() );
        Cargos CARGOS = uow.get( Cargos.class, CargosEntity.CARGOS_ID );

        // Create valid cargo
        TrackingId trackingId = new BookNewCargo( CARGOS, HONGKONG, STOCKHOLM, day( 30 ) ).book();
        Cargo cargo = uow.get( Cargo.class, trackingId.id().get() );
View Full Code Here

TOP

Related Classes of org.qi4j.sample.dcicargo.sample_a.data.shipping.cargo.Cargos$Mixin

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.