use of io.vertigo.core.definition.DefinitionSpace in project vertigo by KleeGroup.
the class VSecurityManagerTest method testRole.
@Test
public void testRole() {
final DefinitionSpace definitionSpace = getApp().getDefinitionSpace();
final Role admin = definitionSpace.resolve("R_ADMIN", Role.class);
Assert.assertTrue("R_ADMIN".equals(admin.getName()));
final Role secretary = definitionSpace.resolve("R_SECRETARY", Role.class);
Assert.assertTrue("R_SECRETARY".equals(secretary.getName()));
}
use of io.vertigo.core.definition.DefinitionSpace in project vertigo by KleeGroup.
the class AbstractSearchManagerTest method init.
/**
* Initialise l'index.
* @param indexName Nom de l'index
*/
protected final void init(final String indexName) {
final DefinitionSpace definitionSpace = getApp().getDefinitionSpace();
// On construit la BDD des voitures
itemDataBase = new ItemDataBase();
final ItemSearchLoader itemSearchLoader = getApp().getComponentSpace().resolve(ItemSearchLoader.class);
itemSearchLoader.bindDataBase(itemDataBase);
manufacturerFacetDefinition = definitionSpace.resolve("FCT_MANUFACTURER_ITEM", FacetDefinition.class);
yearFacetDefinition = definitionSpace.resolve("FCT_YEAR_ITEM", FacetDefinition.class);
itemIndexDefinition = definitionSpace.resolve(indexName, SearchIndexDefinition.class);
itemFacetQueryDefinition = definitionSpace.resolve("QRY_ITEM_FACET", FacetedQueryDefinition.class);
itemFacetMultiQueryDefinition = definitionSpace.resolve("QRY_ITEM_FACET_MULTI", FacetedQueryDefinition.class);
clean(itemIndexDefinition);
}
use of io.vertigo.core.definition.DefinitionSpace in project vertigo by KleeGroup.
the class AbstractStoreManagerTest method nativeLoadCarList.
protected final DtList<Car> nativeLoadCarList() {
final DefinitionSpace definitionSpace = getApp().getDefinitionSpace();
final Domain doCarList = definitionSpace.resolve("DO_DT_CAR_DTC", Domain.class);
final TaskDefinition taskDefinition = TaskDefinition.builder("TK_LOAD_ALL_CARS").withEngine(TaskEngineSelect.class).withRequest("select * from CAR").withOutRequired("dtc", doCarList).build();
final Task task = Task.builder(taskDefinition).build();
return taskManager.execute(task).getResult();
}
use of io.vertigo.core.definition.DefinitionSpace in project vertigo by KleeGroup.
the class OracleSqlStoreManagerTest method nativeInsertCar.
@Override
protected void nativeInsertCar(final Car car) {
Assertion.checkArgument(car.getId() == null, "L'id n'est pas null {0}", car.getId());
// -----
final DefinitionSpace definitionSpace = getApp().getDefinitionSpace();
final Domain doCar = definitionSpace.resolve("DO_DT_CAR_DTO", Domain.class);
final TaskDefinition taskDefinition = TaskDefinition.builder("TK_INSERT_CAR").withEngine(TaskEngineProc.class).withRequest("insert into CAR (ID, FAM_ID,MAKE, MODEL, DESCRIPTION, YEAR, KILO, PRICE, MOTOR_TYPE) values " + "(SEQ_CAR.nextval, #DTO_CAR.FAM_ID#, #DTO_CAR.MAKE#, #DTO_CAR.MODEL#, #DTO_CAR.DESCRIPTION#, #DTO_CAR.YEAR#, #DTO_CAR.KILO#, #DTO_CAR.PRICE#, #DTO_CAR.MOTOR_TYPE#)").addInRequired("DTO_CAR", doCar).build();
final Task task = Task.builder(taskDefinition).addValue("DTO_CAR", car).build();
final TaskResult taskResult = taskManager.execute(task);
nop(taskResult);
}
use of io.vertigo.core.definition.DefinitionSpace in project vertigo by KleeGroup.
the class OOMEnvironmentManagerTest method testDomain.
@Test
public void testDomain() {
final DefinitionSpace definitionSpace = getApp().getDefinitionSpace();
final io.vertigo.dynamo.domain.metamodel.Domain domain = definitionSpace.resolve("DO_EMAIL", Domain.class);
Assert.assertEquals(DataType.String, domain.getDataType());
Assert.assertEquals(FormatterDefault.class.getName(), domain.getFormatterClassName());
}
Aggregations