Package org.fao.geonet.domain

Examples of org.fao.geonet.domain.IsoLanguage


    @Autowired
    IsoLanguageRepository _repo;

    @Test
    public void testFindOne() {
        IsoLanguage isolang1 = newIsoLanguage();
        isolang1 = _repo.save(isolang1);

        IsoLanguage isolang2 = newIsoLanguage();
        isolang2 = _repo.save(isolang2);


        assertEquals(isolang2, _repo.findOne(isolang2.getId()));
        assertEquals(isolang1, _repo.findOne(isolang1.getId()));
    }
View Full Code Here


        assertEquals(isolang1, _repo.findOne(isolang1.getId()));
    }

    @Test
    public void testFindByCode() {
        IsoLanguage isolang1 = newIsoLanguage();
        isolang1 = _repo.save(isolang1);

        IsoLanguage isolang2 = newIsoLanguage();
        isolang2 = _repo.save(isolang2);

        List<IsoLanguage> langs = _repo.findAllByCode(isolang1.getCode());

        assertEquals(isolang1.getCode(), langs.get(0).getCode());

        langs = _repo.findAllByCode(isolang2.getCode());

        assertEquals(isolang2.getCode(), langs.get(0).getCode());
    }
View Full Code Here

        assertEquals(isolang2.getCode(), langs.get(0).getCode());
    }

    @Test
    public void testFindByShortCode() {
        IsoLanguage isolang1 = newIsoLanguage();
        isolang1 = _repo.save(isolang1);

        IsoLanguage isolang2 = newIsoLanguage();
        isolang2 = _repo.save(isolang2);

        List<IsoLanguage> langs = _repo.findAllByShortCode(isolang1.getShortCode());

        assertEquals(isolang1.getShortCode(), langs.get(0).getShortCode());

        langs = _repo.findAllByShortCode(isolang2.getShortCode());

        assertEquals(isolang2.getShortCode(), langs.get(0).getShortCode());
    }
View Full Code Here

        return createIsoLanguage(inc);
    }

    public static IsoLanguage createIsoLanguage(AtomicInteger inc) {
        int val = inc.incrementAndGet();
        IsoLanguage lang = new IsoLanguage();
        lang.setCode("cd" + val);
        lang.setShortCode("c" + val);
        return lang;
    }
View Full Code Here

        _harvestHistoryRepo.saveAndFlush(HarvestHistoryRepositoryTest.createHarvestHistory(_inc));
        assertEquals(16, _LanguageRepo.count());
        Language newLang = LanguageRepositoryTest.newLanguage(smallNumInt);
        _LanguageRepo.saveAndFlush(newLang);
        assertEquals(484, _isoLangRepo.count());
        IsoLanguage isoLang = new IsoLanguage();
        isoLang.setCode("zzz");
        isoLang.setShortCode("zz");
        _isoLangRepo.saveAndFlush(isoLang);
        assertEquals(8, _mdRepo.count());
        Metadata metadata = _mdRepo.saveAndFlush(MetadataRepositoryTest.newMetadata(_inc));
        assertEquals(13, _metadataCategoryRepo.count());
        _metadataCategoryRepo.saveAndFlush(MetadataCategoryRepositoryTest.newMetadataCategory(_inc));
View Full Code Here

TOP

Related Classes of org.fao.geonet.domain.IsoLanguage

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.