Skip to content

Package: DataAccessor

DataAccessor

Coverage

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