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());
}