Revision 58223
Added by Andreas Czerniak about 4 years ago
modules/unibi-data-collective-transformation-common/trunk/src/test/java/eu/dnetlib/data/collective/transformation/VocabularyTypeEditorTest.java | ||
---|---|---|
16 | 16 |
|
17 | 17 |
// class under test |
18 | 18 |
private transient VocabularyTypeEditor editor; |
19 |
private final String json = "{\"map\":{\"Languages\":{\"name\":\"Names of Languages\", \"caseSensitive\":\"false\", \"delimiter\":\"/\"}, \"TextTypologies\":{\"name\":\"Names of Text Object Typologies\", \"caseSensitive\":\"false\"}}}";
|
|
19 |
private final String json = "{\"map\":{\"Languages\":{\"name\":\"Names of Languages\", \"caseSensitive\":\"false\", \"delimiter\":\"/\"}, \"ReviewLevels\":{\"name\":\"dnet:review_levels\", \"caseSensitive\":\"false\"} }}";
|
|
20 | 20 |
|
21 | 21 |
/** |
22 | 22 |
* @throws java.lang.Exception |
... | ... | |
33 | 33 |
assertTrue(editor.getValue() instanceof VocabularyMap); |
34 | 34 |
assertTrue(((VocabularyMap)editor.getValue()).containsKey("Languages")); |
35 | 35 |
assertFalse(((VocabularyMap)editor.getValue()).getMap().get("Languages").isCaseSensitive()); |
36 |
assertTrue(((VocabularyMap)editor.getValue()).containsKey("ReviewLevels")); |
|
37 |
|
|
36 | 38 |
} |
37 | 39 |
|
38 | 40 |
} |
modules/unibi-data-collective-transformation-common/trunk/src/test/java/eu/dnetlib/data/collective/transformation/rulelanguage/RuleLanguageTest.java | ||
---|---|---|
544 | 544 |
// scriptBuilder.append("dr:CobjCategory = Convert(xpath:\"//dc:type\", TextTypologies);\r\n"); |
545 | 545 |
// scriptBuilder.append("dc:language = Convert(xpath:\"//dc:language\", Languages);\r\n"); |
546 | 546 |
// scriptBuilder.append("dc:dateAccepted = Convert(xpath:\"//dc:date\", DateISO8601);\r\n"); |
547 |
// scriptBuilder.append("dc:language = Convert(xpath:\"//dc:language\", Languages);\r\n"); |
|
547 | 548 |
scriptBuilder.append("apply xpath:\"//dc:identifier\" if xpath:\"starts-with(., 'http')\" dc:identifier = xpath:\".\"; else dr:CobjIdentifier = xpath:\".\";\r\n"); |
548 | 549 |
scriptBuilder.append("apply xpath:\"//dc:relation\" if xpath:\"starts-with(., 'http')\" dc:identifier = Convert(xpath:\"//dc:type\", TextTypologies); else dr:CobjIdentifier = xpath:\".\";\r\n"); |
549 | 550 |
scriptBuilder.append("dc:publisher = xpath:\"//dc:publisher\";\r\n"); |
Also available in: Unified diff
enhance the tests to new added vocabulary