@AfterMethod(alwaysRun = true) @Override public void tearDown() throws Exception { try { super.tearDown(); } finally { RecordingSshTool.clear(); } }
@Test public void testSimpleTestCases() throws Exception { RecordingSshTool.setCustomResponse( ".*myCommand.*", new RecordingSshTool.CustomResponse(0, "myResponse", null)); origApp = (BasicApplication) createStartWaitAndLogApplication( "location:", " localhost:", " sshToolClass: " + RecordingSshTool.class.getName(), "services:", "- type: " + MachineEntity.class.getName(), " id: target-app", " brooklyn.config:", " sshMonitoring.enabled: false", " " + BrooklynConfigKeys.SKIP_ON_BOX_BASE_DIR_RESOLUTION.getName() + ": true", "- type: " + TestCase.class.getName(), " brooklyn.config:", " targetId: target-app", " brooklyn.children:", " - type: " + TestSensor.class.getName(), " brooklyn.config:", " sensor: service.isUp", " assert:", " - equals: true", " - type: " + TestEffector.class.getName(), " brooklyn.config:", " effector: execCommand", " params:", " command: myCommand", " assert:", " - contains: myResponse", " - type: " + TestSshCommand.class.getName(), " brooklyn.config:", " command: myCommand", " assertStatus:", " - equals: 0", " assertOut:", " - contains: myResponse"); rebind(); }
@BeforeMethod(alwaysRun = true) @Override public void setUp() throws Exception { super.setUp(); RecordingSshTool.clear(); }