about summary refs log tree commit diff
path: root/testInsertStarSingle.sh
diff options
context:
space:
mode:
authorEmile <hanemile@protonmail.com>2019-03-24 14:51:29 +0100
committerEmile <hanemile@protonmail.com>2019-03-24 14:51:29 +0100
commit98ea6d0a94df342d5de3908df33601db7d6b31c2 (patch)
treee149d5d6df57cfe9effb12e8f14ee2ecdd0bd3fe /testInsertStarSingle.sh
parentf8cb2a4d3a5fdb56aeeeeb087afa939762637149 (diff)
committing untracked files HEAD main
Diffstat (limited to 'testInsertStarSingle.sh')
-rwxr-xr-xtestInsertStarSingle.sh89
1 files changed, 65 insertions, 24 deletions
diff --git a/testInsertStarSingle.sh b/testInsertStarSingle.sh
index 36c94a2..57f1377 100755
--- a/testInsertStarSingle.sh
+++ b/testInsertStarSingle.sh
@@ -1,26 +1,67 @@
 #!/usr/bin/env bash
 
-echo "Recreating the tables..."
-curl -X POST http://localhost:8081/createNodesTable                                                                                
-curl -X POST http://localhost:8081/createStarsTable                                                                                
-echo "Done"
-
-echo "Deleting preexisting tables..."
-curl -X POST http://localhost:8081/deleteStars
-curl -X POST http://localhost:8081/deleteNodes
-echo "Done"
-
-echo "Inserting all stars from teststars.csv..."
-curl -X POST --data "filename=100" http://localhost:8081/insertStarList
-echo "Done"
-
-echo "Inserting a list of stars..."
-echo "Done"
-
-echo "Getting the forest representation of the tree..."
-curl -X GET http://localhost:8081/genForestTree?index=1
-echo "Done"
-
-echo "Getting a list of all stars..."
-curl -X GET http://localhost:8081/starslist/csv                                                                                    
-echo "Done"
+################################################################################
+# init 
+################################################################################
+
+# create tables 
+printf "Recreating the tables... "
+curl -X POST http://db-controller.docker.localhost/createNodesTable
+curl -X POST http://db-controller.docker.localhost/createStarsTable
+printf "Done   "
+read -n 1 -s -r -p "Press any key to continue (delete preexisting tables)"
+
+# delete preexisting table entries
+printf "\nDeleting preexisting tables... "
+curl -X POST http://db-controller.docker.localhost/deleteStars
+curl -X POST http://db-controller.docker.localhost/deleteNodes
+printf "Done   "
+read -n 1 -s -r -p "Press any key to continue (create a new tree)"
+
+# create a new tree 
+printf "\nCreating a new tree... "
+curl -X POST --data "w=100000000000" http://db-controller.docker.localhost/newTree
+printf "Done   "
+read -n 1 -s -r -p "Press any key to continue (insert stars from 10.csv)"
+
+################################################################################
+# insert 
+################################################################################
+
+# insert all stars from csv
+printf "\nInserting all stars from 10.csv..."
+curl -X POST --data "filename=10" http://db-controller.docker.localhost/insertStarList
+printf "Done   "
+read -n 1 -s -r -p "Press any key to continue (update total mass) "
+
+################################################################################
+# update
+################################################################################
+
+printf "\nInserting all stars from 10.csv..."
+curl -X POST --data "index=1" http://db-controller.docker.localhost/updateTotalMass
+printf "Done   "
+read -n 1 -s -r -p "Press any key to continue (update center of mass) "
+
+printf "\nInserting all stars from 10.csv..."
+curl -X POST --data "index=1" http://db-controller.docker.localhost/updateCenterOfMass
+printf "Done   "
+read -n 1 -s -r -p "Press any key to continue (forest representation) "
+
+################################################################################
+# forest 
+################################################################################
+
+printf "\nGetting the forest representation of the tree..."
+curl -X GET http://db-controller.docker.localhost/genForestTree?index=1
+printf "Done    "
+read -n 1 -s -r -p "Press any key to continue (get a list of all stars)"
+
+################################################################################
+# list of stars 
+################################################################################
+
+printf "\nGetting a list of all stars... "
+curl -X GET http://db-controller.docker.localhost/starslist/csv
+printf "Done    "
+read -n 1 -s -r -p "Press any key to continue"