/zio2

ZIO 2 feature tests using ScalaFx, H2, Postgresql and Scala 3.

Primary LanguageScalaApache License 2.0Apache-2.0

ZIO 2

Features tested:

  1. cache
  2. config
  3. direct
  4. fiber
  5. http
  6. json
  7. queue
  8. interrupt
  9. zlayer
  10. logging
  11. promise
  12. quill
  13. ref/fiber ref
  14. resources
  15. scalafx
  16. streams
  17. schedule
  18. test

Build

  1. sbt clean compile

Test

  1. sbt clean test

Run

  1. sbt run Multiple main classes detected. Select one to run:
  2. objektwerks.CacheApp
  3. objektwerks.ClockApp
  4. objektwerks.CombinerApp
  5. objektwerks.ConsoleApp
  6. objektwerks.HttpServer
  7. objektwerks.InterruptApp
  8. objektwerks.LoggerApp
  9. objektwerks.ParApp
  10. objektwerks.QuillH2App
  11. objektwerks.QuillPostgreSqlApp
  12. objektwerks.RandomApp
  13. objektwerks.STMApp
  14. objektwerks.ScalaFxApp
  15. objektwerks.ScheduleApp
  16. objektwerks.SemaphoreApp
  17. objektwerks.ServicePatternApp
  18. objektwerks.SubscriptionApp
  19. objektwerks.SystemApp
  20. objektwerks.ValidateApp
  21. objektwerks.ZIODirect

Curl

Use the following curl sequences to target HttpServer:

  1. curl -v http://localhost:7272/now
  2. curl -d "Fred Flintstone" -v http://localhost:7272/greeting
  3. curl --header "Content-Type: application/json" --request POST --data '{"Add":{"x":1,"y":1}}' http://localhost:7272/command
  4. curl --header "Content-Type: application/json" --request POST --data '{"Multiply":{"x":1,"y":2}}' http://localhost:7272/command
  5. curl --header "Content-Type: application/json" --request POST --data '{"Fake":{"x":1,"y":2}}' http://localhost:7272/command

Postgresql Database

Example database url: postgresql://localhost:5432/todo?user=tripletail&password=

  1. psql postgres
  2. CREATE DATABASE todo OWNER your computer name.;
  3. GRANT ALL PRIVILEGES ON DATABASE todo TO your computer name.;
  4. \l
  5. \q
  6. psql todo
  7. \i pg-ddl.sql
  8. \q

Postgresql DDL

  1. psql todo
  2. \i pg-ddl.sql
  3. \q