Skip to content

Package: OwlapiStorageConfig

OwlapiStorageConfig

nameinstructionbranchcomplexitylinemethod
OwlapiStorageConfig()
M: 0 C: 3
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
createStorageConfiguration(int)
M: 13 C: 58
82%
M: 3 C: 3
50%
M: 3 C: 1
25%
M: 0 C: 12
100%
M: 0 C: 1
100%
static {...}
M: 0 C: 3
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%

Coverage

1: /*
2: * JOPA
3: * Copyright (C) 2023 Czech Technical University in Prague
4: *
5: * This library is free software; you can redistribute it and/or
6: * modify it under the terms of the GNU Lesser General Public
7: * License as published by the Free Software Foundation; either
8: * version 3.0 of the License, or (at your option) any later version.
9: *
10: * This library is distributed in the hope that it will be useful,
11: * but WITHOUT ANY WARRANTY; without even the implied warranty of
12: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13: * Lesser General Public License for more details.
14: *
15: * You should have received a copy of the GNU Lesser General Public
16: * License along with this library.
17: */
18: package cz.cvut.kbss.jopa.test.environment;
19:
20: import cz.cvut.kbss.jopa.model.JOPAPersistenceProperties;
21: import cz.cvut.kbss.ontodriver.config.OntoDriverProperties;
22:
23: import java.io.File;
24: import java.util.HashMap;
25: import java.util.Map;
26:
27: /**
28: * Persistent storage configuration for OWLAPI accessed single-file storage.
29: */
30: public class OwlapiStorageConfig extends StorageConfig {
31:
32: private static final OntologyConnectorType TYPE = OntologyConnectorType.OWLAPI;
33:
34: @Override
35: public Map<String, String> createStorageConfiguration(int index) {
36:• assert directory != null : "directory is not set";
37:• assert name != null;
38:• assert index >= 0;
39:
40: String base = name + TYPE + index;
41: final File url = new File(directory + File.separator + base + ".owl");
42: TestEnvironment.removeOldTestFiles(url);
43:
44: final Map<String, String> config = new HashMap<>();
45: config.put(JOPAPersistenceProperties.DATA_SOURCE_CLASS, TYPE.getDriverClass());
46: config.put(JOPAPersistenceProperties.ONTOLOGY_URI_KEY, TestEnvironment.IRI_BASE + base);
47: config.put(JOPAPersistenceProperties.ONTOLOGY_PHYSICAL_URI_KEY, url.toURI().toString());
48: config.put(OntoDriverProperties.REASONER_FACTORY_CLASS, TestEnvironment.REASONER_FACTORY_CLASS);
49: return config;
50: }
51:
52: }