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@158776 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Luca Frosini 2017-11-23 09:17:38 +00:00
parent c4116ed127
commit 96b98199e8
1 changed files with 44 additions and 10 deletions

View File

@ -1,7 +1,9 @@
package org.gcube.informationsystem.resourceregistry.context;
import java.io.IOException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.UUID;
import org.gcube.informationsystem.impl.embedded.HeaderImpl;
@ -118,7 +120,7 @@ public class ContextManagementTest {
}
Assert.assertTrue(pre.getName().compareTo(post.getName()) == 0);
if (checkParent && pre.getParent()!=null && post.getParent()!=null) {
if (checkParent && pre.getParent() != null && post.getParent() != null) {
Context preParent = pre.getParent().getSource();
Context postParent = post.getParent().getSource();
assertions(preParent, postParent, false, false);
@ -242,7 +244,6 @@ public class ContextManagementTest {
// ___A2_______B4____
// B3______________A5
nullContext = null;
contextB4.setParent(nullContext);
update(contextB4);
@ -250,14 +251,12 @@ public class ContextManagementTest {
// __A2__________A5__
// B3
contextB4.setParent(contextA1);
update(contextB4);
// ________A1________
// ___A2_______B4____
// B3______________A5
// Trying to rename with the new name A. It fails due to A5.
contextB3.setName(CTX_NAME_A);
update(contextB3);
@ -410,4 +409,39 @@ public class ContextManagementTest {
preVRE = create(preVRE);
}
// @Test
public void createPARTHENOSContext() throws Exception {
// /d4science.research-infrastructures.eu/ParthenosVO/PARTHENOS_Registry
Context d4science = new ContextImpl("d4science.research-infrastructures.eu");
create(d4science);
Context parthenosVO = new ContextImpl("ParthenosVO");
parthenosVO.setParent(d4science);
create(parthenosVO);
Context parthenosRegistry = new ContextImpl("PARTHENOS_Registry");
parthenosRegistry.setParent(parthenosVO);
create(parthenosRegistry);
}
// @Test
public void createProductionMissingContext() throws Exception {
UUID d4ResearchUUID = UUID.fromString("8b926d1c-4460-4d7a-adab-c75ad2770a21");
UUID farmUUID = UUID.fromString("dbafdb3e-f7f9-4039-ad1c-3432c041f53c");
Map<String, UUID> contexts = new HashMap<>();
contexts.put("ICES_FIACO2017", d4ResearchUUID);
contexts.put("D4STeam", farmUUID);
for (String contextName : contexts.keySet()) {
Context parent = read(contexts.get(contextName));
Context context = new ContextImpl(contextName);
context.setParent(parent);
create(context);
}
}
}