@Test
public void deleteOneDeviceAndAssert() throws Exception {

    beginTx();
    createTwoDevices();
    List<Device> deviceList = m_deviceDao.findAll();
    assertEquals(2, deviceList.size());
    Device deviceA = m_deviceDao.getDeviceByName(DEVICE_A);
    Device deviceB = m_deviceDao.getDeviceByName(DEVICE_B);
    assertEquals(DEVICE_A, deviceA.getDeviceName());
    assertEquals(DEVICE_B, deviceB.getDeviceName());
    assertNull(m_deviceDao.getDeviceByName(DEVICE_C));
    m_deviceDao.delete(deviceA);
    deviceList = m_deviceDao.findAll();
    assertEquals(1, deviceList.size());
    deviceA = m_deviceDao.getDeviceByName(DEVICE_A);
    deviceB = m_deviceDao.getDeviceByName(DEVICE_B);
    assertNull(deviceA);
    assertEquals(DEVICE_B, deviceB.getDeviceName());
    m_deviceDao.deleteAll();
    closeTx();
}