CategoryInfo category = DeviceManager.getCategories().get(0);
// add Device
addDevice(category, "dev", "device");
// can use new Device
{
DeviceInfo device = DeviceManager.getDevice("dev");
assertEquals("device", device.getName());
assertEquals(new Rectangle(1, 2, 10, 20), device.getDisplayBounds());
assertEquals(10, device.getImage().getBounds().width);
assertEquals(20, device.getImage().getBounds().height);
}
// reload
DeviceManager.commandsWrite();
DeviceManager.forceReload();
// still can use new Device
{
DeviceInfo device = DeviceManager.getDevice("dev");
assertEquals("device", device.getName());
assertEquals(new Rectangle(1, 2, 10, 20), device.getDisplayBounds());
assertEquals(10, device.getImage().getBounds().width);
assertEquals(20, device.getImage().getBounds().height);
}
}