@BeforeMethod(alwaysRun=true) @Override public void setUp() throws Exception { super.setUp(); loc1 = new SimulatedLocation(); loc2 = new SimulatedLocation(); loc3 = new SimulatedLocation(); }
@BeforeMethod(alwaysRun=true) @Override public void setUp() throws Exception { super.setUp(); loc = new SimulatedLocation(); loc2 = new SimulatedLocation(); }
@BeforeMethod(alwaysRun=true) @Override public void setUp() throws Exception { super.setUp(); locs = ImmutableList.of(new SimulatedLocation()); }
@BeforeMethod(alwaysRun=true) @Override public void setUp() throws Exception { super.setUp(); locs = ImmutableList.of(new SimulatedLocation()); }
@BeforeMethod(alwaysRun=true) @Override public void setUp() throws Exception { super.setUp(); loc = new SimulatedLocation(); }
@Override public Location apply(Entity input) { return new SimulatedLocation(MutableMap.of("name", "custom location for "+input)); }};
@BeforeMethod(alwaysRun=true) @Override public void setUp() throws Exception { super.setUp(); loc = new SimulatedLocation(); listener = new RecordingEventListener(); }
@BeforeMethod(alwaysRun=true) @Override public void setUp() throws Exception { super.setUp(); loc = new SimulatedLocation(); entityManager = mgmt.getEntityManager(); }
@Override @BeforeMethod(alwaysRun=true) public void setUp() { locs = ImmutableList.of(new SimulatedLocation()); app = TestApplication.Factory.newManagedInstanceForTests(); entity = app.createAndManageChild(EntitySpec.create(TestEntity.class)); }
@BeforeMethod(alwaysRun = true) @Override public void setUp() throws Exception { super.setUp(); currentSensor = new BasicAttributeSensor<Double>(Double.class, "current"); totalSensor = new BasicAttributeSensor<Double>(Double.class, "total"); targetSensor = new BasicAttributeSensor<Double>(Double.class, "target"); app.start(ImmutableList.of(new SimulatedLocation())); }
@BeforeMethod(alwaysRun=true) @Override public void setUp() throws Exception { super.setUp(); loc = new SimulatedLocation(); entity = app.createAndManageChild(EntitySpec.create(TestEntity.class)); driver = new MyEntityDriver(entity, loc); }
@BeforeMethod(alwaysRun=true) @Override public void setUp() throws Exception { super.setUp(); jmxObjectName = new ObjectName(objectName); // Create an entity and configure it with the above JMX service entity = app.createAndManageChild(EntitySpec.create(TestEntity.class).impl(TestEntityWithJmx.class).additionalInterfaces(UsesJmx.class)); app.start(ImmutableList.of(new SimulatedLocation())); jmxHelper = new JmxHelper(entity); jmxService = new JmxService(entity); }
@BeforeMethod(alwaysRun=true) @Override public void setUp() throws Exception { super.setUp(); producer = app.createAndManageChild(EntitySpec.create(TestEntity.class)); intSensorA = new BasicAttributeSensor<Integer>(Integer.class, "int.sensor.a"); intSensorB = new BasicAttributeSensor<Integer>(Integer.class, "int.sensor.b"); target = new BasicAttributeSensor<Long>(Long.class, "long.sensor.target"); app.start(ImmutableList.of(new SimulatedLocation())); }
Location loc = new SimulatedLocation(MutableMap.of("name",locName)); locations.add(loc);
@BeforeMethod(alwaysRun=true) @Override public void setUp() throws Exception { super.setUp(); // Create an entity and configure it with the above JMX service entity = app.createAndManageChild(EntitySpec.create(TestEntity.class).impl(TestEntityWithJmx.class).additionalInterfaces(UsesJmx.class)); app.start(ImmutableList.of(new SimulatedLocation())); jmxHelper = new JmxHelper(entity); jmxService = new JmxService(entity); }
app2.start(ImmutableList.of(new SimulatedLocation()));
@BeforeMethod(alwaysRun=true) @Override public void setUp() throws Exception { super.setUp(); LOG.debug("In AbstractLoadBalancingPolicyTest.before()"); MockItemEntityImpl.totalMoveCount.set(0); MockItemEntityImpl.lastMoveTime.set(0); loc = new SimulatedLocation(MutableMap.of("name", "loc")); model = new DefaultBalanceablePoolModel<Entity, Entity>("pool-model"); app = TestApplication.Factory.newManagedInstanceForTests(); containerGroup = app.createAndManageChild(EntitySpec.create(DynamicGroup.class) .displayName("containerGroup") .configure(DynamicGroup.ENTITY_FILTER, Predicates.instanceOf(MockContainerEntity.class))); itemGroup = app.createAndManageChild(EntitySpec.create(DynamicGroup.class) .displayName("itemGroup") .configure(DynamicGroup.ENTITY_FILTER, Predicates.instanceOf(MockItemEntity.class))); pool = app.createAndManageChild(EntitySpec.create(BalanceableWorkerPool.class)); pool.setContents(containerGroup, itemGroup); policy = new LoadBalancingPolicy(MutableMap.of("minPeriodBetweenExecs", 1), TEST_METRIC, model); pool.policies().add(policy); app.start(ImmutableList.of(loc)); }
@Test public void testProducerUsingDeferredSupplier() throws Exception { producer = app.createAndManageChild(EntitySpec.create(TestEntity.class) .configure(TAG, "myproducer")); target = app.createAndManageChild(EntitySpec.create(TestEntity.class)); sensor = new BasicAttributeSensor<Integer>(Integer.class, "int.sensor.a"); app.start(ImmutableList.of(new SimulatedLocation())); producer.sensors().set(sensor, 3); target.enrichers().add(Enrichers.builder() .propagating(sensor) .from(new EntityDeferredSupplier("myproducer").newTask()) .build()); EntityAsserts.assertAttributeEqualsEventually(target, sensor, 3); }