private static final String COMPONENT_NAME_PROPERTY_ID = PropertyHelper.getPropertyId("HostRoles", "component_name");
@Test
public void testPopulateResources() throws Exception {
ConnectionFactory connectionFactory = createNiceMock(ConnectionFactory.class);
Connection connection = createNiceMock(Connection.class);
PreparedStatement statement = createNiceMock(PreparedStatement.class);
ResultSet resultSet = createNiceMock(ResultSet.class);
// set expectations
expect(connectionFactory.getConnection()).andReturn(connection).once();
expect(connection.prepareStatement((String) anyObject())).andReturn(statement).once();
expect(statement.executeQuery()).andReturn(resultSet).once();
expect(resultSet.next()).andReturn(true);
expect(resultSet.getLong("RecordTimeStamp")).andReturn(999990L);
expect(resultSet.getNString("MetricValue")).andReturn("0");