@Test
public void testModel() throws SQLException {

	SimpleDbViewModelService ms = new SimpleDbViewModelService(ds);
	@SuppressWarnings("unchecked")
	Template<Integer> template = mock(Template.class);
	Map<String, String> modelProperties = new HashMap<String, String>();
	modelProperties.put(SimpleDbViewModelService.VIEW_NAME, "TESTDBVIEW");
	modelProperties.put(SimpleDbViewModelService.PRIMARY_KEY_COLUMN_NAME,
			"ID");
	when(template.getProperties()).thenReturn(modelProperties);
	when(template.getInputType()).then(new Answer<Class<?>>() {
		@Override
		public Class<?> answer(InvocationOnMock invocation)
				throws Throwable {
			return Integer.class;
		}
	});
	WteDataModel model = ms.createModel(template, new Integer(1));
	assertNotNull(model.getValue("id"));
	assertNotNull(model.getValue("testboolean"));
	assertNotNull(model.getValue("testvarchar255"));
	assertNotNull(model.getValue("testtimestamp"));
	assertNotNull(model.getValue("testtime"));
	assertNotNull(model.getValue("testdate"));
	assertNotNull(model.getValue("testchar255"));
	assertNotNull(model.getValue("testlongvarchar255"));
	assertNotNull(model.getValue("testtinyint"));
	assertNotNull(model.getValue("testsmallint"));
	assertNotNull(model.getValue("testint"));
	assertNotNull(model.getValue("testreal"));
	assertNotNull(model.getValue("testfloat"));
	assertNotNull(model.getValue("testnumeric"));
	assertNotNull(model.getValue("testdecimal"));
}