aboutsummaryrefslogtreecommitdiffstats
path: root/src/test
diff options
context:
space:
mode:
authorJames Moger <james.moger@gitblit.com>2016-04-04 16:29:28 -0400
committerJames Moger <james.moger@gitblit.com>2016-04-04 16:29:34 -0400
commit13b08bb1e5a955650289c1c2d548883bfeac0de9 (patch)
tree52708d5458f962f845a01a45ef49f78d1421fb83 /src/test
parentc4c87e4ce044d84d5f2c4e7fa8709e5d699edf8f (diff)
downloadiciql-13b08bb1e5a955650289c1c2d548883bfeac0de9.tar.gz
iciql-13b08bb1e5a955650289c1c2d548883bfeac0de9.zip
Fixes #15: String field not properly trimmed on discrete set
Diffstat (limited to 'src/test')
-rw-r--r--src/test/java/com/iciql/test/ModelsTest.java13
-rw-r--r--src/test/java/com/iciql/test/models/SupportedTypes.java2
2 files changed, 14 insertions, 1 deletions
diff --git a/src/test/java/com/iciql/test/ModelsTest.java b/src/test/java/com/iciql/test/ModelsTest.java
index 683e494..ff27bf5 100644
--- a/src/test/java/com/iciql/test/ModelsTest.java
+++ b/src/test/java/com/iciql/test/ModelsTest.java
@@ -147,4 +147,17 @@ public class ModelsTest {
assertEquals(0, models.get(0).length());
}
}
+
+ @Test
+ public void testDiscreteUpdateStringTrimming() {
+ List<SupportedTypes> original = SupportedTypes.createList();
+ db.insertAll(original);
+ SupportedTypes s1 = db.from(SupportedTypes.SAMPLE).where(SupportedTypes.SAMPLE.id).is(1).selectFirst();
+ db.from(SupportedTypes.SAMPLE)
+ .set(SupportedTypes.SAMPLE.myString)
+ .to(s1.myString + s1.myString + s1.myString + s1.myString)
+ .update();
+ SupportedTypes s2 = db.from(SupportedTypes.SAMPLE).where(SupportedTypes.SAMPLE.id).is(1).selectFirst();
+ assertEquals(40, s2.myString.length());
+ }
}
diff --git a/src/test/java/com/iciql/test/models/SupportedTypes.java b/src/test/java/com/iciql/test/models/SupportedTypes.java
index 0383d7f..3b0e694 100644
--- a/src/test/java/com/iciql/test/models/SupportedTypes.java
+++ b/src/test/java/com/iciql/test/models/SupportedTypes.java
@@ -89,7 +89,7 @@ public class SupportedTypes implements Serializable {
@IQColumn(length = 10, scale = 5)
private BigDecimal myBigDecimal;
- @IQColumn(length = 40)
+ @IQColumn(length = 40, trim = true)
public String myString;
@IQColumn