Skip to content

Method: init()

1: /**
2: * Copyright (C) 2016 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.OWLClassQ;
18: import cz.cvut.kbss.jopa.test.OWLClassT;
19: import cz.cvut.kbss.jopa.test.OWLClassU;
20: import cz.cvut.kbss.jopa.test.environment.DataAccessor;
21: import cz.cvut.kbss.jopa.test.environment.Generators;
22: import cz.cvut.kbss.jopa.test.environment.PersistenceFactory;
23: import org.slf4j.Logger;
24:
25: abstract class BaseInheritanceRunner extends BaseRunner {
26:
27: // Mapped superclass
28: OWLClassQ entityQ;
29: // Single inheritance - OWLClassT and OWLClassU are subclasses of OWLClassS
30: OWLClassT entityT;
31: OWLClassU entityU;
32:
33: BaseInheritanceRunner(Logger logger, PersistenceFactory persistenceFactory, DataAccessor dataAccessor) {
34: super(logger, persistenceFactory, dataAccessor);
35: init();
36: }
37:
38: private void init() {
39: this.entityQ = new OWLClassQ();
40: entityQ.setStringAttribute("entityQStringAttribute");
41: entityQ.setParentString("entityQParentStringAttribute");
42: entityQ.setLabel("entityQLabel");
43: entityQ.setOwlClassA(entityA);
44: this.entityT = new OWLClassT();
45: entityT.setName("entityT");
46: entityT.setDescription("Description attribute is a part of the superclass.");
47: entityT.setIntAttribute(Generators.randomInt(Integer.MAX_VALUE));
48: entityT.setOwlClassA(entityA);
49: this.entityU = new OWLClassU();
50: entityU.setName("entityU");
51: entityU.setDescription("Description attribute for an OWLClassU instance.");
52: entityU.setOwlClassS(entityT);
53: }
54: }