Skip to content

Package: RetrieveWithInferenceRunner

RetrieveWithInferenceRunner

nameinstructionbranchcomplexitylinemethod
RetrieveWithInferenceRunner(Logger, PersistenceFactory, DataAccessor)
M: 0 C: 11
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 3
100%
M: 0 C: 1
100%
retrievedEntityWithInferredTypesContainsInferredData()
M: 0 C: 38
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 7
100%
M: 0 C: 1
100%

Coverage

1: /**
2: * Copyright (C) 2020 Czech Technical University in Prague
3: *
4: * This program is free software: you can redistribute it and/or modify it under
5: * the terms of the GNU General Public License as published by the Free Software
6: * Foundation, either version 3 of the License, or (at your option) any
7: * later version.
8: *
9: * This program is distributed in the hope that it will be useful, but WITHOUT
10: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11: * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
12: * details. You should have received a copy of the GNU General Public License
13: * along with this program. If not, see <http://www.gnu.org/licenses/>.
14: */
15: package cz.cvut.kbss.jopa.test.runner;
16:
17: import cz.cvut.kbss.jopa.test.OWLClassW;
18: import cz.cvut.kbss.jopa.test.Vocabulary;
19: import cz.cvut.kbss.jopa.test.environment.DataAccessor;
20: import cz.cvut.kbss.jopa.test.environment.PersistenceFactory;
21: import cz.cvut.kbss.jopa.test.environment.Quad;
22: import cz.cvut.kbss.jopa.vocabulary.RDFS;
23: import org.junit.jupiter.api.Test;
24: import org.slf4j.Logger;
25:
26: import java.net.URI;
27: import java.util.Collections;
28:
29: import static org.junit.jupiter.api.Assertions.assertTrue;
30:
31: public abstract class RetrieveWithInferenceRunner extends BaseRunner {
32:
33: protected OWLClassW entityW = new OWLClassW();
34:
35: public RetrieveWithInferenceRunner(Logger logger, PersistenceFactory persistenceFactory,
36: DataAccessor dataAccessor) {
37: super(logger, persistenceFactory, dataAccessor);
38: }
39:
40: @Test
41: public void retrievedEntityWithInferredTypesContainsInferredData() throws Exception {
42: persistTestData(Collections.singleton(
43: new Quad(URI.create(Vocabulary.C_OWL_CLASS_W), URI.create(RDFS.SUB_CLASS_OF),
44: URI.create(Vocabulary.C_OWL_CLASS_A))), em);
45: persist(entityW);
46:
47: final OWLClassW result = findRequired(OWLClassW.class, entityW.getUri());
48: assertTrue(result.getTypes().contains(URI.create(Vocabulary.C_OWL_CLASS_A)));
49: }
50: }