Refs #10238: Refactor Context Port Type
Task-Url: https://support.d4science.org/issues/10238 git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/information-system/resource-registry@158741 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
92075c38b3
commit
c4a2a28b68
|
@ -348,7 +348,7 @@ public class ContextManagementImpl implements OLDContextManagement {
|
|||
uuid);
|
||||
return true;
|
||||
|
||||
} catch (ContextException ce) {
|
||||
} catch (ContextException | ContextNotFoundException ce) {
|
||||
if (orientGraph != null) {
|
||||
orientGraph.rollback();
|
||||
}
|
||||
|
|
|
@ -306,21 +306,21 @@ public class ContextManagementImplTest {
|
|||
@Test
|
||||
public void readTest() throws Exception {
|
||||
String name = "LLL";
|
||||
String contextJsonA1 = contextManagementImpl.create(null, name);
|
||||
Context createdContexA1 = ISMapper.unmarshal(Context.class,
|
||||
contextJsonA1);
|
||||
UUID A_1 = createdContexA1.getHeader().getUUID();
|
||||
logger.info("{}", contextJsonA1);
|
||||
Assert.assertTrue(createdContexA1.getName().compareTo(name) == 0);
|
||||
String contextJson = contextManagementImpl.create(null, name);
|
||||
Context createdContex = ISMapper.unmarshal(Context.class,
|
||||
contextJson);
|
||||
UUID uuid = createdContex.getHeader().getUUID();
|
||||
logger.info("{}", contextJson);
|
||||
Assert.assertTrue(createdContex.getName().compareTo(name) == 0);
|
||||
|
||||
String readContextJsonA1 = contextManagementImpl.read(A_1);
|
||||
Context readContexA1 = ISMapper.unmarshal(Context.class,
|
||||
readContextJsonA1);
|
||||
Assert.assertTrue(readContexA1.getName().compareTo(name) == 0);
|
||||
Assert.assertTrue(A_1.compareTo(readContexA1.getHeader().getUUID()) == 0);
|
||||
logger.trace("{}", createdContexA1);
|
||||
String readContextJson = contextManagementImpl.read(uuid);
|
||||
Context readContex = ISMapper.unmarshal(Context.class,
|
||||
readContextJson);
|
||||
Assert.assertTrue(readContex.getName().compareTo(name) == 0);
|
||||
Assert.assertTrue(uuid.compareTo(readContex.getHeader().getUUID()) == 0);
|
||||
logger.trace("{}", createdContex);
|
||||
|
||||
boolean deleted = contextManagementImpl.delete(A_1);
|
||||
boolean deleted = contextManagementImpl.delete(uuid);
|
||||
Assert.assertTrue(deleted);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue