Skip to content

Package: DataAccessor

DataAccessor

Coverage

1: /*
2: * Copyright (C) 2023 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.environment;
16:
17: import cz.cvut.kbss.jopa.model.EntityManager;
18:
19: import java.util.Collection;
20:
21: public interface DataAccessor {
22:
23: /**
24: * Persists the specified test data directly into the storage.
25: * <p>
26: * Data are persisted using a vendor-specific storage access object unwrapped from the specified entity manager.
27: *
28: * @param data Data to persist
29: * @param em Means of getting vendor-specific storage access
30: * @throws Exception If storage access error occurs
31: */
32: void persistTestData(Collection<Quad> data, EntityManager em) throws Exception;
33:
34: /**
35: * Verifies that the specified data are present in the storage.
36: * <p>
37: * Data presence is verified using a vendor-specific storage access object unwrapped from the specified entity
38: * manager.
39: *
40: * @param data Data to verify
41: * @param em Means of getting vendor-specific storage access
42: * @throws Exception If storage access error occurs
43: */
44: void verifyDataPresent(Collection<Quad> data, EntityManager em) throws Exception;
45:
46: /**
47: * Verifies that the specified data are not present in the storage.
48: * <p>
49: * Data presence is verified using a vendor-specific storage access object unwrapped from the specified entity
50: * manager.
51: *
52: * @param data Data to verify
53: * @param em Means of getting vendor-specific storage access
54: * @throws Exception If storage access error occurs
55: */
56: void verifyDataNotPresent(Collection<Quad> data, EntityManager em) throws Exception;
57: }