Package org.fao.geonet.kernel

Examples of org.fao.geonet.kernel.KeywordBean


        assertSearchUriSearch(searcher);
    }

    private void assertSearchUriSearch(KeywordsSearcher searcher) {
        assertEquals(1, searcher.getNbResults());
        KeywordBean word = searcher.getResults().get(0);
        assertEquals(THESAURUS_KEYWORD_NS+30, word.getUriCode());
        assertEquals(thesaurus.getKey(), word.getThesaurusKey());
        assertEquals("fre", word.getDefaultLang());
        assertTrue(word.getValues().keySet().containsAll(Arrays.asList("fre","eng","chi")));
        assertEquals(3, word.getValues().size());
        assertEquals(3, word.getDefinitions().size());
    }
View Full Code Here


            .maxResults(10);
        searcher.search(params.build());
        Element selectParams = new Element("params");
        Set<String> ids = new HashSet<String>();
        for(int i = 0; i < 5; i++ ) {
            KeywordBean bean = searcher.getResults().get(i);
            if(i%2 == 0) {
                ids.add(bean.getUriCode());
            } else {
                ids.add(""+bean.getId());
            }
        }
       
        for (String string : ids) {
            selectParams.addContent(new Element("pIdKeyword").setText(string));
View Full Code Here

        assertCorrectKeywords(results);
    }

    private void assertCorrectKeywords(List<KeywordBean> results) {
        assertEquals(keywords, results.size());
        KeywordBean keywordBean = results.get(0);
        assertTrue(keywordBean.getUriCode().endsWith("#0"));
        assertEquals(createExampleLabel(0,"eng"), keywordBean.getValues().get("eng"));
        assertEquals(createExampleNote(0,"ger"), keywordBean.getDefinitions().get("ger"));
        assertEquals(4, keywordBean.getValues().size());
        assertEquals("0", keywordBean.getCoordEast());
        assertEquals("10", keywordBean.getCoordWest());
        assertEquals("5", keywordBean.getCoordSouth());
        assertEquals("15", keywordBean.getCoordNorth());

        KeywordBean keywordBean2 = results.get(1);
       
        assertTrue(keywordBean2.getUriCode().endsWith("#1"));
        assertEquals(createExampleLabel(1,"eng"), keywordBean2.getValues().get("eng"));
        assertEquals(createExampleNote(1,"ger"), keywordBean2.getDefinitions().get("ger"));
        assertEquals(4, keywordBean2.getValues().size());
        assertEquals("", keywordBean2.getCoordEast());
        assertEquals("", keywordBean2.getCoordWest());
        assertEquals("", keywordBean2.getCoordSouth());
        assertEquals("", keywordBean2.getCoordNorth());
    }
View Full Code Here

TOP

Related Classes of org.fao.geonet.kernel.KeywordBean

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.