-
Notifications
You must be signed in to change notification settings - Fork 2
/
JsonLdDeserializerTest.java
34 lines (28 loc) · 1.33 KB
/
JsonLdDeserializerTest.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
package cz.cvut.kbss.jsonld.deserialization;
import cz.cvut.kbss.jopa.model.annotations.OWLClass;
import cz.cvut.kbss.jsonld.ConfigParam;
import cz.cvut.kbss.jsonld.Configuration;
import cz.cvut.kbss.jsonld.environment.Vocabulary;
import cz.cvut.kbss.jsonld.environment.model.Study;
import org.junit.Test;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
public class JsonLdDeserializerTest {
@Test
public void constructionScansClasspathAndBuildsTypeMap() {
final JsonLdDeserializer deserializer = JsonLdDeserializer.createExpandedDeserializer();
assertFalse(deserializer.typeMap.get(Vocabulary.STUDY).isEmpty());
assertTrue(deserializer.typeMap.get(Vocabulary.STUDY).contains(Study.class));
}
@Test
public void constructionScansClasspathWithSpecifiedPackageAndBuildsTypeMap() {
final Configuration config = new Configuration();
config.set(ConfigParam.SCAN_PACKAGE, "cz.cvut.kbss.jsonld.deserialization");
final JsonLdDeserializer deserializer = JsonLdDeserializer.createExpandedDeserializer(config);
assertTrue(deserializer.typeMap.get(Vocabulary.STUDY).isEmpty());
assertTrue(deserializer.typeMap.get(Vocabulary.AGENT).contains(TestClass.class));
}
@OWLClass(iri = Vocabulary.AGENT)
public static class TestClass {
}
}