@BeforeMethod public void setUpTestEntity() throws Exception { app = ApplicationBuilder.newManagedApp(TestApplication.class); entity = new AbstractEntity(app) {}; Entities.startManagement(entity); listener = new EntitySubscriptionTest.RecordingSensorEventListener(); app.getSubscriptionContext().subscribe(entity, SENSOR_ADDED, listener); app.getSubscriptionContext().subscribe(entity, SENSOR_REMOVED, listener); }
@BeforeMethod(alwaysRun = true) public void setUp() throws Exception { tempDataDir = Files.createTempDir(); managementContext = new LocalManagementContext(); localhost = managementContext .getLocationManager() .createLocation(LocationSpec.create(LocalhostMachineProvisioningLocation.class)); machine127 = managementContext .getLocationManager() .createLocation( LocationSpec.create(SshMachineLocation.class).configure("address", "localhost")); app = ApplicationBuilder.newManagedApp(TestApplication.class, managementContext); }
@BeforeMethod(alwaysRun = true) public void setUp() { app = ApplicationBuilder.newManagedApp(TestApplication.class); entity = app.createAndManageChild(EntitySpec.create(TestEntity.class)); managementContext = app.getManagementContext(); }