Package com.hp.hpl.jena.sparql.sse

Examples of com.hp.hpl.jena.sparql.sse.Item


    // ---- Lists
   
    @Test public void testList_1()
    {
        Item item = parse("()") ;
        assertTrue(item.isList()) ;
        assertEquals(item.getList().size(), 0 ) ;
    }
View Full Code Here


    @Test public void testList_3()    { testList("(1 2)", int1i, int2i) ; }
    @Test public void testList_4()    { testList("(1 a)", int1i, Item.createSymbol("a")) ; }
   
    @Test public void testList_5()
    {
        Item list = Item.createList() ;
        list.getList().add(int1i) ;
        testList("((1) a)", list, Item.createSymbol("a")) ;
    }
View Full Code Here

    { testList("[+ 1]", Item.createSymbol("+"), int1i) ; }
   
   
    @Test public void testNum_01()
    {
        Item item = SSE.parse("1") ;
        assertEquals(1, item.getInt()) ;
    }
View Full Code Here

        assertEquals(1, item.getInt()) ;
    }
       
    @Test public void testNum_02()
    {
        Item item = SSE.parse("3") ;
        assertEquals(3d, item.getDouble(), 0) ;
    }
View Full Code Here

        assertEquals(3d, item.getDouble(), 0) ;
    }

    @Test public void testNum_03()
    {
        Item item = SSE.parse("2.5") ;      // Exact double
        assertEquals(2.5d, item.getDouble(), 0) ;
    }
View Full Code Here

        assertEquals(2.5d, item.getDouble(), 0) ;
    }
   
    @Test public void testNum_04()
    {
        Item item = SSE.parse("abc") ;
        try {
            item.getInt() ;
            fail("Succeeded where exceptiSSE.on expected") ;
        } catch (ItemException ex) {}
    }
View Full Code Here

        } catch (ItemException ex) {}
    }

    @Test public void testNum_05()
    {
        Item item = SSE.parse("<x>") ;
        try {
            item.getInt() ;
            fail("Succeeded where exception expected") ;
        } catch (ItemException ex) {}
    }
View Full Code Here

    @Test public void testMisc_11()    { testNotEquals("(a)", "()") ; }
    @Test public void testMisc_12()    { testNotEquals("(a)", "(<a>)") ; }
   
    @Test public void testTaggedList_1()
    {
        Item x = Item.createTagged("TAG") ;
        assertTrue(x.isTagged()) ;
        assertTrue(x.isTagged("TAG")) ;
    }
View Full Code Here

        assertTrue(x.isTagged("TAG")) ;
    }
   
    @Test public void testTaggedList_2()
    {
        Item x = Item.createTagged("TAG") ;
        Item.addPair(x.getList(), "KEY", "VALUE") ;
       
        Item y = Item.find(x.getList(), "KEY") ;
        assertNotNull(y) ;
       
        Item z = Item.find(x.getList(), "KEYKEY") ;
        assertNull(z) ;
    }
View Full Code Here

    
    // ---- Workers ----
   
    private void testEquals(String x)
    {
        Item item1 = parse(x) ;
        Item item2 = parse(x) ;
        assertTrue(item1.equals(item2)) ;
        assertTrue(item2.equals(item1)) ;
    }
View Full Code Here

TOP

Related Classes of com.hp.hpl.jena.sparql.sse.Item

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.