aboutsummaryrefslogtreecommitdiffstats
path: root/src/test/java/com
diff options
context:
space:
mode:
authorJames Ahlborn <jtahlborn@yahoo.com>2014-09-09 01:23:27 +0000
committerJames Ahlborn <jtahlborn@yahoo.com>2014-09-09 01:23:27 +0000
commit7d4abaafe28d9dfb61480c9d29b24bbd9a0001e3 (patch)
tree26630d278e4afafa18e1a0940d4fa786344c2f8b /src/test/java/com
parentd608f41a7ac08274eed9adc95ae18674050c8720 (diff)
downloadjackcess-7d4abaafe28d9dfb61480c9d29b24bbd9a0001e3.tar.gz
jackcess-7d4abaafe28d9dfb61480c9d29b24bbd9a0001e3.zip
add some unit test for property type inference
git-svn-id: https://svn.code.sf.net/p/jackcess/code/jackcess/trunk@871 f203690c-595d-4dc9-a70b-905162fa7fd2
Diffstat (limited to 'src/test/java/com')
-rw-r--r--src/test/java/com/healthmarketscience/jackcess/PropertiesTest.java18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/test/java/com/healthmarketscience/jackcess/PropertiesTest.java b/src/test/java/com/healthmarketscience/jackcess/PropertiesTest.java
index 182e637..f689328 100644
--- a/src/test/java/com/healthmarketscience/jackcess/PropertiesTest.java
+++ b/src/test/java/com/healthmarketscience/jackcess/PropertiesTest.java
@@ -103,6 +103,24 @@ public class PropertiesTest extends TestCase
colMap.get("buzz")), props);
}
+ public void testInferTypes() throws Exception
+ {
+ PropertyMaps maps = new PropertyMaps(10, null, null);
+ PropertyMap defMap = maps.getDefault();
+
+ assertEquals(DataType.TEXT,
+ defMap.put(PropertyMap.FORMAT_PROP, null).getType());
+ assertEquals(DataType.BOOLEAN,
+ defMap.put(PropertyMap.REQUIRED_PROP, null).getType());
+
+ assertEquals(DataType.TEXT,
+ defMap.put("strprop", "this is a string").getType());
+ assertEquals(DataType.BOOLEAN,
+ defMap.put("boolprop", true).getType());
+ assertEquals(DataType.LONG,
+ defMap.put("intprop", 37).getType());
+ }
+
public void testReadProperties() throws Exception
{
byte[] nameMapBytes = null;