[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[libeufin] branch master updated: testing composite primary keys
From: |
gnunet |
Subject: |
[libeufin] branch master updated: testing composite primary keys |
Date: |
Sat, 27 Jun 2020 23:02:38 +0200 |
This is an automated email from the git hooks/post-receive script.
ms pushed a commit to branch master
in repository libeufin.
The following commit(s) were added to refs/heads/master by this push:
new dc72383 testing composite primary keys
dc72383 is described below
commit dc723836229868294ea3bfdcaa76550e662bda23
Author: MS <ms@taler.net>
AuthorDate: Sat Jun 27 23:02:05 2020 +0200
testing composite primary keys
---
nexus/src/test/kotlin/DBTest.kt | 30 ++++++++++++++++++++++++++----
1 file changed, 26 insertions(+), 4 deletions(-)
diff --git a/nexus/src/test/kotlin/DBTest.kt b/nexus/src/test/kotlin/DBTest.kt
index 2dc2ebc..d44f92a 100644
--- a/nexus/src/test/kotlin/DBTest.kt
+++ b/nexus/src/test/kotlin/DBTest.kt
@@ -1,9 +1,7 @@
package tech.libeufin.nexus
-import org.jetbrains.exposed.sql.Database
-import org.jetbrains.exposed.sql.SchemaUtils
-import org.jetbrains.exposed.sql.StdOutSqlLogger
-import org.jetbrains.exposed.sql.addLogger
+import org.jetbrains.exposed.exceptions.ExposedSQLException
+import org.jetbrains.exposed.sql.*
import org.jetbrains.exposed.sql.transactions.transaction
import org.junit.Test
import java.io.File
@@ -32,8 +30,32 @@ fun withTestDatabase(f: () -> Unit) {
}
}
+object MyTable : Table() {
+ val col1 = text("col1")
+ val col2 = text("col2")
+ override val primaryKey = PrimaryKey(col1, col2)
+}
class DBTest {
+ @Test(expected = ExposedSQLException::class)
+ fun sqlDslTest() {
+ withTestDatabase {
+ transaction {
+ addLogger(StdOutSqlLogger)
+ SchemaUtils.create(MyTable)
+ MyTable.insert {
+ it[col1] = "foo"
+ it[col2] = "bar"
+ }
+ // should throw ExposedSQLException
+ MyTable.insert {
+ it[col1] = "foo"
+ it[col2] = "bar"
+ }
+ }
+ }
+ }
+
@Test
fun facadeConfigTest() {
withTestDatabase {
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [libeufin] branch master updated: testing composite primary keys,
gnunet <=