TypeDao { public List<String> getTypeList(OBridgeConfiguration c) { assert c != null; String sourcesTable = c.getSourcesTable() != null ? c.getSourcesTable() : null; String query = "SELECT type_name FROM all_types WHERE typecode = 'OBJECT'"; if (c.getSourceOwner() != null) { query += "and owner = '" + c.getSourceOwner() + "'"; } else { query += "and owner = user"; } if (sourcesTable != null) { query += " AND type_name in (SELECT object_name from " + sourcesTable + " where object_type = 'TYPE' and project_name='" + c.getProjectName() + "')"; } return jdbcTemplate.queryForList(query); } TypeDao(DataSource dataSource); List<String> getTypeList(OBridgeConfiguration c); List<TypeAttribute> getTypeAttributes(String typeName, String owner); List<String> getEmbeddedTypeList(String owner); List<TypeAttribute> getEmbeddedTypeAttributes(String typeName, String owner);  }
@Test public void testGetTypeList() { OBridgeConfiguration oBridgeConfiguration = new OBridgeConfiguration(); List<String> typeList = typeDao.getTypeList(oBridgeConfiguration); Assert.assertTrue(typeList.contains(SAMPLE_TYPE_ONE)); Assert.assertTrue(typeList.contains(SAMPLE_TYPE_TWO)); Assert.assertFalse(typeList.contains(SAMPLE_TYPE_ONE_LIST)); Assert.assertFalse(typeList.contains(NOT_EXISTING_TYPE)); }