Package org.jboss.seam.example.seambay

Examples of org.jboss.seam.example.seambay.Auction


         }
        
         @Override
         protected void renderResponse()
         {
            Auction auction = (Auction) getValue("#{auctionAction.auction}");
            assert auction != null;
         }
      }.run();
           
      new FacesRequest("/sell.xhtml", cid)
      {
         @Override
         protected void updateModelValues() throws Exception
         {
            setValue("#{auctionAction.auction.title}", "A Widget");
         }
      }.run();
     
     
      new FacesRequest("/sell2.xhtml", cid)
      {
         @Override
         protected void updateModelValues() throws Exception
         {
            List<Category> categories = (List<Category>) getValue("#{allCategories}");
           
            setValue("#{auctionAction.auction.category}", categories.get(0));
         }
      }.run();     
     
      new FacesRequest("/sell3.xhtml", cid)
      {
         @Override
         protected void updateModelValues() throws Exception
         {
            setValue("#{auctionAction.duration}", 3);
            setValue("#{auctionAction.auction.startingPrice}", 100.0);
         }
        
      }.run();
     
      new FacesRequest("/sell5.xhtml", cid)
      {
         @Override
         protected void updateModelValues() throws Exception
         {
            setValue("#{auctionAction.auction.description}", "foo");
         }        
      }.run();     
     
      new FacesRequest("/preview.xhtml", cid)
      {
         @Override
         protected void invokeApplication() throws Exception
         {
            Auction auction = (Auction) getValue("#{auctionAction.auction}");
            invokeAction("#{auctionAction.confirm}");
            assert auction.getStatus() == Auction.STATUS_LIVE;
         }        
      }.run();
     
      new FacesRequest()
      {
View Full Code Here


            setValue("#{auctionAction.auction.title}", "BidTestZZZ");
            setValue("#{auctionAction.auction.startingPrice}", 1);        
            setValue("#{auctionAction.auction.description}", "bar");
            setValue("#{auctionAction.categoryId}", 1001);
           
            Auction auction = (Auction) getValue("#{auctionAction.auction}");

            assert auction.getStatus() == Auction.STATUS_UNLISTED;
           
            invokeAction("#{auctionAction.confirm}");
           
            assert auction.getStatus() == Auction.STATUS_LIVE;           
            assert auction.getHighBid() == null;
         }
      }.run();     
     
      new FacesRequest()
      {
         @Override
         protected void updateModelValues() throws Exception
         {
            setValue("#{auctionSearch.searchTerm}", "BidTestZZZ");
         }
        
         @Override
         protected void invokeApplication() throws Exception
         {
            assert invokeAction("#{auctionSearch.queryAuctions}") == null;
         }
        
         @Override
         protected void renderResponse() throws Exception
         {
            DataModel auctions = (DataModel) Contexts.getSessionContext().get("auctions");
            assert auctions.getRowCount() == 1;
            Auction auction = ((Auction) auctions.getRowData());
            assert auction.getTitle().equals("BidTestZZZ");
            assert auction.getHighBid() == null;
         }
        
      }.run();
        
      new FacesRequest()
      {
         @Override
         protected void invokeApplication() throws Exception
         {
            Contexts.getEventContext().set("auction", getValue("#{auctionSearch.auctions[0]}"));
           
            assert invokeAction("#{bidAction.placeBid}") == null;
            assert getValue("#{bidAction.outcome}").equals("required");
            Contexts.getEventContext().set("bidAmount", "5.00");
           
            assert invokeAction("#{bidAction.placeBid}") == null;
            assert getValue("#{bidAction.outcome}").equals("confirm");
           
            assert invokeAction("#{bidAction.confirmBid}").equals("success");
         }
      }.run();
     
      new FacesRequest()
      {
         @Override
         protected void invokeApplication() throws Exception
         {
            assert invokeAction("#{auctionSearch.queryAuctions}") == null;
         }
        
         protected void renderResponse() throws Exception
         {
            DataModel auctions = (DataModel) Contexts.getSessionContext().get("auctions");
            Auction auction = ((Auction) auctions.getRowData());
            assert auction.getHighBid() != null;
         }
      }.run();
     
     
   }
View Full Code Here

TOP

Related Classes of org.jboss.seam.example.seambay.Auction

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.