Skip to content

Commit

Permalink
Introduce version number in id property in module descriptor
Browse files Browse the repository at this point in the history
  • Loading branch information
marcjohnson-kint committed Jul 25, 2017
1 parent e5a1441 commit b7d3d1f
Show file tree
Hide file tree
Showing 10 changed files with 37 additions and 23 deletions.
2 changes: 1 addition & 1 deletion DeploymentDescriptor.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"srvcId" : "circulation",
"srvcId" : "circulation-4.1.0-SNAPSHOT",
"descriptor" : {
"exec" : "java -Dport=%p -jar ../mod-circulation/build/libs/mod-circulation.jar"
}
Expand Down
2 changes: 1 addition & 1 deletion ModuleDescriptor.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"id": "circulation",
"id": "circulation-4.1.0-SNAPSHOT",
"name": "Circulation Module",
"provides": [
{
Expand Down
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* Adds property `dueDate` to loan
* Provides circulation interface version 2.1
* Requires loan-storage interface version 3.1
* Include implementation version in `id` in Module Descriptor

## 4.0.0 2017-07-17

Expand Down
3 changes: 0 additions & 3 deletions activate-circulation-storage.json

This file was deleted.

3 changes: 0 additions & 3 deletions activate-inventory-storage.json

This file was deleted.

3 changes: 3 additions & 0 deletions activate.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"id": "moduleidhere"
}
2 changes: 1 addition & 1 deletion registration/activate.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"id": "circulation"
"id": "circulation-4.1.0-SNAPSHOT"
}
2 changes: 1 addition & 1 deletion stop-managed-demo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ instance_id=${1:-}
okapi_proxy_address=${2:-http://localhost:9130}

tenant_id="demo_tenant"
module_id="circulation"
module_id="circulation-4.1.0-SNAPSHOT"

./okapi-registration/managed-deployment/unregister.sh \
${module_id} \
Expand Down
20 changes: 14 additions & 6 deletions test-storage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,31 @@
okapi_proxy_address="http://localhost:9130"
tenant_id="test_tenant"

#Needs to be the specific version of Inventory Storage you want to use for testing
inventory_storage_module_id="inventory-storage-5.1.1-SNAPSHOT"

#Needs to be the specific version of Circulation Storage you want to use for testing
circulation_storage_module_id="circulation-storage-3.1.0-SNAPSHOT"

echo "Check if Okapi is contactable"
curl -w '\n' -X GET -D - \
"${okapi_proxy_address}/_/env" || exit 1

echo "Create ${tenant_id} tenant"
./create-tenant.sh ${tenant_id}

echo "Activate loan storage for ${tenant_id}"
activate_circulation_storage_json=$(cat ./activate-circulation-storage.json)
echo "Activate circulation storage for ${tenant_id}"
activate_circulation_storage_json=$(cat ./activate.json)
activate_circulation_storage_json="${activate_circulation_storage_json/moduleidhere/$circulation_storage_module_id}"

curl -w '\n' -X POST -D - \
-H "Content-type: application/json" \
-d "${activate_circulation_storage_json}" \
"${okapi_proxy_address}/_/proxy/tenants/${tenant_id}/modules"

echo "Activate inventory storage for ${tenant_id}"
activate_inventory_storage_json=$(cat ./activate-inventory-storage.json)
activate_inventory_storage_json=$(cat ./activate.json)
activate_inventory_storage_json="${activate_inventory_storage_json/moduleidhere/$inventory_storage_module_id}"

curl -w '\n' -X POST -D - \
-H "Content-type: application/json" \
Expand All @@ -31,11 +39,11 @@ gradle clean cleanTest testStorageViaOkapi

test_results=$?

echo "Deactivate loan storage for ${tenant_id}"
curl -X DELETE -D - -w '\n' "${okapi_proxy_address}/_/proxy/tenants/${tenant_id}/modules/circulation-storage"
echo "Deactivate circulation storage for ${tenant_id}"
curl -X DELETE -D - -w '\n' "${okapi_proxy_address}/_/proxy/tenants/${tenant_id}/modules/${circulation_storage_module_id}"

echo "Deactivate inventory storage for ${tenant_id}"
curl -X DELETE -D - -w '\n' "${okapi_proxy_address}/_/proxy/tenants/${tenant_id}/modules/inventory-storage"
curl -X DELETE -D - -w '\n' "${okapi_proxy_address}/_/proxy/tenants/${tenant_id}/modules/${inventory_storage_module_id}"

echo "Deleting ${tenant_id}"
./delete-tenant.sh ${tenant_id}
Expand Down
22 changes: 15 additions & 7 deletions test-via-okapi.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,13 @@ okapi_proxy_address="http://localhost:9130"
tenant_id="test_tenant"
circulation_direct_address=http://localhost:9605
circulation_instance_id=localhost-9605
circulation_module_id=circulation
circulation_module_id="circulation-4.1.0-SNAPSHOT"

#Needs to be the specific version of Inventory Storage you want to use for testing
inventory_storage_module_id="inventory-storage-5.1.1-SNAPSHOT"

#Needs to be the specific version of Circulation Storage you want to use for testing
circulation_storage_module_id="circulation-storage-3.1.0-SNAPSHOT"

echo "Check if Okapi is contactable"
curl -w '\n' -X GET -D - \
Expand All @@ -13,16 +19,18 @@ curl -w '\n' -X GET -D - \
echo "Create ${tenant_id} tenant"
./create-tenant.sh ${tenant_id}

echo "Activate loan storage for ${tenant_id}"
activate_circulation_storage_json=$(cat ./activate-circulation-storage.json)
echo "Activate circulation storage for ${tenant_id}"
activate_circulation_storage_json=$(cat ./activate.json)
activate_circulation_storage_json="${activate_circulation_storage_json/moduleidhere/$circulation_storage_module_id}"

curl -w '\n' -X POST -D - \
-H "Content-type: application/json" \
-d "${activate_circulation_storage_json}" \
"${okapi_proxy_address}/_/proxy/tenants/${tenant_id}/modules"

echo "Activate inventory storage for ${tenant_id}"
activate_inventory_storage_json=$(cat ./activate-inventory-storage.json)
activate_inventory_storage_json=$(cat ./activate.json)
activate_inventory_storage_json="${activate_inventory_storage_json/moduleidhere/$inventory_storage_module_id}"

curl -w '\n' -X POST -D - \
-H "Content-type: application/json" \
Expand Down Expand Up @@ -50,11 +58,11 @@ echo "Unregister circulation module"
${circulation_module_id} \
${tenant_id}

echo "Deactivate loan storage for ${tenant_id}"
curl -X DELETE -D - -w '\n' "${okapi_proxy_address}/_/proxy/tenants/${tenant_id}/modules/circulation-storage"
echo "Deactivate circulation storage for ${tenant_id}"
curl -X DELETE -D - -w '\n' "${okapi_proxy_address}/_/proxy/tenants/${tenant_id}/modules/${circulation_storage_module_id}"

echo "Deactivate inventory storage for ${tenant_id}"
curl -X DELETE -D - -w '\n' "${okapi_proxy_address}/_/proxy/tenants/${tenant_id}/modules/inventory-storage"
curl -X DELETE -D - -w '\n' "${okapi_proxy_address}/_/proxy/tenants/${tenant_id}/modules/${inventory_storage_module_id}"

echo "Deleting ${tenant_id}"
./delete-tenant.sh ${tenant_id}
Expand Down

0 comments on commit b7d3d1f

Please sign in to comment.