@Test public void processTest() throws AvroRemoteException { RTBRequestWrapper wReq = new RTBRequestWrapper(request); RTBExchange exchange = new RTBExchange("BigAdExchange", "http: List<String> categories = new ArrayList<String>(); categories.add("cat1"); Map<String, String> seats = new HashMap<String, String>(); seats.put("BigAdExchange", "151"); seats.put("SmallAdExchange", "102"); RTBAdvertiser adv = new RTBAdvertiser("AdversiderPage", "BigIndia", "http: Map<String, RTBAdvertiser> advertisers = new HashMap<String, RTBAdvertiser>(); advertisers.put(adv.getLandingPage(), adv); long reqTimeout = 5000; long offerTimeout = 6000; wReq.setContext(exchange, advertisers, reqTimeout, offerTimeout); BidResponse response = bidder.process(wReq); assertNotNull("Response should not be empty ", response); }
@Override public BidResponse process(BidRequest request) throws AvroRemoteException { RTBRequestWrapper transaction = (RTBRequestWrapper) request; TSMController controller = new TSMController(this, transaction); transactions.put(transaction.getSSPName(), controller); try { controller.exec(TSMStates.TXN_CLOSED); } catch (Exception e) { logger.error("StatefulBidder: Exception in process method : " + StringUtils.stackTraceToString(e)); throw new AvroRemoteException(e.getMessage()); } return controller.response; }
StatefulBidder implements OpenRTBAPI { @Override public BidResponse process(BidRequest request) throws AvroRemoteException { RTBRequestWrapper transaction = (RTBRequestWrapper) request; TSMController controller = new TSMController(this, transaction); transactions.put(transaction.getSSPName(), controller); try { controller.exec(TSMStates.TXN_CLOSED); } catch (Exception e) { logger.error("StatefulBidder: Exception in process method : " + StringUtils.stackTraceToString(e)); throw new AvroRemoteException(e.getMessage()); } return controller.response; } }
StatefulBidder implements OpenRTBAPI { @Override public BidResponse process(BidRequest request) throws AvroRemoteException { RTBRequestWrapper transaction = (RTBRequestWrapper) request; TSMController controller = new TSMController(this, transaction); transactions.put(transaction.getSSPName(), controller); try { controller.exec(TSMStates.TXN_CLOSED); } catch (Exception e) { logger.error("StatefulBidder: Exception in process method : " + StringUtils.stackTraceToString(e)); throw new AvroRemoteException(e.getMessage()); } return controller.response; } StatefulBidder(); }
StatefulBidder implements OpenRTBAPI { @Override public BidResponse process(BidRequest request) throws AvroRemoteException { RTBRequestWrapper transaction = (RTBRequestWrapper) request; TSMController controller = new TSMController(this, transaction); transactions.put(transaction.getSSPName(), controller); try { controller.exec(TSMStates.TXN_CLOSED); } catch (Exception e) { logger.error("StatefulBidder: Exception in process method : " + StringUtils.stackTraceToString(e)); throw new AvroRemoteException(e.getMessage()); } return controller.response; } StatefulBidder(); boolean validateRequest(BidRequest request); BidResponse selectBids(RTBRequestWrapper wReq, BidResponse response); @Override BidResponse process(BidRequest request); }
StatefulBidder implements OpenRTBAPI { @Override public BidResponse process(BidRequest request) throws AvroRemoteException { RTBRequestWrapper transaction = (RTBRequestWrapper) request; TSMController controller = new TSMController(this, transaction); transactions.put(transaction.getSSPName(), controller); try { controller.exec(TSMStates.TXN_CLOSED); } catch (Exception e) { logger.error("StatefulBidder: Exception in process method : " + StringUtils.stackTraceToString(e)); throw new AvroRemoteException(e.getMessage()); } return controller.response; } StatefulBidder(); boolean validateRequest(BidRequest request); BidResponse selectBids(RTBRequestWrapper wReq, BidResponse response); @Override BidResponse process(BidRequest request); static final FSMTransition<TSMStates, String> EV_NEWREQUEST; }