CommandButtonIconInfo expectedLargeIconInfo = new CommandButtonIconInfo(expectedLargeIcon,
expectedSelectedLargeIcon, expectedRolloverLargeIcon, expectedDisabledLargeIcon,
expectedPressedLargeIcon);
// Create the required mock objects
IconSource iconSource = (IconSource) EasyMock.createMock(IconSource.class);
CommandIconConfigurable configurable = (CommandIconConfigurable) EasyMock
.createMock(CommandIconConfigurable.class);
// Create the configurer with the mock icon source
DefaultApplicationObjectConfigurer configurer = new DefaultApplicationObjectConfigurer(null, null, iconSource,
null);
EasyMock.expect(iconSource.getIcon(iconKey)).andReturn(expectedIcon);
EasyMock.expect(iconSource.getIcon(disabledIconKey)).andReturn(expectedDisabledIcon);
EasyMock.expect(iconSource.getIcon(selectedIconKey)).andReturn(expectedSelectedIcon);
EasyMock.expect(iconSource.getIcon(rolloverIconKey)).andReturn(expectedRolloverIcon);
EasyMock.expect(iconSource.getIcon(pressedIconKey)).andReturn(expectedPressedIcon);
EasyMock.expect(iconSource.getIcon(largeIconKey)).andReturn(expectedLargeIcon);
EasyMock.expect(iconSource.getIcon(disabledLargeIconKey)).andReturn(expectedDisabledLargeIcon);
EasyMock.expect(iconSource.getIcon(selectedLargeIconKey)).andReturn(expectedSelectedLargeIcon);
EasyMock.expect(iconSource.getIcon(rolloverLargeIconKey)).andReturn(expectedRolloverLargeIcon);
EasyMock.expect(iconSource.getIcon(pressedLargeIconKey)).andReturn(expectedPressedLargeIcon);
configurable.setIconInfo(expectedIconInfo);
configurable.setLargeIconInfo(expectedLargeIconInfo);
EasyMock.replay(iconSource);
EasyMock.replay(configurable);
configurer.configure(configurable, objectName);
EasyMock.verify(iconSource);
EasyMock.verify(configurable);
// Reset the mock objects for the next test
EasyMock.reset(iconSource);
EasyMock.reset(configurable);
// Set the expectations. This time the loadOptionalIcons will be set to
// false.
configurer.setLoadOptionalIcons(false);
expectedIconInfo = new CommandButtonIconInfo(expectedIcon);
expectedLargeIconInfo = new CommandButtonIconInfo(expectedLargeIcon);
EasyMock.expect(iconSource.getIcon(iconKey)).andReturn(expectedIcon);
EasyMock.expect(iconSource.getIcon(largeIconKey)).andReturn(expectedLargeIcon);
configurable.setIconInfo(expectedIconInfo);
configurable.setLargeIconInfo(expectedLargeIconInfo);
EasyMock.replay(iconSource);
EasyMock.replay(configurable);