use of org.olat.modules.taxonomy.model.TaxonomyLevelSearchParameters in project OpenOLAT by OpenOLAT.
the class TaxonomyLevelDAOTest method searchLevelsByExternalId.
@Test
public void searchLevelsByExternalId() {
Taxonomy taxonomy = taxonomyDao.createTaxonomy("ID-105B", "Named taxonomy", null, null);
TaxonomyLevel level1 = taxonomyLevelDao.createTaxonomyLevel("L-1C", "A numerated level", "", "34765", null, null, null, taxonomy);
TaxonomyLevel level2 = taxonomyLevelDao.createTaxonomyLevel("L-1D", "A numerated level", "", "34766", null, null, null, taxonomy);
dbInstance.commitAndCloseSession();
// key
TaxonomyLevelSearchParameters searchParams = new TaxonomyLevelSearchParameters();
searchParams.setQuickSearch("34765");
List<TaxonomyLevel> levels = taxonomyLevelDao.searchLevels(taxonomy, searchParams);
Assert.assertNotNull(levels);
Assert.assertEquals(1, levels.size());
Assert.assertEquals(level1, levels.get(0));
Assert.assertNotEquals(level2, levels.get(0));
}
use of org.olat.modules.taxonomy.model.TaxonomyLevelSearchParameters in project OpenOLAT by OpenOLAT.
the class TaxonomyLevelDAOTest method searchLevelsByKey.
@Test
public void searchLevelsByKey() {
Taxonomy taxonomy = taxonomyDao.createTaxonomy("ID-105B", "Named taxonomy", null, null);
TaxonomyLevel level1 = taxonomyLevelDao.createTaxonomyLevel("L-1E", "A numerated level", "", null, null, null, null, taxonomy);
TaxonomyLevel level2 = taxonomyLevelDao.createTaxonomyLevel("L-1F", "A numerated level", "", null, null, null, null, taxonomy);
dbInstance.commitAndCloseSession();
// key
TaxonomyLevelSearchParameters searchParams = new TaxonomyLevelSearchParameters();
searchParams.setQuickSearch(level1.getKey().toString());
List<TaxonomyLevel> levels = taxonomyLevelDao.searchLevels(taxonomy, searchParams);
Assert.assertNotNull(levels);
Assert.assertEquals(1, levels.size());
Assert.assertEquals(level1, levels.get(0));
Assert.assertNotEquals(level2, levels.get(0));
}
use of org.olat.modules.taxonomy.model.TaxonomyLevelSearchParameters in project openolat by klemens.
the class TaxonomyLevelDAOTest method searchLevelsByExternalId.
@Test
public void searchLevelsByExternalId() {
Taxonomy taxonomy = taxonomyDao.createTaxonomy("ID-105B", "Named taxonomy", null, null);
TaxonomyLevel level1 = taxonomyLevelDao.createTaxonomyLevel("L-1C", "A numerated level", "", "34765", null, null, null, taxonomy);
TaxonomyLevel level2 = taxonomyLevelDao.createTaxonomyLevel("L-1D", "A numerated level", "", "34766", null, null, null, taxonomy);
dbInstance.commitAndCloseSession();
// key
TaxonomyLevelSearchParameters searchParams = new TaxonomyLevelSearchParameters();
searchParams.setQuickSearch("34765");
List<TaxonomyLevel> levels = taxonomyLevelDao.searchLevels(taxonomy, searchParams);
Assert.assertNotNull(levels);
Assert.assertEquals(1, levels.size());
Assert.assertEquals(level1, levels.get(0));
Assert.assertNotEquals(level2, levels.get(0));
}
Aggregations