Building a RESTful Web Service :: Learn how to create a RESTful web service with Spring. :: spring-boot http://spring.io/guides/gs/rest-service/

run.sh 740B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. cd $(dirname $0)
  2. cd ../complete
  3. mvn clean package
  4. java -jar target/gs-rest-service-0.1.0.jar &
  5. PID=$!
  6. sleep 10
  7. curl -s http://localhost:8080/greeting > target/actual.json
  8. kill -9 $PID
  9. echo "Let's look at the actual results: `cat target/actual.json`"
  10. echo "And compare it to: `cat ../test/expected.json`"
  11. if diff -w ../test/expected.json target/actual.json
  12. then
  13. echo SUCCESS
  14. let ret=0
  15. else
  16. echo FAIL
  17. let ret=255
  18. exit $ret
  19. fi
  20. rm -rf target
  21. ./gradlew build
  22. ret=$?
  23. if [ $ret -ne 0 ]; then
  24. exit $ret
  25. fi
  26. rm -rf build
  27. cd ../initial
  28. mvn clean compile
  29. ret=$?
  30. if [ $ret -ne 0 ]; then
  31. exit $ret
  32. fi
  33. rm -rf target
  34. ./gradlew compileJava
  35. ret=$?
  36. if [ $ret -ne 0 ]; then
  37. exit $ret
  38. fi
  39. rm -rf build
  40. exit