Package com.apps.services

Examples of com.apps.services.SaveonbookService


public class SaveonbookSearchServiceTest {

  @Test
  public void test() {
   
    SaveonbookService sss = SaveonBookServiceFactory.getSaveonbookService();
    BookInformation testbi = new BookInformation("Discrete Mathematics W/Applications 4/E", "Required", "EPP", "9780495391326");

    List<SaveonBookModel> sbml1 =  sss.search(testbi);
    List<SaveonBookModel> sbml2 =  sss.titleSearch("Discrete Mathematics with Applications");
   
    assertTrue(sbml2.get(0).getCourse().equals(">CPSC121"));
   
    assertTrue(sss.getOptimizedTitle(testbi).equals("Discrete Mathematics with Applications"));
   
    assertTrue(sss.getPriceRange(sbml1)[0] == 49 && sss.getPriceRange(sbml1)[1] == 180);

   
 
 
  }
View Full Code Here


import com.apps.services.SaveonbookService;

public class SaveonBookServiceFactory {
 
  public static SaveonbookService getSaveonbookService(){
    return new SaveonbookService();
  }
View Full Code Here

    out += "Books: \n";
    out += "</tr>\n";
    }
    for(Iterator<BookInformation> i = biol.iterator(); i.hasNext();){
      BookInformation bio = i.next();
      SaveonbookService sbss = SaveonBookServiceFactory.getSaveonbookService();
      String optimizedTitle = sbss.getOptimizedTitle(bio);
      String searchTitle = optimizedTitle.replaceAll(" ", "%20");
      out += "<tr>\n";
      out += "<table>\n";
      out += "<tr>\n";
      out += "<a href=\"http://saveonbook.com/search/title-search.jsp?title="+searchTitle+"&active=0\">SaveOnBook</a>";
      out += "</tr>\n";
      out += "<tr>\n";
      out += "<td><b>Title: </b>"+bio.getTitle()+" - "+bio.getRequired()+"</td>\n";
      int pr[] = sbss.getPriceRange(sbss.titleSearch(optimizedTitle));
      out += "<td><b>Price Range </b>: $"+pr[0]+" - $"+pr[1]+"</td>\n";
      out += "</tr>\n";
      out += "</table>\n";
      out += "</tr>\n";
    }
View Full Code Here

TOP

Related Classes of com.apps.services.SaveonbookService

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.