Package org.apache.abdera.util.iri

Examples of org.apache.abdera.util.iri.IRI.toURI()


public class TestIRI extends TestCase {

  public static void testSimple() throws Exception {
    IRI iri = new IRI("http://validator.w3.org/check?uri=http%3A%2F%2Fr\u00E9sum\u00E9.example.org");
    assertEquals(iri.toString(),"http://validator.w3.org/check?uri=http%3A%2F%2Fr\u00E9sum\u00E9.example.org");
    assertEquals(iri.toURI().toString(),"http://validator.w3.org/check?uri=http://r%C3%A9sum%C3%A9.example.org");  
  }

  public static void testSimple2() throws Exception {
    IRI iri = new IRI("http://www.example.org/red%09ros\u00E9#red");
    assertEquals(iri.toURI().toString(),"http://www.example.org/red%09ros%C3%A9#red");
View Full Code Here


    assertEquals(iri.toURI().toString(),"http://validator.w3.org/check?uri=http://r%C3%A9sum%C3%A9.example.org");  
  }

  public static void testSimple2() throws Exception {
    IRI iri = new IRI("http://www.example.org/red%09ros\u00E9#red");
    assertEquals(iri.toURI().toString(),"http://www.example.org/red%09ros%C3%A9#red");
  }
 
 
  public static void testNotSoSimple() throws Exception {
    IRI iri = new IRI("http://example.com/\uD800\uDF00\uD800\uDF01\uD800\uDF02");
View Full Code Here

  }
 
 
  public static void testNotSoSimple() throws Exception {
    IRI iri = new IRI("http://example.com/\uD800\uDF00\uD800\uDF01\uD800\uDF02");
    assertEquals(iri.toURI().toString(),"http://example.com/%F0%90%8C%80%F0%90%8C%81%F0%90%8C%82");
  }
   
  public static void testURItoIRI() throws Exception {
    URI uri = new URI("http://www.example.org/D%C3%BCrst");
    IRI iri = new IRI(uri);
View Full Code Here

    assertEquals(iri.toString(),"http://xn--99zt52a.example.org/%E2%80%AE");
  }

  public static void testIRItoURI() throws Exception {
    IRI iri = new IRI("http://\u7D0D\u8C46.example.org/%E2%80%AE");
    URI uri = iri.toURI();
    assertEquals(uri.toString(),"http://xn--99zt52a.example.org/%E2%80%AE");
  }
 

  public static void testComparison() throws Exception {
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.