Beispiel #1
0
 @Test
 public void testCreateRespectsConfigKey() {
   TestEntity entity2 =
       app.createAndManageChild(
           TestEntity.Spec.newInstance().configure(TestEntity.CONF_NAME, "foo"));
   assertEquals(entity2.getConfig(TestEntity.CONF_NAME), "foo");
 }
Beispiel #2
0
 @Test
 public void testCreateRespectsFlagInMap() {
   TestEntity entity2 =
       app.createAndManageChild(
           TestEntity.Spec.newInstance().configure(MutableMap.of("confName", "baz")));
   assertEquals(entity2.getConfig(TestEntity.CONF_NAME), "baz");
 }
Beispiel #3
0
 @Test
 public void testDisplayName() {
   TestEntity result =
       entity.createAndManageChild(TestEntity.Spec.newInstance().displayName("Boo"));
   assertIsProxy(result);
   assertEquals(result.getDisplayName(), "Boo");
 }
Beispiel #4
0
 @Test
 public void testCreateAndManageChild() {
   TestEntity result = entity.createAndManageChild(TestEntity.Spec.newInstance());
   assertIsProxy(result);
   assertIsProxy(Iterables.get(entity.getChildren(), 0));
   assertIsProxy(result.getParent());
   assertIsProxy(managementContext.getEntityManager().getEntity(result.getId()));
 }
Beispiel #5
0
 @BeforeMethod(alwaysRun = true)
 public void setUp() throws Exception {
   app = ApplicationBuilder.newManagedApp(TestApplication.class);
   entity = app.createAndManageChild(TestEntity.Spec.newInstance());
   managementContext = app.getManagementContext();
 }