Package org.apache.abdera.i18n.iri

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


    }

    @Test
    public void testNotSoSimple() throws Exception {
        IRI iri = new IRI("http://example.com/\uD800\uDF00\uD800\uDF01\uD800\uDF02");
        assertEquals("http://example.com/%F0%90%8C%80%F0%90%8C%81%F0%90%8C%82", iri.toURI().toString());
    }

    @Test
    public void testIRItoURI() throws Exception {
        IRI iri = new IRI("http://\u7D0D\u8C46.example.org/%E2%80%AE");
View Full Code Here


    }

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

    @Test
    public void testComparison() throws Exception {
View Full Code Here

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%3A%2F%2Fr%C3%A9sum%C3%A9.example.org");  
  }
 
  public static void testFile() throws Exception {
    IRI iri = new IRI("file:///tmp/test/foo");
    assertEquals(iri.toURI().toString(),"file:///tmp/test/foo");
View Full Code Here

    assertEquals(iri.toURI().toString(),"http://validator.w3.org/check?uri=http%3A%2F%2Fr%C3%A9sum%C3%A9.example.org");  
  }
 
  public static void testFile() throws Exception {
    IRI iri = new IRI("file:///tmp/test/foo");
    assertEquals(iri.toURI().toString(),"file:///tmp/test/foo");
  }

  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(),"file:///tmp/test/foo");
  }

  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

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

    @Test
    public void testFile() throws Exception {
View Full Code Here

    }

    @Test
    public void testFile() throws Exception {
        IRI iri = new IRI("file:///tmp/test/foo");
        assertEquals("file:///tmp/test/foo", iri.toURI().toString());
    }

    @Test
    public void testSimple2() throws Exception {
        IRI iri = new IRI("http://www.example.org/red%09ros\u00E9#red");
View Full Code Here

    }

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

    @Test
    public void testNotSoSimple() throws Exception {
        IRI iri = new IRI("http://example.com/\uD800\uDF00\uD800\uDF01\uD800\uDF02");
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.