protected ManagementContext newPersistingManagementContext() { mementoDir = Os.newTempDir(JavaClassNames.cleanSimpleClassName(this)); Os.deleteOnExitRecursively(mementoDir); return RebindTestUtils.managementContextBuilder( classLoader, new FileBasedObjectStore(mementoDir)) .persistPeriod(Duration.millis(10)) .buildStarted(); }
@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()); }