Package org.apache.abdera.i18n.iri

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


    @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 testIpv4() throws URISyntaxException{
View Full Code Here


    }
   
    @Test
    public void testIpv4() throws URISyntaxException{
        IRI iri = new IRI("http://127.0.0.1");
        assertEquals("http://127.0.0.1", iri.toURI().toString());
    }
   
    @Test
    public void testIpv6() throws URISyntaxException{
        IRI iri = new IRI("http://[2001:0db8:85a3:08d3:1319:8a2e:0370:7344]");
View Full Code Here

    }
   
    @Test
    public void testIpv6() throws URISyntaxException{
        IRI iri = new IRI("http://[2001:0db8:85a3:08d3:1319:8a2e:0370:7344]");
        assertEquals("http://[2001:0db8:85a3:08d3:1319:8a2e:0370:7344]", iri.toURI().toString());
    }
   
    @Test
    public void testUnderscore() throws URISyntaxException{
      IRI iri = new IRI("http://its_gbsc.cn.ibm.com/");
View Full Code Here

    }
   
    @Test
    public void testUnderscore() throws URISyntaxException{
      IRI iri = new IRI("http://its_gbsc.cn.ibm.com/");
      assertEquals("http://its_gbsc.cn.ibm.com/", iri.toURI().toString());
    }
   
    @Test(expected=URISyntaxException.class)
    public void testIpv6Invalid() throws URISyntaxException{
        IRI iri = new IRI("http://[2001:0db8:85a3:08d3:1319:8a2e:0370:734o]");
View Full Code Here

    }
   
    @Test(expected=URISyntaxException.class)
    public void testIpv6Invalid() throws URISyntaxException{
        IRI iri = new IRI("http://[2001:0db8:85a3:08d3:1319:8a2e:0370:734o]");
        iri.toURI().toString();
    }

    @Test
    public void testFile() throws Exception {
        IRI iri = new IRI("file:///tmp/test/foo");
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

    }

    @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

  @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(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");  
  }
 
  @Test
  public void testFile() throws Exception {
    IRI iri = new IRI("file:///tmp/test/foo");
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.