1 2 3 4 package net.nutch.protocol; 5 6 import java.io.*; 7 import java.util.Properties ; 8 import net.nutch.io.*; 9 import net.nutch.pagedb.*; 10 import junit.framework.TestCase; 11 12 13 14 public class TestContent extends TestCase { 15 public TestContent(String name) { super(name); } 16 17 public void testContent() throws Exception { 18 19 String page = "<HTML><BODY><H1>Hello World</H1><P>The Quick Brown Fox Jumped Over the Lazy Fox.</BODY></HTML>"; 20 21 String url = "http://www.foo.com/"; 22 23 Properties metaData = new Properties (); 24 metaData.put("Host", "www.foo.com"); 25 metaData.put("Content-Type", "text/html"); 26 27 Content r = new Content(url, url, page.getBytes("UTF8"), "text/html", 28 metaData); 29 30 TestWritable.testWritable(r); 31 } 32 33 } 34 | Popular Tags |