Github user bostko commented on a diff in the pull request:
https://github.com/apache/incubator-brooklyn/pull/722#discussion_r33455551
--- Diff:
software/webapp/src/test/java/brooklyn/entity/webapp/nodejs/NodeJsWebAppFixtureIntegrationTest.java
---
@@ -153,36 +140,16 @@ public void testReportsServiceDownWhenKilled() throws
Exception {
LOG.info("success getting service up false in primary mgmt
universe");
}
-
+
/**
* Stop the given underlying entity, but without our entity instance
being told!
*/
protected void killEntityBehindBack(Entity tokill) throws Exception {
- // Previously was calling entity.getDriver().kill(); but now our
entity instance is a proxy so can't do that
- ManagementContext newManagementContext = null;
- File tempDir = Os.newTempDir(getClass());
- try {
- ManagementContext managementContext =
((EntityInternal)tokill).getManagementContext();
- BrooklynMemento brooklynMemento =
MementosGenerators.newBrooklynMemento(managementContext);
-
- BrooklynMementoPersisterToMultiFile oldPersister = new
BrooklynMementoPersisterToMultiFile(tempDir , getClass().getClassLoader());
- oldPersister.checkpoint(brooklynMemento,
PersistenceExceptionHandlerImpl.builder().build());
- oldPersister.waitForWritesCompleted(30*1000,
TimeUnit.MILLISECONDS);
-
- BrooklynMementoPersisterToMultiFile newPersister = new
BrooklynMementoPersisterToMultiFile(tempDir , getClass().getClassLoader());
- newManagementContext = new LocalManagementContextForTests();
-
newManagementContext.getRebindManager().setPersister(newPersister,
PersistenceExceptionHandlerImpl.builder().build());
-
newManagementContext.getRebindManager().rebind(getClass().getClassLoader(),
null, ManagementNodeState.MASTER);
- newManagementContext.getRebindManager().startPersistence();
- SoftwareProcess entity2 = (SoftwareProcess)
newManagementContext.getEntityManager().getEntity(tokill.getId());
- entity2.stop();
- } finally {
- if (newManagementContext != null)
((ManagementContextInternal)newManagementContext).terminate();
- Os.deleteRecursively(tempDir.getAbsolutePath());
- }
- LOG.info("called to stop {} in parallel mgmt universe", entity);
+ ((SoftwareProcessDriver)((DriverDependentEntity<?>)
Entities.deproxy(tokill)).getDriver()).stop();
--- End diff --
It was thanks to Svet
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---