final String type = "gui";
final String environment = "";
ISession session = createMock(ISession.class);
VirtualBoxManager manager = createMock(VirtualBoxManager.class);
IMachine machine = createMock(IMachine.class);
IProgress progress = createMock(IProgress.class);
expect(manager.getSessionObject()).andReturn(session).anyTimes();
expect(machine.launchVMProcess(session, type, environment)).andReturn(progress);
progress.waitForCompletion(-1);
expect(session.getState()).andReturn(SessionState.Locked);
session.unlockMachine();
replay(manager, machine, session, progress);