Esempio n. 1
0
 /** @throws Exception */
 @Test(expected = IllegalArgumentException.class)
 public void getModelMetaWithEntityForIllegalClass() throws Exception {
   AaaMeta aaaMeta = new AaaMeta();
   Entity entity = new Entity("Aaa");
   entity.setProperty(aaaMeta.getClassHierarchyListName(), Arrays.asList(Bbb.class.getName()));
   DatastoreUtil.getModelMeta(meta, entity);
 }
Esempio n. 2
0
 /** @throws Exception */
 @Test
 public void getModelMetaWithEntity() throws Exception {
   AaaMeta aaaMeta = new AaaMeta();
   Entity entity = new Entity("Aaa");
   entity.setProperty(aaaMeta.getClassHierarchyListName(), Arrays.asList(Bbb.class.getName()));
   ModelMeta<Aaa> modelMeta = DatastoreUtil.getModelMeta(aaaMeta, entity);
   assertThat(modelMeta, is(notNullValue()));
   assertThat(modelMeta.getModelClass().getName(), is(Bbb.class.getName()));
 }