diff options
Diffstat (limited to 'testInsertStarSingle.sh')
-rwxr-xr-x | testInsertStarSingle.sh | 89 |
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" |