1
|
package eu.dnetlib.data.search.transform;
|
2
|
|
3
|
import eu.dnetlib.data.search.transform.config.ConfigurationFactoryException;
|
4
|
import org.junit.Before;
|
5
|
import org.junit.Test;
|
6
|
|
7
|
import javax.xml.xpath.XPathExpressionException;
|
8
|
import java.io.IOException;
|
9
|
|
10
|
|
11
|
|
12
|
public class ConfigurationTest {
|
13
|
|
14
|
@Before
|
15
|
public void setup() throws IOException {
|
16
|
|
17
|
}
|
18
|
|
19
|
@Test
|
20
|
public void testParse() throws XPathExpressionException, IOException, ConfigurationFactoryException {
|
21
|
// ConfigurationFactory factory = new ConfigurationFactory();
|
22
|
// factory.setConfigurationName("configuration.xml");
|
23
|
// factory.createConfiguration("config");
|
24
|
//
|
25
|
// Configuration configuration = factory.createConfiguration("testConfig");
|
26
|
// assertEquals("testConfig", configuration.getConfigurationName());
|
27
|
//
|
28
|
// assertEquals(new Locale("en","US"), configuration.getDefaultLocale());
|
29
|
//
|
30
|
// assertEquals(3, configuration.getVocabulariesMap().keySet().size());
|
31
|
// assertNotNull(configuration.getVocabulariesMap().get("languages"));
|
32
|
//
|
33
|
// assertEquals(configuration.getLocales().size(), configuration.getVocabulariesMap().get("languages").keySet().size());
|
34
|
//
|
35
|
// for (Locale locale: configuration.getLocales()) {
|
36
|
// assertEquals("src/main/eu/dnetlib/data/search/transform/xmls/"+"languages"+"_"+locale+".xml",
|
37
|
// configuration.getVocabulariesMap().get("languages").get(locale));
|
38
|
// }
|
39
|
}
|
40
|
}
|