@Test
public void testListImages() throws Exception {
VirtualBoxManager manager = createNiceMock(VirtualBoxManager.class);
IVirtualBox vBox = createNiceMock(IVirtualBox.class);
IGuestOSType osType = createNiceMock(IGuestOSType.class);
List<IMachine> machines = Lists.newArrayList();
IMachine imageMachine = createNiceMock(IMachine.class);
IMachine clonedMachine = createNiceMock(IMachine.class);
machines.add(imageMachine);
machines.add(clonedMachine);
expect(clonedMachine.getName()).andReturn("My Linux Node");
expect(clonedMachine.getDescription()).andReturn("My Linux Node");
expect(imageMachine.getName()).andReturn(VIRTUALBOX_IMAGE_PREFIX + "ubuntu-10.04");
expect(imageMachine.getDescription()).andReturn(VIRTUALBOX_IMAGE_PREFIX + "ubuntu-10.04");
expect(manager.getVBox()).andReturn(vBox).anyTimes();
expect(vBox.getMachines()).andReturn(machines).anyTimes();
expect(vBox.getGuestOSType(EasyMock.<String> anyObject())).andReturn(osType).anyTimes();
expect(osType.getDescription()).andReturn("Ubuntu 10.04").anyTimes();
expect(osType.getIs64Bit()).andReturn(true).anyTimes();
replay(manager, vBox, clonedMachine, imageMachine, osType);
Function<IMachine, Image> iMachineToImage = new IMachineToImage(
VirtualBoxComputeServiceContextModule.toPortableImageStatus, Suppliers.ofInstance(manager), osMap);