diff --git a/src/test/java/org/gcube/informationsystem/resourceregistry/context/ContextManagementTest.java b/src/test/java/org/gcube/informationsystem/resourceregistry/context/ContextManagementTest.java index 1460ec3..0956359 100644 --- a/src/test/java/org/gcube/informationsystem/resourceregistry/context/ContextManagementTest.java +++ b/src/test/java/org/gcube/informationsystem/resourceregistry/context/ContextManagementTest.java @@ -14,7 +14,7 @@ import org.glassfish.jersey.test.JerseyTest; import org.junit.Assert; import org.junit.Test; -public class ContextManagementTest extends JerseyTest{ +public class ContextManagementTest extends JerseyTest { @Override protected Application configure() { diff --git a/src/test/resources/curl_test.sh b/src/test/resources/curl_test.sh new file mode 100755 index 0000000..f38ede5 --- /dev/null +++ b/src/test/resources/curl_test.sh @@ -0,0 +1,64 @@ +#!/bin/bash +# Creating ROOT +ROOT_NAME="myRoot" +echo "Going to create ROOT Context with name ${ROOT_NAME}" +ROOT_UUID=$(curl -H gcube-scope:/gcube/devNext -X PUT http://localhost:8080/resource-registry/context?name=${ROOT_NAME}) +echo "Created Context (${ROOT_NAME}) has UUID ${ROOT_UUID}" +echo "" +echo "" + + +# Creating VO +VO_NAME="myVO" +echo "Going to create Context with name ${VO_NAME} as child of ${ROOT_UUID} (${ROOT_NAME})" +VO_UUID=$(curl -H gcube-scope:/gcube/devNext -X PUT http://localhost:8080/resource-registry/context?name=${VO_NAME}?parentContextId=${ROOT_UUID}) +echo "Created Context ${VO_NAME} has UUID ${VO_UUID} as child of ${ROOT_UUID} (${ROOT_NAME})" +echo "" +echo "" + + +# Renaming VO +VO_NEW_NAME="myVONewName" +echo "Going to rename VO Context from name ${VO_NAME} to ${VO_NEW_NAME}" +RENAMED_VO_UUID=$(curl -H gcube-scope:/gcube/devNext -X POST http://localhost:8080/resource-registry/context/rename/${VO_UUID}?name=${VO_NEW_NAME}) +echo "${VO_UUID}" +echo "${RENAMED_VO_UUID}" +echo "" +echo "" + + +# Moving VO as ROOT +echo "Going to move VO Context ${VO_NEW_NAME} as ROOT" +MOVED_VO_UUID=$(curl -H gcube-scope:/gcube/devNext -X POST http://localhost:8080/resource-registry/context/move/${VO_UUID}) +echo "${VO_UUID}" +echo "${MOVED_VO_UUID}" +echo "" +echo "" + + +# Moving VO under myRoot +echo "Going to move VO Context ${VO_NEW_NAME} under ROOT again" +MOVED_AGAIN_VO_UUID=$(curl -H gcube-scope:/gcube/devNext -X POST http://localhost:8080/resource-registry/context/move/${VO_UUID}?parentContextId=${ROOT_UUID}) +echo "${VO_UUID}" +echo "${MOVED_AGAIN_VO_UUID}" +echo "" +echo "" + + +# Deleting VO +echo "Going to delete VO Context ${VO_NEW_NAME}" +DELETED_VO_UUID=$(curl -H gcube-scope:/gcube/devNext -X DELETE http://localhost:8080/resource-registry/context/${VO_UUID}) +echo "${VO_UUID}" +echo "${DELETED_VO_UUID}" +echo "" +echo "" + + +# Deleting ROOT +echo "Going to delete ROOT Context ${ROOT_NAME}" +DELETED_ROOT_UUID=$(curl -H gcube-scope:/gcube/devNext -X DELETE http://localhost:8080/resource-registry/context/${ROOT_UUID}) +echo "${ROOT_UUID}" +echo "${DELETED_ROOT_UUID}" +echo "" +echo "" +