Revision f399aa02
Added by Cherian Mathew almost 9 years ago
eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/session/CdmEntitySessionManagerTest.java | ||
---|---|---|
46 | 46 |
|
47 | 47 |
PolytomousKey pKey = CdmBase.deproxy(polytomousKeyService.find(polytomousKeyUuid),PolytomousKey.class); |
48 | 48 |
cdmEntitySessionManager.bind(null); |
49 |
PolytomousKey pKeyLoaded = cdmEntitySessionManager.load(pKey); |
|
50 |
Assert.assertSame(pKeyLoaded, pKey); |
|
49 |
Assert.assertSame(pKey, pKey); |
|
51 | 50 |
Assert.assertNull(getActiveSession()); |
52 | 51 |
} |
53 | 52 |
|
54 | 53 |
@Test |
55 | 54 |
public void manageSessionWithObjectTest() { |
56 | 55 |
PolytomousKey pKey = CdmBase.deproxy(polytomousKeyService.find(polytomousKeyUuid),PolytomousKey.class); |
57 |
pKey = cdmEntitySession.load(pKey); |
|
56 |
|
|
58 | 57 |
Assert.assertNotNull(getActiveSession()); |
59 | 58 |
List<CdmBase> rootEntities = (List<CdmBase>)getFieldValueViaReflection(getActiveSession(), "rootEntities"); |
60 | 59 |
|
... | ... | |
70 | 69 |
|
71 | 70 |
sessionOwner = new MockSessionOwner(); |
72 | 71 |
pKey = CdmBase.deproxy(polytomousKeyService.find(polytomousKeyUuid),PolytomousKey.class); |
73 |
pKey = cdmEntitySession.load(pKey); |
|
72 |
|
|
74 | 73 |
|
75 | 74 |
Assert.assertEquals(pKey.getTitleCache(), upTitleCache); |
76 | 75 |
Assert.assertEquals(pKey.getRoot().getChildAt(0).getStatement().getLabel(english).getText(), upStatement); |
... | ... | |
79 | 78 |
@Test |
80 | 79 |
public void manageSessionWithListTest() { |
81 | 80 |
List<PolytomousKey> pKeys = polytomousKeyService.list(PolytomousKey.class, null, null, null, null); |
82 |
pKeys = (List<PolytomousKey>) cdmEntitySession.load(pKeys); |
|
83 | 81 |
Assert.assertNotNull(getActiveSession()); |
84 | 82 |
List<CdmBase> rootEntities = (List<CdmBase>)getFieldValueViaReflection(getActiveSession(), "rootEntities"); |
85 | 83 |
|
... | ... | |
99 | 97 |
|
100 | 98 |
sessionOwner = new MockSessionOwner(); |
101 | 99 |
pKeys = polytomousKeyService.list(PolytomousKey.class, null, null, null, null); |
102 |
pKeys = (List<PolytomousKey>) cdmEntitySession.load(pKeys); |
|
100 |
|
|
103 | 101 |
Assert.assertEquals(pKeys.get(0).getTitleCache(), upTitleCache); |
104 | 102 |
Assert.assertEquals(pKeys.get(1).getRoot().getChildAt(0).getStatement().getLabel(english).getText(), upStatement); |
105 | 103 |
|
Also available in: Unified diff
corrected / moved existing tests