Revision 6a3c8a34
Added by Cherian Mathew almost 8 years ago
eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/cdm/api/cache/CdmClientCachingTest.java | ||
---|---|---|
171 | 171 |
// |- question : KeyStatement |
172 | 172 |
// |- statement : KeyStatement |
173 | 173 |
PolytomousKey pkey1 = CdmBase.deproxy(polytomousKeyService.load(polytomousKeyUuid, PKEY_DEPTH2_INIT_STRATEGY),PolytomousKey.class); |
174 |
|
|
174 |
KeyStatement ks1 = pkey1.getRoot().getStatement(); |
|
175 |
Assert.assertSame(cacher.getFromCache(pkey1.getRoot().getStatement()), pkey1.getRoot().getStatement()); |
|
175 | 176 |
CdmTransientEntityCacher cacher = getCacher(sessionOwner); |
176 | 177 |
|
177 | 178 |
// this call will load into the session cache the graph and update the objects in the sub-graph for a |
... | ... | |
179 | 180 |
// |- root : polytomous key node |
180 | 181 |
PolytomousKey pkey2 = CdmBase.deproxy(polytomousKeyService.load(polytomousKeyUuid, PKEY_DEPTH1_INIT_STRATEGY),PolytomousKey.class); |
181 | 182 |
|
182 |
|
|
183 |
Assert.assertSame(pkey2.getRoot().getStatement(), cacher.getFromCache(pkey2.getRoot().getStatement())); |
|
184 | 183 |
Assert.assertSame(pkey1.getRoot().getStatement(), pkey2.getRoot().getStatement()); |
185 |
Assert.assertSame(cacher.getFromCache(pkey1.getRoot().getStatement()), cacher.getFromCache(pkey2.getRoot().getStatement())); |
|
184 |
pkey2.getRoot().getStatement().getCreatedBy(); |
|
185 |
Assert.assertSame(cacher.getFromCache(ks1), cacher.getFromCache(pkey2.getRoot().getStatement())); |
|
186 | 186 |
} |
187 | 187 |
|
188 | 188 |
/** |
... | ... | |
199 | 199 |
// |- statement : KeyStatement |
200 | 200 |
PolytomousKey pkey1 = CdmBase.deproxy(polytomousKeyService.load(polytomousKeyUuid, PKEY_DEPTH2_INIT_STRATEGY),PolytomousKey.class); |
201 | 201 |
|
202 |
|
|
202 | 203 |
CdmTransientEntityCacher cacher = getCacher(sessionOwner); |
203 | 204 |
|
204 | 205 |
// checking that the root is not null and |
... | ... | |
213 | 214 |
// |- root : polytomous key node |
214 | 215 |
PolytomousKey pkey2 = CdmBase.deproxy(polytomousKeyService.find(polytomousKeyUuid),PolytomousKey.class); |
215 | 216 |
|
217 |
KeyStatement ks2 = CdmBase.deproxy(pkey2.getRoot().getStatement(), KeyStatement.class); |
|
218 |
Assert.assertSame(ks2, cacher.getFromCache(pkey2.getRoot().getStatement())); |
|
216 | 219 |
|
217 |
|
|
218 |
Assert.assertSame(pkey2.getRoot().getStatement(), cacher.getFromCache(pkey2.getRoot().getStatement())); |
|
219 | 220 |
Assert.assertSame(pkey1.getRoot().getStatement(), pkey2.getRoot().getStatement()); |
220 | 221 |
Assert.assertSame(cacher.getFromCache(pkey1.getRoot().getStatement()), cacher.getFromCache(pkey2.getRoot().getStatement())); |
221 | 222 |
} |
Also available in: Unified diff
Correct tests to account for change in cache loader mechanism