Package barrysoft.web

Examples of barrysoft.web.WebDownloader.download()


   
    WebDownloader downloader = new WebDownloader();
   
    try {
      downloader.setUrl("http://it.wikipedia.org/wiki/CSS_(informatica)");
      String source = new String(downloader.download());
     
      assertTrue(source.length() > 0);
    } catch (IOException e) {
      fail(e.getMessage());
    }
View Full Code Here


   
    WebDownloader downloader = new WebDownloader();
   
    try {
      downloader.setUrl("http://it.wikipedia.org/wiki/CSS_(informatica)");
      downloader.download(new File("test_page.html"));
     
      File f = new File("test_page.html");
     
      if (!f.exists())
        assertTrue("File doesn't exists", false);
View Full Code Here

   
    WebDownloader downloader = new WebDownloader();
   
    try {
      downloader.setUrl("http://www.barrysoft.it/SiteV3/Products.asp?ID=10");
      String source = new String(downloader.download());
     
      if (source.contains("Marathon Infinity"))
        assertTrue(true);
      else
        fail("Can't find the string:\n\n"+source);
View Full Code Here

    WebDownloader downloader = new WebDownloader();
    downloader.addFormElement("n", "215");
   
    try {
      downloader.setUrl(querySite);
      String source = new String(downloader.download());
     
      if (source.contains("Rome, Italy"))
        assertTrue(true);
      else
        fail("Can't find the string:\n\n"+source);
View Full Code Here

    downloader.addFormElement("lname", "Man");
    downloader.setMethod(WebDownloader.METHOD_POST);
   
    try {
      downloader.setUrl(postSite);
      String source = new String(downloader.download());
     
      if (source.contains("First name: \"Masked\""))
        assertTrue(true);
      else
        fail("Can't find the string:\n\n"+source);
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.