예제 #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");
 }
예제 #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");
 }
예제 #3
0
 @Test
 public void testDisplayName() {
   TestEntity result =
       entity.createAndManageChild(TestEntity.Spec.newInstance().displayName("Boo"));
   assertIsProxy(result);
   assertEquals(result.getDisplayName(), "Boo");
 }
예제 #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()));
 }
예제 #5
0
 @BeforeMethod(alwaysRun = true)
 public void setUp() throws Exception {
   app = ApplicationBuilder.newManagedApp(TestApplication.class);
   entity = app.createAndManageChild(TestEntity.Spec.newInstance());
   managementContext = app.getManagementContext();
 }