Search in sources :

Example 1 with IEntityTypesAction

use of com.agiletec.apsadmin.system.entity.type.IEntityTypesAction in project entando-core by entando.

the class TestEntityManagersAction method testGetEntityPrototypes.

public void testGetEntityPrototypes() throws Throwable {
    String[] defNames = this.getApplicationContext().getBeanNamesForType(ApsEntityManager.class);
    if (null == defNames || defNames.length == 0)
        return;
    this.setUserOnSession("admin");
    this.initAction("/do/Entity", "viewEntityTypes");
    this.addParameter("entityManagerName", defNames[0]);
    String result = this.executeAction();
    assertEquals(Action.SUCCESS, result);
    IEntityTypesAction action = (IEntityTypesAction) this.getAction();
    List<IApsEntity> entityPrototypes = action.getEntityPrototypes();
    assertNotNull(entityPrototypes);
    assertTrue(entityPrototypes.size() >= 0);
}
Also used : IEntityTypesAction(com.agiletec.apsadmin.system.entity.type.IEntityTypesAction) IApsEntity(com.agiletec.aps.system.common.entity.model.IApsEntity)

Example 2 with IEntityTypesAction

use of com.agiletec.apsadmin.system.entity.type.IEntityTypesAction in project entando-core by entando.

the class TestJacmsEntityManagersAction method testGetEntityPrototypes.

public void testGetEntityPrototypes() throws Throwable {
    String result = this.executeViewModels(JacmsSystemConstants.CONTENT_MANAGER);
    assertEquals(Action.SUCCESS, result);
    IEntityTypesAction action = (IEntityTypesAction) this.getAction();
    List<IApsEntity> entityPrototypes = action.getEntityPrototypes();
    assertNotNull(entityPrototypes);
    assertEquals(4, entityPrototypes.size());
    IApsEntity firstType = entityPrototypes.get(0);
    assertEquals("ART", firstType.getTypeCode());
    assertEquals("Articolo rassegna stampa", firstType.getTypeDescr());
    IApsEntity lastType = entityPrototypes.get(3);
    assertEquals("RAH", lastType.getTypeCode());
    assertEquals("Tipo_Semplice", lastType.getTypeDescr());
}
Also used : IEntityTypesAction(com.agiletec.apsadmin.system.entity.type.IEntityTypesAction) IApsEntity(com.agiletec.aps.system.common.entity.model.IApsEntity)

Aggregations

IApsEntity (com.agiletec.aps.system.common.entity.model.IApsEntity)2 IEntityTypesAction (com.agiletec.apsadmin.system.entity.type.IEntityTypesAction)2