Package org.virtualbox_4_0

Examples of org.virtualbox_4_0.ISession


   @Test(dependsOnMethods = "sharedLockCanBeAcquiredAfterWriteLockSessionOnMachine", description = "write lock cannot be acquired after a shared lock")
   public void writeLockCannotBeAcquiredAfterSharedLockSessionOnMachine() {
      final IMachine clone = cloneFromMaster();
      try {
         ISession sharedSession = machineUtils.sharedLockMachineAndApplyToSession(clone.getName(),
               new Function<ISession, ISession>() {
                  @Override
                  public ISession apply(ISession sharedSession) {
                     checkState(sharedSession.getState().equals(SessionState.Locked));
                     return sharedSession;
                  }
               });
         checkState(sharedSession.getState().equals(SessionState.Unlocked));
         ISession writeSession = machineUtils.writeLockMachineAndApplyToSession(clone.getName(),
               new Function<ISession, ISession>() {
                  @Override
                  public ISession apply(ISession writeSession) {
                     checkState(writeSession.getState().equals(SessionState.Locked));
                     assertEquals(writeSession.getMachine().getName(), clone.getName());
                     return writeSession;
                  }
               });
         checkState(writeSession.getState().equals(SessionState.Unlocked));
      } finally {
         undoVm(clone.getName());
      }
   }
View Full Code Here

TOP

Related Classes of org.virtualbox_4_0.ISession

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.