Examples of TrackingId


Examples of com.google.gerrit.reviewdb.client.TrackingId

            }
            if (idstr.length() > TrackingId.TRACKING_ID_MAX_CHAR) {
              continue;
            }

            want.add(new TrackingId(change.getId(), idstr, footer.system()));
          }
        }
      }
    }
View Full Code Here

Examples of org.qi4j.sample.dcicargo.sample_a.data.shipping.cargo.TrackingId

    }

    @Test
    public void deviation_3c_CargoNotRoutedYet() throws Exception
    {
        TrackingId nonRoutedTrackingId = new BookNewCargo( CARGOS, HONGKONG, STOCKHOLM, day( 17 ) ).createCargo( "NonRoutedCargo" );
        String nonRouted = nonRoutedTrackingId.id().get();

        msg = register( time, time, nonRouted, "RECEIVE", "CNHKG", null );
        assertThat( msg, is( equalTo( "Can't create handling event for non-routed cargo '" + nonRouted + "'." ) ) );
    }
View Full Code Here

Examples of org.qi4j.sample.dcicargo.sample_a.data.shipping.cargo.TrackingId

        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() );

        // Test cargo data
        assertThat( cargo.trackingId().get(), is( equalTo( trackingId ) ) );
        assertThat( cargo.origin().get(), is( equalTo( HONGKONG ) ) );
View Full Code Here

Examples of org.qi4j.sample.dcicargo.sample_a.data.shipping.cargo.TrackingId

    {
        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

Examples of org.qi4j.sample.dcicargo.sample_a.data.shipping.cargo.TrackingId

        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() );

        // Step 3 - Find possible routes
        List<Itinerary> routeCandidates = new BookNewCargo( cargo ).routeCandidates();

        // Check possible routes
View Full Code Here

Examples of org.qi4j.sample.dcicargo.sample_a.data.shipping.cargo.TrackingId

        Location STOCKHOLM = uow.get( Location.class, SESTO.code().get() );
        Cargos CARGOS = uow.get( Cargos.class, CargosEntity.CARGOS_ID );

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

        List<Itinerary> routeCandidates = new BookNewCargo( cargo ).routeCandidates();

        // Get first route found
        // Would normally be found with an Itinerary id from customer selection
View Full Code Here

Examples of org.qi4j.sample.dcicargo.sample_a.data.shipping.cargo.TrackingId

                protected void onSubmit( AjaxRequestTarget target, Form<?> form )
                {
                    try
                    {
                        // Perform use case
                        TrackingId trackingId = new BookNewCargo( origin, destination, deadline ).book();

                        // Add new tracking id to list in session
                        PrevNext.addId( Session.get(), trackingId.id().get() );

                        // Show created cargo
                        setResponsePage( CargoDetailsPage.class, new PageParameters().set( 0, trackingId.id().get() ) );
                    }
                    catch( Exception e )
                    {
                        logger.warn( "Problem booking a new cargo: " + e.getMessage() );
                        feedback.error( e.getMessage() );
View Full Code Here

Examples of org.qi4j.sample.dcicargo.sample_b.data.structure.tracking.TrackingId

                protected void onSubmit( AjaxRequestTarget target, Form<?> form )
                {
                    try
                    {
                        // Perform use case
                        TrackingId trackingId = new BookNewCargo( origin, destination, deadline ).getTrackingId();

                        // Add new tracking id to list in session
                        PrevNext.addId( Session.get(), trackingId.id().get() );

                        // Show created cargo
                        setResponsePage( CargoDetailsPage.class, new PageParameters().set( 0, trackingId.id().get() ) );
                    }
                    catch( Exception e )
                    {
                        logger.warn( "Problem booking a new cargo: " + e.getMessage() );
                        feedback.error( e.getMessage() );
View Full Code Here

Examples of org.qi4j.sample.dcicargo.sample_b.data.structure.tracking.TrackingId

            public HandlingEvent registerAndGetHandlingEvent()
                throws CannotRegisterHandlingEventException
            {
                UnitOfWork uow = uowf.currentUnitOfWork();
                TrackingId trackingId;
                Location location;
                Voyage voyage = null;

                // Step 1 - Find Cargo from tracking id string
                try
View Full Code Here

Examples of org.qi4j.sample.dcicargo.sample_b.data.structure.tracking.TrackingId

        ValueBuilderFactory vbf;

        public Cargo createCargo( RouteSpecification routeSpecification, Delivery delivery, String id )
            throws ConstraintViolationException, CannotCreateCargoException
        {
            TrackingId trackingId = buildTrackingId( id );

            UnitOfWork uow = uowf.currentUnitOfWork();
            EntityBuilder<Cargo> cargoBuilder = uow.newEntityBuilder( Cargo.class, trackingId.id().get() );
            cargoBuilder.instance().trackingId().set( trackingId );
            cargoBuilder.instance().origin().set( routeSpecification.origin().get() );
            cargoBuilder.instance().routeSpecification().set( routeSpecification );
            cargoBuilder.instance().delivery().set( delivery );
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.