1
|
/**
|
2
|
* Copyright (C) 2014 EDIT
|
3
|
* European Distributed Institute of Taxonomy
|
4
|
* http://www.e-taxonomy.eu
|
5
|
*
|
6
|
* The contents of this file are subject to the Mozilla Public License Version 1.1
|
7
|
* See LICENSE.TXT at the top of this package for the full license terms.
|
8
|
*/
|
9
|
package eu.etaxonomy.cdm.model;
|
10
|
|
11
|
import static org.junit.Assert.assertTrue;
|
12
|
|
13
|
import java.util.Collection;
|
14
|
|
15
|
import org.junit.Test;
|
16
|
|
17
|
import eu.etaxonomy.cdm.model.common.CdmBase;
|
18
|
import eu.etaxonomy.cdm.model.common.IdentifiableEntity;
|
19
|
import eu.etaxonomy.cdm.model.description.DescriptionBase;
|
20
|
import eu.etaxonomy.cdm.model.description.TaxonDescription;
|
21
|
|
22
|
/**
|
23
|
* @author a.kohlbecker
|
24
|
* @since Jul 31, 2014
|
25
|
*/
|
26
|
public class CdmTypeScannerTest {
|
27
|
|
28
|
@Test
|
29
|
public void testCdmModelTypes() {
|
30
|
|
31
|
boolean includeAbstract = true;
|
32
|
boolean includeInterfaces = false;
|
33
|
|
34
|
CdmTypeScanner<CdmBase> scanner = new CdmTypeScanner<>(includeAbstract, includeInterfaces);
|
35
|
|
36
|
scanner.addIncludeFilter(new CdmAssignableTypeFilter(IdentifiableEntity.class, includeAbstract, includeInterfaces));
|
37
|
|
38
|
Collection<Class<? extends CdmBase>> classes = scanner.scanTypesIn("eu/etaxonomy/cdm/model");
|
39
|
assertTrue(classes.contains(TaxonDescription.class));
|
40
|
assertTrue("abstract base classes are missing", classes.contains(DescriptionBase.class));
|
41
|
}
|
42
|
}
|