You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@metamodel.apache.org by ar...@apache.org on 2021/01/15 07:43:37 UTC

[metamodel] 04/05: Fail testInsertFailureForStringValueForIntegerColumn if exception isn't thrown

This is an automated email from the ASF dual-hosted git repository.

arjansh pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/metamodel.git

commit e9147fccd296035a5d371adc92cf00ef166481c6
Author: William Edmisten <wc...@gmail.com>
AuthorDate: Fri Jan 8 16:13:03 2021 -0500

    Fail testInsertFailureForStringValueForIntegerColumn if exception isn't thrown
---
 .../org/apache/metamodel/jdbc/integrationtests/PostgresqlTest.java   | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/jdbc/src/test/java/org/apache/metamodel/jdbc/integrationtests/PostgresqlTest.java b/jdbc/src/test/java/org/apache/metamodel/jdbc/integrationtests/PostgresqlTest.java
index 6e96eba..b646de0 100644
--- a/jdbc/src/test/java/org/apache/metamodel/jdbc/integrationtests/PostgresqlTest.java
+++ b/jdbc/src/test/java/org/apache/metamodel/jdbc/integrationtests/PostgresqlTest.java
@@ -21,6 +21,7 @@ package org.apache.metamodel.jdbc.integrationtests;
 import java.lang.reflect.Method;
 import java.sql.Connection;
 import java.sql.DatabaseMetaData;
+import java.sql.SQLException;
 import java.util.*;
 import java.util.concurrent.TimeUnit;
 
@@ -757,10 +758,12 @@ public class PostgresqlTest extends AbstractJdbIntegrationTest {
                             "Column[name=age,columnNumber=2,type=INTEGER,nullable=true,nativeType=int4,columnSize=10]",
                             table.getColumnByName("age").toString());
 
-                    cb.insertInto(table).value("person name", "John Doe").value("age", 42).execute();
+                    cb.insertInto(table).value("person name", "John Doe").value("age", "42").execute();
                 }
             });
 
+            fail("No expected java.sql.BatchUpdateException occurred at case.");
+
         } catch (Exception e) {
             String message = e.getMessage().replaceAll("\n", " ");
             assertEquals(