Package com.socrata.model

Examples of com.socrata.model.SearchResults


    public void testSimpleQuery4x4() throws LongRunningQueryException, SodaError, InterruptedException, IOException
    {
        final HttpLowLevel  connection = connect();
        final SodaDdl       sodaDdl= new SodaDdl(connection);

        final SearchResults results =  sodaDdl.searchViews(new SearchClause.NameSearch("Test Data"));
        final String id = results.getResults().get(0).getDataset().getId();
        executeSimpleQuery(connection, id);
    }
View Full Code Here


        final SearchClause    nameClause = new SearchClause.NameSearch("TestUpdate");
        final SearchClause    tagClause = new SearchClause.TagSearch("test");
        final SearchClause    metadataClause = new SearchClause.MetadataSearch("Tests", "value", "testUpdateMetadata");


        final SearchResults results1 =  importer.searchViews(nameClause);
        TestCase.assertEquals(1, results1.getCount());
        TestCase.assertEquals("TestUpdate", results1.getResults().get(0).getDataset().getName());

        final SearchResults results2 =  importer.searchViews(tagClause);
        TestCase.assertEquals(4, results2.getCount());

        final SearchResults results2a =  importer.searchViews(tagClause, nameClause);
        TestCase.assertEquals(1, results2a.getCount());
        TestCase.assertEquals("TestUpdate", results2a.getResults().get(0).getDataset().getName());


        final SearchResults results3 =  importer.searchViews(metadataClause);
        TestCase.assertEquals(1, results3.getCount());
        TestCase.assertEquals("TestUpdate", results3.getResults().get(0).getDataset().getName());

        final SearchResults results4 =  importer.searchViews(nameClause, tagClause, metadataClause);
        TestCase.assertEquals(1, results4.getCount());
        TestCase.assertEquals("TestUpdate", results4.getResults().get(0).getDataset().getName());

        final SearchResults results5 =  importer.searchViews(metadataClause, new SearchClause.ViewTypeSearch(SearchClause.ViewType.dataset));
        TestCase.assertEquals(1, results5.getCount());
        TestCase.assertEquals("TestUpdate", results5.getResults().get(0).getDataset().getName());

        final SearchResults results6 =  importer.searchViews(metadataClause, new SearchClause.ViewTypeSearch(SearchClause.ViewType.view));
        TestCase.assertEquals(0, results6.getCount());

    }
View Full Code Here

TOP

Related Classes of com.socrata.model.SearchResults

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.