Package com.rackspacecloud.blueflood.io

Examples of com.rackspacecloud.blueflood.io.SearchResult


    private ElasticIO elasticIO;
    private EsSetup esSetup;

    private static SearchResult createExpectedResult(String tenantId, int x, String y, int z, String unit) {
        Locator locator = createTestLocator(tenantId, x, y, z);
        return new SearchResult(tenantId, locator.getMetricName(), unit);
    }
View Full Code Here


    public void testWildcardForPreaggregatedMetric() throws Exception {
        testWildcard(TENANT_C, null);
    }

    public void testWildcard(String tenantId, String unit) throws Exception {
        SearchResult entry;
        List<SearchResult> results;
        results = elasticIO.search(tenantId, "one.two.*");
        List<Locator> locators = locatorMap.get(tenantId);
        Assert.assertEquals(locators.size(), results.size());
        for (Locator locator : locators) {
            entry =  new SearchResult(tenantId, locator.getMetricName(), unit);
            Assert.assertTrue((results.contains(entry)));
        }

        results = elasticIO.search(tenantId, "*.fourA.*");
        Assert.assertEquals(NUM_PARENT_ELEMENTS * NUM_GRANDCHILD_ELEMENTS, results.size());
View Full Code Here

public class TestIndexHandler {
   
    @Test
    public void testSearchResultToJSON() {
        List<SearchResult> results = new ArrayList<SearchResult>();
        results.add(new SearchResult("tenant0", "a.b.c.d.foo", "parsecs"));
        results.add(new SearchResult("tenant1", "a.b.c.d.bar", "furlongs"));

        String searchResultsJson = HttpMetricsIndexHandler.getSerializedJSON(results);
        Assert.assertFalse("[]".equals(searchResultsJson));
        Assert.assertTrue(searchResultsJson.contains("unit"));
    }
View Full Code Here

    }

    @Test
    public void testNullUnitsDontGetAdded() {
        List<SearchResult> results = new ArrayList<SearchResult>();
        results.add(new SearchResult("tenant0", "a.b.c.d.foo", null));

        String searchResultsJson = HttpMetricsIndexHandler.getSerializedJSON(results);
        Assert.assertTrue(searchResultsJson.contains("a.b.c.d.foo"));
        Assert.assertFalse(searchResultsJson.contains("unit"));
    }
View Full Code Here

TOP

Related Classes of com.rackspacecloud.blueflood.io.SearchResult

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.