Examples of Flight


Examples of jodd.json.mock.superhero.Flight

    return new Hero("Super Man",
        new SecretIdentity("Clark Kent"),
        new SecretLair("Fortress of Solitude"),
        new XRayVision(0.8f),
        new HeatVision(0.7f),
        new Flight(1000.0f),
        new Invincible());
  }
View Full Code Here

Examples of org.glassfish.jersey.examples.flight.model.Flight

    @DELETE
    @Path("{id}")
    @Produces(TEXT_PLAIN)
    @RolesAllowed("admin")
    public String delete(@ValidAircraftId @PathParam("id") Integer id) {
        Flight flight = DataStore.selectFlightByAircraft(id);
        if (flight != null) {
            throw new BadRequestException("Aircraft assigned to a flight.");
        }

        Aircraft aircraft = DataStore.removeAircraft(id);
View Full Code Here

Examples of org.hibernate.test.annotations.Flight

  public void testCreate() throws Exception {
    Session s;
    Transaction tx;
    s = openSession();
    tx = s.beginTransaction();
    Flight firstOne = new Flight();
    firstOne.setId( new Long( 1 ) );
    firstOne.setName( "AF0101" );
    firstOne.setDuration( new Long( 1000 ) );
    Company frenchOne = new Company();
    frenchOne.setName( "Air France" );
    firstOne.setCompany( frenchOne );
    s.persist( firstOne );
    tx.commit();
    s.close();
    assertNotNull( "identity id should work", frenchOne.getId() );

    s = openSession();
    tx = s.beginTransaction();
    firstOne = (Flight) s.get( Flight.class, new Long( 1 ) );
    assertNotNull( firstOne.getCompany() );
    assertEquals( frenchOne.getName(), firstOne.getCompany().getName() );
    tx.commit();
    s.close();
  }
View Full Code Here

Examples of org.jboss.as.test.integration.jpa.hibernate.entity.Flight

    @Test
    public void testManyToOne() throws Exception {

        EntityTest test = lookup("EntityTest", EntityTest.class);
        Flight f = test.manyToOneCreate();

        Flight f2 = test.findFlightById(f.getId());

        assertEquals(f.getId(), new Long(1));

        assertEquals(f.getName(), f2.getName());
        assertEquals(f.getCompany().getName(), f2.getCompany().getName());

        Company c = test.findCompanyById(f.getCompany().getId());
        assertNotNull("Company has one flight.", c.getFlights());
        assertEquals(f.getCompany().getFlights().size(), c.getFlights().size());
View Full Code Here

Examples of org.jboss.as.test.integration.jpa.hibernate.entity.Flight

    public void testManyToMany() throws Exception {

        EntityTest test = lookup("EntityTest", EntityTest.class);
        test.manyToManyCreate();

        Flight f1 = test.findFlightById(new Long(1));
        assertTrue("Name read from Hibernate is Airline 1", f1.getCompany().getName().equals("Airline 1"));

        Flight f2 = test.findFlightById(new Long(2));
        assertTrue("Name read from Hibernate is Airline 1", f2.getCompany().getName().equals("Airline 2"));

        assertEquals(1, f1.getCustomers().size());
        assertEquals(2, f2.getCustomers().size());

    }
View Full Code Here

Examples of org.jboss.test.jpa.entity.Flight

   }

   public void testManyToOne() throws Exception
   {
      EntityTest test = (EntityTest) this.getInitialContext().lookup("EntityTestBean/remote");
      Flight f = test.manyToOneCreate();
      f = test.findFlightById(f.getId());
      assertTrue(f.getName().equals("AF0101"));
      assertTrue(f.getCompany().getName().equals("Air France"));

      Company c = test.findCompanyById(f.getCompany().getId());
      assertTrue(c != null);
      assertTrue(c.getFlights().size() == 1);
   }
View Full Code Here

Examples of org.jboss.test.jpa.entity.Flight

   public void testManyToMany() throws Exception
   {
      EntityTest test = (EntityTest) this.getInitialContext().lookup("EntityTestBean/remote");
      test.manyToManyCreate();

      Flight one = test.findFlightById(new Long(1));
      assertTrue(one.getCompany().getName().equals("Air France"));

      Flight two = test.findFlightById(new Long(2));
      assertTrue(two.getCompany().getName().equals("USAir"));

      System.out.println("Air France customers");
      for (Customer c : one.getCustomers())
      {
         System.out.println(c.getName());

      }
      System.out.println("USAir customers");

      for (Customer c : two.getCustomers())
      {
         System.out.println(c.getName());
      }

   }
View Full Code Here

Examples of org.jboss.tutorial.composite.bean.Flight

   {
      InitialContext ctx = new InitialContext();
      EntityTest test = (EntityTest) ctx.lookup("EntityTestBean/remote");
      test.manyToManyCreate();

      Flight one = test.findFlightById(new Long(1));

      Flight two = test.findFlightById(new Long(2));

      System.out.println("Air France customers");
      for (Customer c : one.getCustomers())
      {
         System.out.println(c.getName());

      }
      System.out.println("USAir customers");

      for (Customer c : two.getCustomers())
      {
         System.out.println(c.getName());
      }

   }
View Full Code Here

Examples of org.jboss.tutorial.relationships.bean.Flight

   {
      InitialContext ctx = new InitialContext();
      EntityTest test = (EntityTest) ctx.lookup("EntityTestBean/remote");
      test.manyToManyCreate();

      Flight one = test.findFlightById(new Long(1));

      Flight two = test.findFlightById(new Long(2));

      System.out.println("Air France customers");
      for (Customer c : one.getCustomers())
      {
         System.out.println(c.getName());

      }
      System.out.println("USAir customers");

      for (Customer c : two.getCustomers())
      {
         System.out.println(c.getName());
      }

   }
View Full Code Here

Examples of siia.booking.domain.flight.Flight

    @Autowired
    TripRepository mockedTripRepository;

    @Test
    public void shouldEnrichHeaderAndSendMessageForRelatedTrips() {
        final Flight flight = mock(Flight.class);
        final FlightNotification notification = new FlightNotification("Flight has been cancelled", flight);
        final Message<FlightNotification> testMessage = MessageBuilder.withPayload(notification).build();
        Trip trip1 = mock(Trip.class);
        Trip trip2 = mock(Trip.class);
        List<Trip> relatedTrips = asList(trip1, trip2);
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.