Package org.jboss.seam.example.booking

Examples of org.jboss.seam.example.booking.HotelBooking


      final String id = new FacesRequest("/main.xhtml") {
        
         @Override
         protected void invokeApplication()
         {
            HotelBooking hotelBooking = (HotelBooking) getInstance("hotelBooking");
            DataModel hotels = (DataModel) Contexts.getSessionContext().get("hotels");
            assert hotels.getRowCount()==1;
            hotelBooking.selectHotel( (Hotel) hotels.getRowData() );
         }

         @Override
         protected void renderResponse()
         {
View Full Code Here


     
      String id = new FacesRequest("/main.xhtml") {
        
         @Override
         protected void invokeApplication() throws Exception {
            HotelBooking hotelBooking = (HotelBooking) getInstance("hotelBooking");
            DataModel hotels = (DataModel) Contexts.getSessionContext().get("hotels");
            assert hotels.getRowCount()==1;
            hotelBooking.selectHotel( (Hotel) hotels.getRowData() );
         }

         @Override
         protected void renderResponse()
         {
View Full Code Here

     
      String id = new FacesRequest("/main.xhtml") {
        
         @Override
         protected void invokeApplication() throws Exception {
            HotelBooking hotelBooking = (HotelBooking) getInstance("hotelBooking");
            DataModel hotels = (DataModel) Contexts.getSessionContext().get("hotels");
            assert hotels.getRowCount()==1;
            hotelBooking.selectHotel( (Hotel) hotels.getRowData() );
         }

         @Override
         protected void renderResponse()
         {
View Full Code Here

      String id = new NonFacesRequest("/hotel.xhtml") {

         @Override
         protected void renderResponse()
         {
            HotelBooking hotelBooking = (HotelBooking) getInstance("hotelBooking");
            DataModel hotels = (DataModel) Contexts.getSessionContext().get("hotels");
            assert hotels.getRowCount()==1;
            String outcome = hotelBooking.selectHotel( (Hotel) hotels.getRowData() );
            assert "hotel".equals(outcome);
            Hotel hotel = (Hotel) Contexts.getConversationContext().get("hotel");
            assert hotel.getCity().equals("NY");
            assert hotel.getZip().equals("10011");
            assert Manager.instance().isLongRunningConversation();
View Full Code Here

      EntityManagerFactory emf = Persistence.createEntityManagerFactory("bookingDatabase");
      final EntityManager em = emf.createEntityManager();
     
      Hotel hotel =  em.getReference(Hotel.class, 1l);
     
      HotelBooking hb = new HotelBookingAction();
     
      setField(hb, "em", em);
      //setField(hb, "hotelSearch", hs);
      setField(hb, "user", em.getReference(User.class, "gavin"));
      setField(hb, "facesMessages", new FacesMessages());
      setField(hb, "events", new Events() { @Override public void raiseEvent(String type, Object... params) { assert "bookingConfirmed".equals(type); } } );
      setField(hb, "log", Logging.getLog(HotelBookingAction.class));
     
      assert hb.selectHotel(hotel).equals("hotel");

      User user = em.getReference(User.class, "gavin");
      assert user!=null;
      assert hb.bookHotel().equals("book");
     
      Booking booking = (Booking) getField(hb, "booking");
      assert booking!=null;
      assert booking.getHotel()!=null;
      assert booking.getUser()!=null;
     
      booking.setCreditCard("1234123412341234");
      booking.setCreditCardName("GAVIN A KING");
     
      assert hb.setBookingDetails().equals("confirm");

      getUserTransaction().begin();
      assert hb.confirm().equals("confirmed");
      getUserTransaction().commit();
     
      em.close();
   }
View Full Code Here

     
      String id = new FacesRequest("/hotel.xhtml") {
        
         @Override
         protected void invokeApplication() throws Exception {
            HotelBooking hotelBooking = (HotelBooking) getInstance("hotelBooking");
            DataModel hotels = (DataModel) Contexts.getSessionContext().get("hotels");
            assert hotels.getRowCount()==1;
            hotelBooking.selectHotel( (Hotel) hotels.getRowData() );
         }

         @Override
         protected void renderResponse()
         {
View Full Code Here

TOP

Related Classes of org.jboss.seam.example.booking.HotelBooking

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.