|
|
@ -45,194 +45,197 @@ import java.util.List;
|
|
|
|
*
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
public class MobileFeaturePropertyDAOTestSuite {
|
|
|
|
public class MobileFeaturePropertyDAOTestSuite {
|
|
|
|
private static final Log log = LogFactory.getLog(MobileFeaturePropertyDAOTestSuite.class);
|
|
|
|
|
|
|
|
public static final String MBL_FEATURE_NAME = "WIFI";
|
|
|
|
private static final Log log = LogFactory.getLog(MobileFeaturePropertyDAOTestSuite.class);
|
|
|
|
private static final String MBL_FEATURE_CODE = "500A";
|
|
|
|
public static final String MBL_FEATURE_NAME = "WIFI";
|
|
|
|
public static final String MBL_FEATURE_DESCRIPTION = "Wifi config";
|
|
|
|
private static final String MBL_FEATURE_CODE = "500A";
|
|
|
|
public static final String MBL_FEATURE_DEVICE_TYPE = "Android";
|
|
|
|
public static final String MBL_FEATURE_DESCRIPTION = "Wifi config";
|
|
|
|
public static final String MBL_FEATURE_PROP_1 = "SSID";
|
|
|
|
public static final String MBL_FEATURE_DEVICE_TYPE = "Android";
|
|
|
|
public static final String MBL_FEATURE_PROP_2 = "PASSWORD";
|
|
|
|
public static final String MBL_FEATURE_PROP_1 = "SSID";
|
|
|
|
private TestDBConfiguration testDBConfiguration;
|
|
|
|
public static final String MBL_FEATURE_PROP_2 = "PASSWORD";
|
|
|
|
private MobileFeatureDAOImpl mblFeatureDAO;
|
|
|
|
private TestDBConfiguration testDBConfiguration;
|
|
|
|
private MobileFeaturePropertyDAOImpl mobileFeaturePropertyDAO;
|
|
|
|
private MobileFeatureDAOImpl mblFeatureDAO;
|
|
|
|
private int mblFeatureId;
|
|
|
|
private MobileFeaturePropertyDAOImpl mobileFeaturePropertyDAO;
|
|
|
|
|
|
|
|
private int mblFeatureId;
|
|
|
|
@BeforeClass
|
|
|
|
|
|
|
|
@Parameters("dbType")
|
|
|
|
@BeforeClass
|
|
|
|
public void setUpDB(String dbTypeStr) throws Exception {
|
|
|
|
@Parameters("dbType")
|
|
|
|
|
|
|
|
public void setUpDB(String dbTypeStr) throws Exception {
|
|
|
|
DBTypes dbType = DBTypes.valueOf(dbTypeStr);
|
|
|
|
|
|
|
|
testDBConfiguration = MobileDatabaseUtils.getTestDBConfiguration(dbType);
|
|
|
|
DBTypes dbType = DBTypes.valueOf(dbTypeStr);
|
|
|
|
|
|
|
|
testDBConfiguration = MobileDatabaseUtils.getTestDBConfiguration(dbType);
|
|
|
|
switch (dbType) {
|
|
|
|
|
|
|
|
case H2:
|
|
|
|
switch (dbType) {
|
|
|
|
MobileDatabaseUtils.createH2DB(testDBConfiguration);
|
|
|
|
case H2:
|
|
|
|
DataSource testDataSource = new org.apache.tomcat.jdbc.pool.DataSource();
|
|
|
|
MobileDatabaseUtils.createH2DB(testDBConfiguration);
|
|
|
|
PoolProperties properties = new PoolProperties();
|
|
|
|
DataSource testDataSource = new org.apache.tomcat.jdbc.pool.DataSource();
|
|
|
|
properties.setUrl(testDBConfiguration.getConnectionURL());
|
|
|
|
PoolProperties properties = new PoolProperties();
|
|
|
|
properties.setDriverClassName(testDBConfiguration.getDriverClassName());
|
|
|
|
properties.setUrl(testDBConfiguration.getConnectionURL());
|
|
|
|
properties.setUsername(testDBConfiguration.getUsername());
|
|
|
|
properties.setDriverClassName(testDBConfiguration.getDriverClassName());
|
|
|
|
properties.setPassword(testDBConfiguration.getPassword());
|
|
|
|
properties.setUsername(testDBConfiguration.getUsername());
|
|
|
|
testDataSource.setPoolProperties(properties);
|
|
|
|
properties.setPassword(testDBConfiguration.getPassword());
|
|
|
|
mblFeatureDAO = new MobileFeatureDAOImpl(testDataSource);
|
|
|
|
testDataSource.setPoolProperties(properties);
|
|
|
|
mobileFeaturePropertyDAO = new MobileFeaturePropertyDAOImpl(testDataSource);
|
|
|
|
mblFeatureDAO = new MobileFeatureDAOImpl(testDataSource);
|
|
|
|
default:
|
|
|
|
mobileFeaturePropertyDAO = new MobileFeaturePropertyDAOImpl(testDataSource);
|
|
|
|
}
|
|
|
|
default:
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
@Test
|
|
|
|
|
|
|
|
public void addMobileFeaturePropertyTest()
|
|
|
|
@Test
|
|
|
|
throws MobileDeviceManagementDAOException {
|
|
|
|
public void addMobileFeaturePropertyTest()
|
|
|
|
|
|
|
|
throws MobileDeviceManagementDAOException {
|
|
|
|
Connection conn = null;
|
|
|
|
|
|
|
|
PreparedStatement preparedStatement = null;
|
|
|
|
Connection conn = null;
|
|
|
|
List<MobileFeatureProperty> propertyList = new ArrayList<MobileFeatureProperty>();
|
|
|
|
PreparedStatement preparedStatement = null;
|
|
|
|
//Add a new MobileFeature to the database
|
|
|
|
List<MobileFeatureProperty> propertyList = new ArrayList<MobileFeatureProperty>();
|
|
|
|
MobileFeature mobileFeature = new MobileFeature();
|
|
|
|
//Add a new MobileFeature to the database
|
|
|
|
mobileFeature.setCode(MBL_FEATURE_CODE);
|
|
|
|
MobileFeature mobileFeature = new MobileFeature();
|
|
|
|
mobileFeature.setDescription(MBL_FEATURE_DESCRIPTION);
|
|
|
|
mobileFeature.setCode(MBL_FEATURE_CODE);
|
|
|
|
mobileFeature.setName(MBL_FEATURE_NAME);
|
|
|
|
mobileFeature.setDescription(MBL_FEATURE_DESCRIPTION);
|
|
|
|
mobileFeature.setDeviceType(MBL_FEATURE_DEVICE_TYPE);
|
|
|
|
mobileFeature.setName(MBL_FEATURE_NAME);
|
|
|
|
mblFeatureId = mblFeatureDAO.addMobileFeature(mobileFeature);
|
|
|
|
mobileFeature.setDeviceType(MBL_FEATURE_DEVICE_TYPE);
|
|
|
|
|
|
|
|
mblFeatureDAO.addFeature(mobileFeature);
|
|
|
|
//Add 1st property to the feature
|
|
|
|
|
|
|
|
MobileFeatureProperty mobileFeatureProperty = new MobileFeatureProperty();
|
|
|
|
MobileFeature persistMblFeature = mblFeatureDAO.getFeatureByCode(MBL_FEATURE_CODE);
|
|
|
|
mobileFeatureProperty.setFeatureID(mblFeatureId);
|
|
|
|
mblFeatureId = persistMblFeature.getId();
|
|
|
|
mobileFeatureProperty.setProperty(MBL_FEATURE_PROP_1);
|
|
|
|
//Add 1st property to the feature
|
|
|
|
boolean status1 = mobileFeaturePropertyDAO.addMobileFeatureProperty(mobileFeatureProperty);
|
|
|
|
MobileFeatureProperty mobileFeatureProperty = new MobileFeatureProperty();
|
|
|
|
|
|
|
|
mobileFeatureProperty.setFeatureID(mblFeatureId);
|
|
|
|
//Add 2nd property to the feature
|
|
|
|
mobileFeatureProperty.setProperty(MBL_FEATURE_PROP_1);
|
|
|
|
mobileFeatureProperty.setProperty(MBL_FEATURE_PROP_2);
|
|
|
|
boolean status1 = mobileFeaturePropertyDAO.addMobileFeatureProperty(mobileFeatureProperty);
|
|
|
|
boolean status2 = mobileFeaturePropertyDAO.addMobileFeatureProperty(mobileFeatureProperty);
|
|
|
|
|
|
|
|
try {
|
|
|
|
//Add 2nd property to the feature
|
|
|
|
conn = DriverManager.getConnection(testDBConfiguration.getConnectionURL());
|
|
|
|
mobileFeatureProperty.setProperty(MBL_FEATURE_PROP_2);
|
|
|
|
String query =
|
|
|
|
boolean status2 = mobileFeaturePropertyDAO.addMobileFeatureProperty(mobileFeatureProperty);
|
|
|
|
"SELECT FEATURE_ID, PROPERTY FROM AD_FEATURE_PROPERTY WHERE FEATURE_ID = ?";
|
|
|
|
try {
|
|
|
|
preparedStatement = conn.prepareStatement(query);
|
|
|
|
conn = DriverManager.getConnection(testDBConfiguration.getConnectionURL());
|
|
|
|
preparedStatement.setInt(1, mblFeatureId);
|
|
|
|
String query =
|
|
|
|
ResultSet resultSet = preparedStatement.executeQuery();
|
|
|
|
"SELECT FEATURE_ID, PROPERTY FROM AD_FEATURE_PROPERTY WHERE FEATURE_ID = ?";
|
|
|
|
|
|
|
|
preparedStatement = conn.prepareStatement(query);
|
|
|
|
while (resultSet.next()) {
|
|
|
|
preparedStatement.setInt(1, mblFeatureId);
|
|
|
|
mobileFeatureProperty = new MobileFeatureProperty();
|
|
|
|
ResultSet resultSet = preparedStatement.executeQuery();
|
|
|
|
mobileFeatureProperty.setFeatureID(resultSet.getInt(1));
|
|
|
|
|
|
|
|
mobileFeatureProperty.setProperty(resultSet.getString(2));
|
|
|
|
while (resultSet.next()) {
|
|
|
|
propertyList.add(mobileFeatureProperty);
|
|
|
|
mobileFeatureProperty = new MobileFeatureProperty();
|
|
|
|
}
|
|
|
|
mobileFeatureProperty.setFeatureID(resultSet.getInt(1));
|
|
|
|
} catch (SQLException e) {
|
|
|
|
mobileFeatureProperty.setProperty(resultSet.getString(2));
|
|
|
|
String msg = "Error in retrieving Mobile Feature data ";
|
|
|
|
propertyList.add(mobileFeatureProperty);
|
|
|
|
log.error(msg, e);
|
|
|
|
}
|
|
|
|
throw new MobileDeviceManagementDAOException(msg, e);
|
|
|
|
} catch (SQLException e) {
|
|
|
|
} finally {
|
|
|
|
String msg = "Error in retrieving Mobile Feature data ";
|
|
|
|
MobileDatabaseUtils.cleanupResources(conn, preparedStatement, null);
|
|
|
|
log.error(msg, e);
|
|
|
|
}
|
|
|
|
throw new MobileDeviceManagementDAOException(msg, e);
|
|
|
|
Assert.assertTrue(status1, "MobileFeatureProperty1 has added ");
|
|
|
|
} finally {
|
|
|
|
Assert.assertTrue(status2, "MobileFeatureProperty2 has added ");
|
|
|
|
MobileDatabaseUtils.cleanupResources(conn, preparedStatement, null);
|
|
|
|
Assert.assertTrue(propertyList.size() == 2, "MobileFeatureProperties have retrieved ");
|
|
|
|
}
|
|
|
|
|
|
|
|
Assert.assertTrue(status1, "MobileFeatureProperty1 has added ");
|
|
|
|
for (MobileFeatureProperty mblFeatureProperty : propertyList) {
|
|
|
|
Assert.assertTrue(status2, "MobileFeatureProperty2 has added ");
|
|
|
|
Assert.assertNotNull(mblFeatureProperty.getProperty(),
|
|
|
|
Assert.assertTrue(propertyList.size() == 2, "MobileFeatureProperties have retrieved ");
|
|
|
|
"MobileFeatureProperty property has persisted ");
|
|
|
|
|
|
|
|
Assert.assertNotNull(mblFeatureProperty.getFeatureID(),
|
|
|
|
for (MobileFeatureProperty mblFeatureProperty : propertyList) {
|
|
|
|
"MobileFeatureProperty feature-id has persisted ");
|
|
|
|
Assert.assertNotNull(mblFeatureProperty.getProperty(),
|
|
|
|
}
|
|
|
|
"MobileFeatureProperty property has persisted ");
|
|
|
|
|
|
|
|
Assert.assertNotNull(mblFeatureProperty.getFeatureID(),
|
|
|
|
}
|
|
|
|
"MobileFeatureProperty feature-id has persisted ");
|
|
|
|
|
|
|
|
}
|
|
|
|
@Test(dependsOnMethods = { "addMobileFeaturePropertyTest" })
|
|
|
|
|
|
|
|
public void getMobileFeaturePropertyTest()
|
|
|
|
}
|
|
|
|
throws MobileDeviceManagementDAOException {
|
|
|
|
|
|
|
|
MobileFeatureProperty mobileFeatureProperty =
|
|
|
|
@Test(dependsOnMethods = { "addMobileFeaturePropertyTest" })
|
|
|
|
mobileFeaturePropertyDAO.getMobileFeatureProperty(MBL_FEATURE_PROP_1);
|
|
|
|
public void getMobileFeaturePropertyTest()
|
|
|
|
Assert.assertNotNull(mobileFeatureProperty, "MobileFeatureProperty has retrieved ");
|
|
|
|
throws MobileDeviceManagementDAOException {
|
|
|
|
Assert.assertEquals(MBL_FEATURE_PROP_1, mobileFeatureProperty.getProperty(),
|
|
|
|
MobileFeatureProperty mobileFeatureProperty =
|
|
|
|
"MobileFeatureProperty property has retrieved ");
|
|
|
|
mobileFeaturePropertyDAO.getMobileFeatureProperty(MBL_FEATURE_PROP_1);
|
|
|
|
Assert.assertTrue(mblFeatureId == mobileFeatureProperty.getFeatureID(),
|
|
|
|
Assert.assertNotNull(mobileFeatureProperty, "MobileFeatureProperty has retrieved ");
|
|
|
|
"MobileFeatureProperty featureId has retrieved ");
|
|
|
|
Assert.assertEquals(MBL_FEATURE_PROP_1, mobileFeatureProperty.getProperty(),
|
|
|
|
}
|
|
|
|
"MobileFeatureProperty property has retrieved ");
|
|
|
|
|
|
|
|
Assert.assertTrue(mblFeatureId == mobileFeatureProperty.getFeatureID(),
|
|
|
|
@Test(dependsOnMethods = { "addMobileFeaturePropertyTest" })
|
|
|
|
"MobileFeatureProperty featureId has retrieved ");
|
|
|
|
public void getFeaturePropertyOfFeatureTest()
|
|
|
|
}
|
|
|
|
throws MobileDeviceManagementDAOException {
|
|
|
|
|
|
|
|
List<MobileFeatureProperty> mobileFeatureProperties =
|
|
|
|
@Test(dependsOnMethods = { "addMobileFeaturePropertyTest" })
|
|
|
|
mobileFeaturePropertyDAO.getFeaturePropertiesOfFeature(mblFeatureId);
|
|
|
|
public void getFeaturePropertyOfFeatureTest()
|
|
|
|
Assert.assertNotNull(mobileFeatureProperties, "MobileFeatureProperty list has retrieved ");
|
|
|
|
throws MobileDeviceManagementDAOException {
|
|
|
|
Assert.assertTrue(mobileFeatureProperties.size() == 2,
|
|
|
|
List<MobileFeatureProperty> mobileFeatureProperties =
|
|
|
|
"MobileFeatureProperties have fetched ");
|
|
|
|
mobileFeaturePropertyDAO.getFeaturePropertiesOfFeature(mblFeatureId);
|
|
|
|
for (MobileFeatureProperty mblFeatureProperty : mobileFeatureProperties) {
|
|
|
|
Assert.assertNotNull(mobileFeatureProperties, "MobileFeatureProperty list has retrieved ");
|
|
|
|
Assert.assertNotNull(mblFeatureProperty.getProperty(),
|
|
|
|
Assert.assertTrue(mobileFeatureProperties.size() == 2,
|
|
|
|
"MobileFeatureProperty property has fetched ");
|
|
|
|
"MobileFeatureProperties have fetched ");
|
|
|
|
Assert.assertNotNull(mblFeatureProperty.getFeatureID(),
|
|
|
|
for (MobileFeatureProperty mblFeatureProperty : mobileFeatureProperties) {
|
|
|
|
"MobileFeatureProperty feature-id has fetched ");
|
|
|
|
Assert.assertNotNull(mblFeatureProperty.getProperty(),
|
|
|
|
}
|
|
|
|
"MobileFeatureProperty property has fetched ");
|
|
|
|
}
|
|
|
|
Assert.assertNotNull(mblFeatureProperty.getFeatureID(),
|
|
|
|
|
|
|
|
"MobileFeatureProperty feature-id has fetched ");
|
|
|
|
@Test(dependsOnMethods = { "addMobileFeaturePropertyTest", "getMobileFeaturePropertyTest",
|
|
|
|
}
|
|
|
|
"getFeaturePropertyOfFeatureTest" }, expectedExceptions = MobileDeviceManagementDAOException.class)
|
|
|
|
}
|
|
|
|
public void updateMobileFeaturePropertyTest() throws MobileDeviceManagementDAOException {
|
|
|
|
|
|
|
|
//Update 1st property to a non-exist feature
|
|
|
|
@Test(dependsOnMethods = { "addMobileFeaturePropertyTest", "getMobileFeaturePropertyTest",
|
|
|
|
MobileFeatureProperty mobileFeatureProperty = new MobileFeatureProperty();
|
|
|
|
"getFeaturePropertyOfFeatureTest" }, expectedExceptions = MobileDeviceManagementDAOException.class)
|
|
|
|
mobileFeatureProperty.setFeatureID(2);
|
|
|
|
public void updateMobileFeaturePropertyTest() throws MobileDeviceManagementDAOException {
|
|
|
|
mobileFeatureProperty.setProperty(MBL_FEATURE_PROP_1);
|
|
|
|
//Update 1st property to a non-exist feature
|
|
|
|
mobileFeaturePropertyDAO.updateMobileFeatureProperty(mobileFeatureProperty);
|
|
|
|
MobileFeatureProperty mobileFeatureProperty = new MobileFeatureProperty();
|
|
|
|
}
|
|
|
|
mobileFeatureProperty.setFeatureID(2);
|
|
|
|
|
|
|
|
mobileFeatureProperty.setProperty(MBL_FEATURE_PROP_1);
|
|
|
|
@Test(dependsOnMethods = { "addMobileFeaturePropertyTest", "getMobileFeaturePropertyTest",
|
|
|
|
mobileFeaturePropertyDAO.updateMobileFeatureProperty(mobileFeatureProperty);
|
|
|
|
"getFeaturePropertyOfFeatureTest" })
|
|
|
|
}
|
|
|
|
public void deleteMobileFeaturePropertyTest()
|
|
|
|
|
|
|
|
throws MobileDeviceManagementDAOException {
|
|
|
|
@Test(dependsOnMethods = { "addMobileFeaturePropertyTest", "getMobileFeaturePropertyTest",
|
|
|
|
Connection conn = null;
|
|
|
|
"getFeaturePropertyOfFeatureTest" })
|
|
|
|
PreparedStatement preparedStatement = null;
|
|
|
|
public void deleteMobileFeaturePropertyTest()
|
|
|
|
boolean status =
|
|
|
|
throws MobileDeviceManagementDAOException {
|
|
|
|
mobileFeaturePropertyDAO.deleteMobileFeatureProperty(MBL_FEATURE_PROP_2);
|
|
|
|
Connection conn = null;
|
|
|
|
try {
|
|
|
|
PreparedStatement preparedStatement = null;
|
|
|
|
conn = DriverManager.getConnection(testDBConfiguration.getConnectionURL());
|
|
|
|
boolean status =
|
|
|
|
String query =
|
|
|
|
mobileFeaturePropertyDAO.deleteMobileFeatureProperty(MBL_FEATURE_PROP_2);
|
|
|
|
"SELECT PROPERTY, FEATURE_ID FROM AD_FEATURE_PROPERTY WHERE PROPERTY = ?";
|
|
|
|
try {
|
|
|
|
preparedStatement = conn.prepareStatement(query);
|
|
|
|
conn = DriverManager.getConnection(testDBConfiguration.getConnectionURL());
|
|
|
|
preparedStatement.setString(1, MBL_FEATURE_PROP_2);
|
|
|
|
String query =
|
|
|
|
ResultSet resultSet = preparedStatement.executeQuery();
|
|
|
|
"SELECT PROPERTY, FEATURE_ID FROM AD_FEATURE_PROPERTY WHERE PROPERTY = ?";
|
|
|
|
|
|
|
|
preparedStatement = conn.prepareStatement(query);
|
|
|
|
if (resultSet.next()) {
|
|
|
|
preparedStatement.setString(1, MBL_FEATURE_PROP_2);
|
|
|
|
status = false;
|
|
|
|
ResultSet resultSet = preparedStatement.executeQuery();
|
|
|
|
}
|
|
|
|
|
|
|
|
} catch (SQLException e) {
|
|
|
|
if (resultSet.next()) {
|
|
|
|
String msg = "Error in retrieving MobileFeatureProperty data ";
|
|
|
|
status = false;
|
|
|
|
log.error(msg, e);
|
|
|
|
}
|
|
|
|
throw new MobileDeviceManagementDAOException(msg, e);
|
|
|
|
} catch (SQLException e) {
|
|
|
|
} finally {
|
|
|
|
String msg = "Error in retrieving MobileFeatureProperty data ";
|
|
|
|
MobileDatabaseUtils.cleanupResources(conn, preparedStatement, null);
|
|
|
|
log.error(msg, e);
|
|
|
|
}
|
|
|
|
throw new MobileDeviceManagementDAOException(msg, e);
|
|
|
|
Assert.assertTrue(status, "MobileFeatureProperty has deleted ");
|
|
|
|
} finally {
|
|
|
|
}
|
|
|
|
MobileDatabaseUtils.cleanupResources(conn, preparedStatement, null);
|
|
|
|
|
|
|
|
}
|
|
|
|
@Test(dependsOnMethods = { "addMobileFeaturePropertyTest", "getMobileFeaturePropertyTest",
|
|
|
|
Assert.assertTrue(status, "MobileFeatureProperty has deleted ");
|
|
|
|
"getFeaturePropertyOfFeatureTest" , "updateMobileFeaturePropertyTest",
|
|
|
|
}
|
|
|
|
"deleteMobileFeaturePropertyTest"})
|
|
|
|
|
|
|
|
public void deleteMobileFeaturePropertiesOfFeatureTest()
|
|
|
|
@Test(dependsOnMethods = { "addMobileFeaturePropertyTest", "getMobileFeaturePropertyTest",
|
|
|
|
throws MobileDeviceManagementDAOException {
|
|
|
|
"getFeaturePropertyOfFeatureTest", "updateMobileFeaturePropertyTest",
|
|
|
|
Connection conn = null;
|
|
|
|
"deleteMobileFeaturePropertyTest" })
|
|
|
|
PreparedStatement preparedStatement = null;
|
|
|
|
public void deleteMobileFeaturePropertiesOfFeatureTest()
|
|
|
|
boolean status =
|
|
|
|
throws MobileDeviceManagementDAOException {
|
|
|
|
mobileFeaturePropertyDAO.deleteMobileFeaturePropertiesOfFeature(mblFeatureId);
|
|
|
|
Connection conn = null;
|
|
|
|
try {
|
|
|
|
PreparedStatement preparedStatement = null;
|
|
|
|
conn = DriverManager.getConnection(testDBConfiguration.getConnectionURL());
|
|
|
|
boolean status =
|
|
|
|
String query =
|
|
|
|
mobileFeaturePropertyDAO.deleteMobileFeaturePropertiesOfFeature(mblFeatureId);
|
|
|
|
"SELECT PROPERTY, FEATURE_ID FROM AD_FEATURE_PROPERTY WHERE FEATURE_ID = ?";
|
|
|
|
try {
|
|
|
|
preparedStatement = conn.prepareStatement(query);
|
|
|
|
conn = DriverManager.getConnection(testDBConfiguration.getConnectionURL());
|
|
|
|
preparedStatement.setInt(1, mblFeatureId);
|
|
|
|
String query =
|
|
|
|
ResultSet resultSet = preparedStatement.executeQuery();
|
|
|
|
"SELECT PROPERTY, FEATURE_ID FROM AD_FEATURE_PROPERTY WHERE FEATURE_ID = ?";
|
|
|
|
|
|
|
|
preparedStatement = conn.prepareStatement(query);
|
|
|
|
if (resultSet.next()) {
|
|
|
|
preparedStatement.setInt(1, mblFeatureId);
|
|
|
|
status = false;
|
|
|
|
ResultSet resultSet = preparedStatement.executeQuery();
|
|
|
|
}
|
|
|
|
|
|
|
|
} catch (SQLException e) {
|
|
|
|
if (resultSet.next()) {
|
|
|
|
String msg = "Error in retrieving MobileFeatureProperty data ";
|
|
|
|
status = false;
|
|
|
|
log.error(msg, e);
|
|
|
|
}
|
|
|
|
throw new MobileDeviceManagementDAOException(msg, e);
|
|
|
|
} catch (SQLException e) {
|
|
|
|
} finally {
|
|
|
|
String msg = "Error in retrieving MobileFeatureProperty data ";
|
|
|
|
MobileDatabaseUtils.cleanupResources(conn, preparedStatement, null);
|
|
|
|
log.error(msg, e);
|
|
|
|
}
|
|
|
|
throw new MobileDeviceManagementDAOException(msg, e);
|
|
|
|
Assert.assertTrue(status, "MobileFeatureProperties has deleted ");
|
|
|
|
} finally {
|
|
|
|
}
|
|
|
|
MobileDatabaseUtils.cleanupResources(conn, preparedStatement, null);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
Assert.assertTrue(status, "MobileFeatureProperties has deleted ");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|