Package hudson.search

Examples of hudson.search.SearchIndex


        // now make the actual call to index items
        view.addDisplayNamesToSearchIndex(sib, items);

        // make and index with sib
        SearchIndex index = sib.make();
       
        // now make sure we can fetch item1 from the index
        List<SearchItem> result = new ArrayList<SearchItem>();
        index.find(displayName1, result);
        Assert.assertEquals(1, result.size());
        SearchItem actual = result.get(0);
        Assert.assertEquals(actual.getSearchName(), item1.getDisplayName());
        Assert.assertEquals(actual.getSearchUrl(), item1.getSearchUrl());

        // clear the result array for the next search result to test
        result.clear();
        // make sure we can fetch item 2 from the index
        index.find(displayName2, result);
        Assert.assertEquals(1, result.size());
        actual = result.get(0);
        Assert.assertEquals(actual.getSearchName(), item2.getDisplayName());
        Assert.assertEquals(actual.getSearchUrl(), item2.getSearchUrl());
    }
View Full Code Here


        return true;
    }

    @Override
    protected SearchIndexBuilder makeSearchIndex() {
        return super.makeSearchIndex().add(new SearchIndex() {
            public void find(String token, List<SearchItem> result) {
                try {
                    if (token.startsWith("#"))
                        token = token.substring(1); // ignore leading '#'
                    int n = Integer.parseInt(token);
View Full Code Here

            .getValue();
    }

    @Override
    protected SearchIndexBuilder makeSearchIndex() {
        return super.makeSearchIndex().add(new SearchIndex() {
            public void find(String token, List<SearchItem> result) {
                try {
                    if (token.startsWith("#"))
                        token = token.substring(1); // ignore leading '#'
                    int n = Integer.parseInt(token);
View Full Code Here

TOP

Related Classes of hudson.search.SearchIndex

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.