Package com.hp.hpl.jena.n3

Examples of com.hp.hpl.jena.n3.TestResolver


    }

    public void testBase3()
    {
        String b = IRIResolver.resolveGlobal("x") ;
        IRIResolver resolver = new IRIResolver(b) ;
        assertNotNull(resolver.getBaseIRI()) ;
        String base = resolver.getBaseIRI() ;
        assertTrue(base.indexOf(':') > 0 ) ;
    }
View Full Code Here


    public void testFileURI_rel_4() { execTestFileRelURI("file:foo/bar/") ; }
   

    private void execTest(String u, String base, String result)
    {
        IRIResolver resolver = new IRIResolver(base) ;
        String res = resolver.resolve(u) ;

        if (result == null )
        {
            assertNull("("+u+","+base+") => <null> :: Got: "+res, res) ;
            return ;
View Full Code Here

    }
   
    // A test for resolved names that depend on where the tests are run.
    private void execTestMatch(String u, String base, String resultPattern)
    {
        IRIResolver resolver = new IRIResolver(base) ;
        String res = resolver.resolve(u) ;

        if (resultPattern == null )
        {
            assertNull("("+u+","+base+") => <null> :: Got: "+res, res) ;
            return ;
View Full Code Here

   
    private void execException(String u, String base, Class<?> ex)
    {
        String s = ex.getSimpleName() ;
        try {
            IRIResolver resolver = new IRIResolver(base) ;
            String res = resolver.resolve(u) ;
            if ( res == null )
                fail("("+u+","+base+") => <null> :: Expected exception: " +s) ;
            else
                fail("("+u+","+base+") => "+res+" :: Expected exception: " +s) ;
        } catch (Exception ex2)
View Full Code Here

    }
    private void execException(String base, Class<?> ex)
    {
        String s = ex.getSimpleName() ;
        try {
            new IRIResolver(base) ;
                 fail("("+base+") => OK :: Expected exception: " +s) ;
        } catch (Exception ex2)
        {
            // Shoudl test whether ex2 is a subclass of ex
            assertEquals(ex, ex2.getClass()) ;
View Full Code Here

            // Sort out the baseURI - if that fails, dump in a dummy one and continue.
            try { baseURI = IRIResolver.chooseBaseURI(baseURI) ; }
            catch (Exception ex)
            { baseURI = "http://localhost/defaultBase#" ; }
   
            query.setResolver(new IRIResolver(baseURI)) ;
        }
        return parser.parse(query, queryString) ;
    }
View Full Code Here

        return ts ;
    }
   
    public void testBase1()
    {
        IRIResolver resolver = new IRIResolver() ;
        assertNotNull(resolver.getBaseIRI()) ;
        String base = resolver.getBaseIRI() ;
        assertTrue(base.indexOf(':') > 0 ) ;
    }
View Full Code Here

        assertTrue(base.indexOf(':') > 0 ) ;
    }
   
    public void testBase2()
    {
        IRIResolver resolver = new IRIResolver("x") ;
        assertNotNull(resolver.getBaseIRI()) ;
        // Active when IRI library integrated - currently the resolver takes a raw base string.
//        String base = resolver.getBaseIRI() ;
//        assertTrue(base.indexOf(':') > 0 ) ;
    }
View Full Code Here

    }

    public void testBase3()
    {
        String b = IRIResolver.resolveGlobal("x") ;
        IRIResolver resolver = new IRIResolver(b) ;
        assertNotNull(resolver.getBaseIRI()) ;
        String base = resolver.getBaseIRI() ;
        assertTrue(base.indexOf(':') > 0 ) ;
    }
View Full Code Here

    public void testFileURI_rel_4() { execTestFileRelURI("file:foo/bar/") ; }
   

    private void execTest(String u, String base, String result)
    {
        IRIResolver resolver = new IRIResolver(base) ;
        String res = resolver.resolve(u) ;

        if (result == null )
        {
            assertNull("("+u+","+base+") => <null> :: Got: "+res, res) ;
            return ;
View Full Code Here

TOP

Related Classes of com.hp.hpl.jena.n3.TestResolver

Copyright © 2018 www.massapicom. 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.