protected ManagementContext newPersistingManagementContext() {
   mementoDir = Os.newTempDir(JavaClassNames.cleanSimpleClassName(this));
   Os.deleteOnExitRecursively(mementoDir);
   return RebindTestUtils.managementContextBuilder(
           classLoader, new FileBasedObjectStore(mementoDir))
       .persistPeriod(Duration.millis(10))
       .buildStarted();
 }
Esempio n. 2
0
  @BeforeMethod(alwaysRun = true)
  public void setup() throws Exception {
    mgmt = new LocalManagementContext();

    LocalhostMachineProvisioningLocation lhc =
        mgmt.getLocationManager()
            .createLocation(LocationSpec.create(LocalhostMachineProvisioningLocation.class));
    host = lhc.obtain();
    clearExpectedFailure();
    tempDir = Os.newTempDir(getClass());
  }