Permalink
Browse files

Remove deprecated APIs

- Remove the deprecated parts of the old Invoker and Executor APIs

- Simplify the remaining internal implementation

- Remove tests that only tested the old APIs

- Rewrite tests for other features to use the DBIO API

- Remove JdbcInsertInvokerComponent and integrate the insert code
  directly into JdbcActionComponent, thus avoiding SQL compilation on
  the database thread and allowing SQL statements to be overridden.
  • Loading branch information...
szeiger committed Jul 17, 2015
1 parent 615fc0d commit 31672a224138d9d9c9c722ec8722376bf690f93b
Showing with 964 additions and 3,191 deletions.
  1. +20 −0 common-test-resources/application.conf
  2. +8 −6 osgi-tests/src/test/scala/slick/osgi/test/BasicTest.scala
  3. +0 −5 slick-testkit/src/main/resources/testkit-reference.conf
  4. +0 −75 slick-testkit/src/main/scala/com/typesafe/slick/testkit/tests/ExecutorTest.scala
  5. +3 −3 slick-testkit/src/main/scala/com/typesafe/slick/testkit/tests/ForeignKeyTest.scala
  6. +0 −105 slick-testkit/src/main/scala/com/typesafe/slick/testkit/tests/InvokerTest.scala
  7. +0 −58 slick-testkit/src/main/scala/com/typesafe/slick/testkit/tests/IterateeTest.scala
  8. +0 −1 slick-testkit/src/main/scala/com/typesafe/slick/testkit/tests/JdbcMetaTest.scala
  9. +2 −19 slick-testkit/src/main/scala/com/typesafe/slick/testkit/tests/JdbcMiscTest.scala
  10. +1 −27 slick-testkit/src/main/scala/com/typesafe/slick/testkit/tests/JoinTest.scala
  11. +321 −332 slick-testkit/src/main/scala/com/typesafe/slick/testkit/tests/ModelBuilderTest.scala
  12. +0 −211 slick-testkit/src/main/scala/com/typesafe/slick/testkit/tests/OldPlainSQLTest.scala
  13. +0 −35 slick-testkit/src/main/scala/com/typesafe/slick/testkit/tests/OldTransactionTest.scala
  14. +7 −0 slick-testkit/src/main/scala/com/typesafe/slick/testkit/util/DBTest.scala
  15. +38 −34 slick-testkit/src/main/scala/com/typesafe/slick/testkit/util/StandardTestDBs.scala
  16. +21 −28 slick-testkit/src/main/scala/com/typesafe/slick/testkit/util/TestDB.scala
  17. +11 −8 slick-testkit/src/main/scala/com/typesafe/slick/testkit/util/Testkit.scala
  18. +0 −105 slick-testkit/src/test/scala/slick/benchmark/IteratorPerformanceBenchmark.scala
  19. +1 −1 slick-testkit/src/test/scala/slick/benchmark/UnboxedBenchmark.scala
  20. +58 −70 slick-testkit/src/test/scala/slick/test/codegen/CodeGenRoundTripTest.scala
  21. +0 −60 slick-testkit/src/test/scala/slick/test/jdbc/EmbeddingTest.scala
  22. +0 −18 slick-testkit/src/test/scala/slick/test/jdbc/ExecutorTest.scala
  23. +0 −63 slick-testkit/src/test/scala/slick/test/jdbc/StatementParametersTest.scala
  24. +3 −4 slick-testkit/src/test/scala/slick/test/lifted/SchemaSupportTest.scala
  25. +1 −2 slick-testkit/src/test/scala/slick/test/lifted/TableConstraintsTest.scala
  26. +30 −53 slick-testkit/src/test/scala/slick/test/memory/DistributedQueryingTest.scala
  27. +0 −78 slick/src/main/scala/scala/slick/package.scala
  28. +2 −75 slick/src/main/scala/slick/backend/DatabaseComponent.scala
  29. +3 −2 slick/src/main/scala/slick/driver/H2Driver.scala
  30. +220 −57 slick/src/main/scala/slick/driver/JdbcActionComponent.scala
  31. +0 −35 slick/src/main/scala/slick/driver/JdbcExecutorComponent.scala
  32. +0 −342 slick/src/main/scala/slick/driver/JdbcInsertInvokerComponent.scala
  33. +2 −58 slick/src/main/scala/slick/driver/JdbcInvokerComponent.scala
  34. +18 −39 slick/src/main/scala/slick/driver/JdbcProfile.scala
  35. +3 −2 slick/src/main/scala/slick/driver/SQLiteDriver.scala
  36. +2 −74 slick/src/main/scala/slick/jdbc/Invoker.scala
  37. +1 −10 slick/src/main/scala/slick/jdbc/JdbcBackend.scala
  38. +0 −8 slick/src/main/scala/slick/jdbc/ResultSetConcurrency.scala
  39. +0 −8 slick/src/main/scala/slick/jdbc/ResultSetHoldability.scala
  40. +0 −8 slick/src/main/scala/slick/jdbc/ResultSetType.scala
  41. +0 −61 slick/src/main/scala/slick/jdbc/StatementInvoker.scala
  42. +5 −100 slick/src/main/scala/slick/jdbc/StaticQuery.scala
  43. +1 −1 slick/src/main/scala/slick/jdbc/StreamingInvokerAction.scala
  44. +0 −41 slick/src/main/scala/slick/jdbc/UnmanagedSession.scala
  45. +0 −5 slick/src/main/scala/slick/lifted/Aliases.scala
  46. +0 −11 slick/src/main/scala/slick/lifted/ExtensionMethods.scala
  47. +0 −35 slick/src/main/scala/slick/lifted/Query.scala
  48. +1 −5 slick/src/main/scala/slick/memory/DistributedBackend.scala
  49. +8 −15 slick/src/main/scala/slick/memory/DistributedProfile.scala
  50. +1 −5 slick/src/main/scala/slick/memory/HeapBackend.scala
  51. +27 −35 slick/src/main/scala/slick/memory/MemoryProfile.scala
  52. +1 −6 slick/src/main/scala/slick/memory/MemoryQueryingProfile.scala
  53. +10 −100 slick/src/main/scala/slick/profile/BasicProfile.scala
  54. +11 −28 slick/src/main/scala/slick/profile/RelationalProfile.scala
  55. +1 −19 slick/src/main/scala/slick/profile/SqlProfile.scala
  56. +0 −64 slick/src/main/scala/slick/util/iter/Iteratee.scala
  57. +1 −1 slick/src/sphinx/code/CodeGenerator.scala
  58. +112 −116 slick/src/sphinx/code/JoinsUnions.scala
  59. +3 −3 slick/src/sphinx/code/LiftedEmbedding.scala
  60. +0 −124 slick/src/sphinx/code/MigrationGuide.scala
  61. +1 −0 slick/src/sphinx/links.txt
  62. +4 −295 slick/src/sphinx/upgrade.rst
  63. +1 −2 slick/src/sphinx/userdefined.rst
@@ -55,3 +55,23 @@ databaseUrl {
}
}
}
distrib1 {
driver = "slick.driver.H2Driver$"
db {
connectionPool = disabled
driver = "org.h2.Driver"
url = "jdbc:h2:mem:distrib1"
keepAliveConnection = true
}
}
distrib2 {
driver = "slick.driver.HsqldbDriver$"
db {
connectionPool = disabled
driver = "org.hsqldb.jdbcDriver"
url = "jdbc:hsqldb:mem:distrib2;user=SA;password=;shutdown=true"
keepAliveConnection = true
}
}
@@ -6,10 +6,13 @@ import org.junit.Assert._
import org.ops4j.pax.exam
import org.ops4j.pax.exam.junit.{Configuration, ExamReactorStrategy, JUnit4TestRunner}
import org.ops4j.pax.exam.spi.reactors.AllConfinedStagedReactorFactory
import slick.SlickException
import slick.osgi.testutil._
import slick.util.GlobalConfig
import scala.concurrent.Await
import scala.concurrent.duration.Duration
import scala.concurrent.ExecutionContext.Implicits.global
@RunWith(classOf[JUnit4TestRunner])
@ExamReactorStrategy(Array(classOf[AllConfinedStagedReactorFactory]))
class BasicTest extends SlickOsgiHelper {
@@ -21,11 +24,10 @@ class BasicTest extends SlickOsgiHelper {
@Test
def testPlainSQL: Unit = {
import slick.jdbc.JdbcBackend._
import slick.jdbc.StaticQuery.interpolation
Database.forURL("jdbc:h2:mem:test-osgi") withSession { implicit session =>
assertEquals("TEST-OSGI", sql"select {fn database()}".as[String].first)
}
import slick.driver.H2Driver.api._
val a = sql"select {fn database()}".as[String].head.map(res => assertEquals("TEST-OSGI", res))
val db = Database.forURL("jdbc:h2:mem:test-osgi")
try Await.result(db.run(a), Duration.Inf) finally db.close
}
@Test
def testConfig: Unit = {
@@ -23,11 +23,8 @@ testkit {
${testPackage}.CountTest
${testPackage}.RelationalTypeTest
${testPackage}.JdbcTypeTest
${testPackage}.ExecutorTest
${testPackage}.ForeignKeyTest
${testPackage}.InsertTest
${testPackage}.InvokerTest
${testPackage}.IterateeTest
${testPackage}.JoinTest
${testPackage}.MainTest
${testPackage}.JdbcMapperTest
@@ -41,14 +38,12 @@ testkit {
${testPackage}.NewQuerySemanticsTest
${testPackage}.PagingTest
${testPackage}.PlainSQLTest
${testPackage}.OldPlainSQLTest
${testPackage}.PrimaryKeyTest
${testPackage}.RelationalScalarFunctionTest
${testPackage}.JdbcScalarFunctionTest
${testPackage}.SequenceTest
${testPackage}.TemplateTest
${testPackage}.TransactionTest
${testPackage}.OldTransactionTest
${testPackage}.UnionTest
]
}

This file was deleted.

Oops, something went wrong.
@@ -24,9 +24,9 @@ class ForeignKeyTest extends AsyncTest[RelationalTestDB] {
val posts = TableQuery[Posts]
for {
_ <- asAction(tdb.assertNotTablesExist("categories", "posts")(_))
_ <- tdb.assertNotTablesExist("categories", "posts")
_ <- (posts.schema ++ categories.schema).create
_ <- asAction(tdb.assertTablesExist("categories", "posts")(_))
_ <- tdb.assertTablesExist("categories", "posts")
_ <- categories ++= Seq(
(1, "Scala"),
(2, "ScalaQuery"),
@@ -51,7 +51,7 @@ class ForeignKeyTest extends AsyncTest[RelationalTestDB] {
} yield (p.id, c.id, c.name, p.title)).sortBy(_._1)
_ <- q2.map(p => (p._1, p._2)).result.map(_ shouldBe List((2,1), (3,2), (4,3), (5,2)))
_ <- (categories.schema ++ posts.schema).drop
_ <- asAction(tdb.assertNotTablesExist("categories", "posts")(_))
_ <- tdb.assertNotTablesExist("categories", "posts")
} yield ()
}

This file was deleted.

Oops, something went wrong.

This file was deleted.

Oops, something went wrong.
@@ -3,7 +3,6 @@ package com.typesafe.slick.testkit.tests
import org.junit.{Test, Assert}
import org.junit.Assert._
import slick.jdbc.meta._
import slick.jdbc.StaticQuery
import com.typesafe.slick.testkit.util.{TestDB, JdbcTestDB, AsyncTest}
class JdbcMetaTest extends AsyncTest[JdbcTestDB] {
@@ -7,42 +7,25 @@ import slick.jdbc.{ResultSetHoldability, ResultSetConcurrency, ResultSetType, Jd
class JdbcMiscTest extends AsyncTest[JdbcTestDB] {
import tdb.profile.api._
@deprecated("Testing deprecated O.Nullable / O.NotNull column options", "3.0")
def testNullability = {
class T1(tag: Tag) extends Table[String](tag, "t1") {
def a = column[String]("a")
def * = a
}
val t1 = TableQuery[T1]
class T2(tag: Tag) extends Table[String](tag, "t2") {
def a = column[String]("a", O.Nullable)
def * = a
}
val t2 = TableQuery[T2]
class T3(tag: Tag) extends Table[Option[String]](tag, "t3") {
def a = column[Option[String]]("a")
def * = a
}
val t3 = TableQuery[T3]
class T4(tag: Tag) extends Table[Option[String]](tag, "t4") {
def a = column[Option[String]]("a", O.NotNull)
def * = a
}
val t4 = TableQuery[T4]
seq(
(t1.schema ++ t2.schema ++ t3.schema ++ t4.schema).create,
(t1.schema ++ t3.schema).create,
t1 += "a",
t2 += "a",
t3 += Some("a"),
t4 += Some("a"),
t2 += null.asInstanceOf[String],
t3 += None,
(t1 += null.asInstanceOf[String]).failed,
(t4 += None).failed
(t1 += null.asInstanceOf[String]).failed
)
}
Oops, something went wrong.

0 comments on commit 31672a2

Please sign in to comment.