コード例 #1
0
  @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);
  }
コード例 #3
0
 @BeforeMethod(alwaysRun = true)
 public void setUp() {
   app = ApplicationBuilder.newManagedApp(TestApplication.class);
   entity = app.createAndManageChild(EntitySpec.create(TestEntity.class));
   managementContext = app.getManagementContext();
 }