Examples of XmlRestrictedCharReader


Examples of org.apache.abdera.util.XmlRestrictedCharReader

 
  @Test
  public void testXmlRestrictedCharReader() throws Exception {
    String s = "\u0001abcdefghijklmnop\u0002";
    StringReader r = new StringReader(s);
    XmlRestrictedCharReader x = new XmlRestrictedCharReader(r);
    char[] chars = new char[s.length()+1];
    int n = x.read(chars)// the first and last characters should never show up
    assertEquals(s.length()-2,n);
    assertEquals("abcdefghijklmnop",new String(chars,0,n));
  }
View Full Code Here

Examples of org.apache.abdera.util.XmlRestrictedCharReader

 
  @Test
  public void testXmlRestrictedCharReader() throws Exception {
    String s = "\u0001abcdefghijklmnop\u0002";
    StringReader r = new StringReader(s);
    XmlRestrictedCharReader x = new XmlRestrictedCharReader(r);
    char[] chars = new char[s.length()+1];
    int n = x.read(chars)// the first and last characters should never show up
    assertEquals(s.length()-2,n);
    assertEquals("abcdefghijklmnop",new String(chars,0,n));
  }
View Full Code Here

Examples of org.apache.abdera.util.XmlRestrictedCharReader

    public static List<Element> discoverLinks(Abdera abdera, String uri, String type, String... rel) throws IOException {
        AbderaClient client = new AbderaClient(abdera);
        ClientResponse resp = client.get(uri);
        InputStream in = resp.getInputStream();
        InputStreamReader r = new InputStreamReader(in);
        XmlRestrictedCharReader x = new XmlRestrictedCharReader(r);
        Document<Element> doc = HtmlHelper.parseDocument(x);
        List<Element> list = discoverLinks(doc.getRoot(), type, rel);
        return list;
    }
View Full Code Here

Examples of org.apache.abdera.util.XmlRestrictedCharReader

 
  @Test
  public void testXmlRestrictedCharReader() throws Exception {
    String s = "\u0001abcdefghijklmnop\u0002";
    StringReader r = new StringReader(s);
    XmlRestrictedCharReader x = new XmlRestrictedCharReader(r);
    char[] chars = new char[s.length()+1];
    int n = x.read(chars)// the first and last characters should never show up
    assertEquals(s.length()-2,n);
    assertEquals("abcdefghijklmnop",new String(chars,0,n));
  }
View Full Code Here

Examples of org.apache.abdera.util.XmlRestrictedCharReader

      throws IOException {
    AbderaClient client = new AbderaClient(abdera);
    ClientResponse resp = client.get(uri);
    InputStream in = resp.getInputStream();
    InputStreamReader r = new InputStreamReader(in);
    XmlRestrictedCharReader x = new XmlRestrictedCharReader(r);
    Document<Element> doc = HtmlHelper.parseDocument(x);
    List<Element> list =
      discoverLinks(
        doc.getRoot(),
        type, rel);
View Full Code Here

Examples of org.apache.abdera.util.XmlRestrictedCharReader

  }
 
  public static void testXmlRestrictedCharReader() throws Exception {
    String s = "\u0001abcdefghijklmnop\u0002";
    StringReader r = new StringReader(s);
    XmlRestrictedCharReader x = new XmlRestrictedCharReader(r);
    char[] chars = new char[s.length()+1];
    int n = x.read(chars)// the first and last characters should never show up
    assertEquals(s.length()-2,n);
    assertEquals("abcdefghijklmnop",new String(chars,0,n));
  }
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.