@Test
    void testConnectivity() {
        QueryTree parsed = parseWhere("{ \"and\": [ {\"contains\" : { \"children\" : [\"title\", \"madonna\"], \"attributes\" : {\"id\": 1, \"connectivity\": {\"id\": 3, \"weight\": 7.0}} } }, " +
                "{ \"contains\" : { \"children\" : [\"title\", \"saint\"], \"attributes\" : {\"id\": 2} } }, " +
                "{ \"contains\" : { \"children\" : [\"title\", \"angel\"], \"attributes\" : {\"id\": 3} } } ] }");
        assertEquals("AND title:madonna title:saint title:angel", parsed.toString());

        AndItem root = (AndItem) parsed.getRoot();
        WordItem first = (WordItem) root.getItem(0);
        WordItem second = (WordItem) root.getItem(1);
        WordItem third = (WordItem) root.getItem(2);
        assertEquals(third, first.getConnectedItem());
        assertEquals(first.getConnectivity(), 7.0d, 1E-6);
        assertNull(second.getConnectedItem());

        assertParseFail("{ \"and\": [ {\"contains\" : { \"children\" : [\"title\", \"madonna\"], \"attributes\" : {\"id\": 1, \"connectivity\": {\"id\": 4, \"weight\": 7.0}} } }, " +
                "{ \"contains\" : { \"children\" : [\"title\", \"saint\"], \"attributes\" : {\"id\": 2} } }, " +
                "{ \"contains\" : { \"children\" : [\"title\", \"angel\"], \"attributes\" : {\"id\": 3} } } ] }",
                new IllegalArgumentException("Item 'title:madonna' was specified to connect to item with ID 4, " +
                        "which does not exist in the query."));
    }
Tests Query.Select

@author henrhoi
@author bratseth
container-search/src/test/java/com/yahoo/select/SelectTestCase.java