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);
|
uuid);
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
} catch (ContextException ce) {
|
} catch (ContextException | ContextNotFoundException ce) {
|
||||||
if (orientGraph != null) {
|
if (orientGraph != null) {
|
||||||
orientGraph.rollback();
|
orientGraph.rollback();
|
||||||
}
|
}
|
||||||
|
|
|
@ -306,21 +306,21 @@ public class ContextManagementImplTest {
|
||||||
@Test
|
@Test
|
||||||
public void readTest() throws Exception {
|
public void readTest() throws Exception {
|
||||||
String name = "LLL";
|
String name = "LLL";
|
||||||
String contextJsonA1 = contextManagementImpl.create(null, name);
|
String contextJson = contextManagementImpl.create(null, name);
|
||||||
Context createdContexA1 = ISMapper.unmarshal(Context.class,
|
Context createdContex = ISMapper.unmarshal(Context.class,
|
||||||
contextJsonA1);
|
contextJson);
|
||||||
UUID A_1 = createdContexA1.getHeader().getUUID();
|
UUID uuid = createdContex.getHeader().getUUID();
|
||||||
logger.info("{}", contextJsonA1);
|
logger.info("{}", contextJson);
|
||||||
Assert.assertTrue(createdContexA1.getName().compareTo(name) == 0);
|
Assert.assertTrue(createdContex.getName().compareTo(name) == 0);
|
||||||
|
|
||||||
String readContextJsonA1 = contextManagementImpl.read(A_1);
|
String readContextJson = contextManagementImpl.read(uuid);
|
||||||
Context readContexA1 = ISMapper.unmarshal(Context.class,
|
Context readContex = ISMapper.unmarshal(Context.class,
|
||||||
readContextJsonA1);
|
readContextJson);
|
||||||
Assert.assertTrue(readContexA1.getName().compareTo(name) == 0);
|
Assert.assertTrue(readContex.getName().compareTo(name) == 0);
|
||||||
Assert.assertTrue(A_1.compareTo(readContexA1.getHeader().getUUID()) == 0);
|
Assert.assertTrue(uuid.compareTo(readContex.getHeader().getUUID()) == 0);
|
||||||
logger.trace("{}", createdContexA1);
|
logger.trace("{}", createdContex);
|
||||||
|
|
||||||
boolean deleted = contextManagementImpl.delete(A_1);
|
boolean deleted = contextManagementImpl.delete(uuid);
|
||||||
Assert.assertTrue(deleted);
|
Assert.assertTrue(deleted);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue