public void testRemoveDevice() throws Exception {
TemporaryFileManager tempFileMgr = new TemporaryFileManager(
new TestDeviceRepositoryCreator());
tempFileMgr.executeWith(new TemporaryFileExecutor() {
public void execute(File repository) throws Exception {
DeviceRepositoryAccessorManager manager =
new DeviceRepositoryAccessorManager(
repository.getPath(),
new TestTransformerMetaFactory(),
new DefaultJDOMFactory(), false);
final String deviceName = "MyTestDevice";
assertFalse("Test device already exists!",
manager.deviceExists(deviceName));
manager.createDevice("Master", deviceName);
assertNotNull("Device identification element is null!",
manager.retrieveDeviceIdentification(deviceName));
manager.removeDevice(deviceName);
try {
manager.retrieveDeviceIdentification(deviceName);
fail("Expected an illegal argument exception when " +
"looking for ID element for non-existent device");
} catch (IllegalArgumentException e) {
// Expected condition