use of io.vertigo.core.definition.DefinitionSpace in project vertigo by KleeGroup.
the class OOMEnvironmentManagerTest method testConstraint.
@Test
public void testConstraint() {
final DefinitionSpace definitionSpace = getApp().getDefinitionSpace();
final ConstraintDefinition constraint = definitionSpace.resolve("CK_TELEPHONE", ConstraintDefinition.class);
Assert.assertEquals(DtProperty.REGEX, constraint.getProperty());
}
use of io.vertigo.core.definition.DefinitionSpace in project vertigo by KleeGroup.
the class OOMEnvironmentManagerTest method testFormatter.
@Test
public void testFormatter() {
final DefinitionSpace definitionSpace = getApp().getDefinitionSpace();
final FormatterDefinition formatter = definitionSpace.resolve("FMT_TAUX", FormatterDefinition.class);
Assert.assertEquals(FormatterNumber.class.getName(), formatter.getFormatterClassName());
}
use of io.vertigo.core.definition.DefinitionSpace in project vertigo by KleeGroup.
the class OOMEnvironmentManagerTest method testDefaultFormatter.
@Test
public void testDefaultFormatter() {
final DefinitionSpace definitionSpace = getApp().getDefinitionSpace();
final FormatterDefinition formatter = definitionSpace.resolve("FMT_DEFAULT", FormatterDefinition.class);
Assert.assertEquals(FormatterDefault.class.getName(), formatter.getFormatterClassName());
}
use of io.vertigo.core.definition.DefinitionSpace in project vertigo by KleeGroup.
the class SearchManagerMultiIndexTest method testIndex.
/**
* Test de création de n enregistrements dans l'index.
* La création s'effectue dans une seule transaction mais sur deux indexes.
* Vérifie la capacité du système à gérer plusieurs indexes.
*/
@Test
public void testIndex() {
final DefinitionSpace definitionSpace = getApp().getDefinitionSpace();
final SearchIndexDefinition itemIndexDefinition = definitionSpace.resolve(IDX_ITEM, SearchIndexDefinition.class);
final SearchIndexDefinition itemDynIndexDefinition = definitionSpace.resolve(IDX_DYNA_ITEM, SearchIndexDefinition.class);
for (final Item item : itemDataBase.getAllItems()) {
final SearchIndex<Item, Item> index = SearchIndex.createIndex(itemIndexDefinition, item.getURI(), item);
searchManager.put(itemIndexDefinition, index);
final SearchIndex<Item, Item> index2 = SearchIndex.createIndex(itemDynIndexDefinition, item.getURI(), item);
searchManager.put(itemDynIndexDefinition, index2);
}
waitIndexation();
final long size = query("*:*", itemIndexDefinition);
Assert.assertEquals(itemDataBase.size(), size);
final long sizeDyn = query("*:*", itemDynIndexDefinition);
Assert.assertEquals(itemDataBase.size(), sizeDyn);
}
use of io.vertigo.core.definition.DefinitionSpace in project vertigo by KleeGroup.
the class TaskManagerTest method testRegistryWithNull.
/**
* Checks when the task-definition is not registered (an exception must be thrown).
*/
@Test(expected = NullPointerException.class)
public void testRegistryWithNull() {
final DefinitionSpace definitionSpace = getApp().getDefinitionSpace();
// L'appel à la résolution doit remonter une assertion
final TaskDefinition taskDefinition = definitionSpace.resolve(null, TaskDefinition.class);
nop(taskDefinition);
}
Aggregations