Search in sources :

Example 11 with DefinitionSpace

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());
}
Also used : DefinitionSpace(io.vertigo.core.definition.DefinitionSpace) ConstraintDefinition(io.vertigo.dynamo.domain.metamodel.ConstraintDefinition) Test(org.junit.Test)

Example 12 with DefinitionSpace

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());
}
Also used : FormatterNumber(io.vertigo.dynamox.domain.formatter.FormatterNumber) DefinitionSpace(io.vertigo.core.definition.DefinitionSpace) FormatterDefinition(io.vertigo.dynamo.domain.metamodel.FormatterDefinition) Test(org.junit.Test)

Example 13 with DefinitionSpace

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());
}
Also used : DefinitionSpace(io.vertigo.core.definition.DefinitionSpace) FormatterDefault(io.vertigo.dynamox.domain.formatter.FormatterDefault) FormatterDefinition(io.vertigo.dynamo.domain.metamodel.FormatterDefinition) Test(org.junit.Test)

Example 14 with DefinitionSpace

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);
}
Also used : Item(io.vertigo.dynamo.search.data.domain.Item) SearchIndexDefinition(io.vertigo.dynamo.search.metamodel.SearchIndexDefinition) DefinitionSpace(io.vertigo.core.definition.DefinitionSpace) Test(org.junit.Test)

Example 15 with DefinitionSpace

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);
}
Also used : TaskDefinition(io.vertigo.dynamo.task.metamodel.TaskDefinition) DefinitionSpace(io.vertigo.core.definition.DefinitionSpace) Test(org.junit.Test)

Aggregations

DefinitionSpace (io.vertigo.core.definition.DefinitionSpace)29 Test (org.junit.Test)18 SearchIndexDefinition (io.vertigo.dynamo.search.metamodel.SearchIndexDefinition)9 Domain (io.vertigo.dynamo.domain.metamodel.Domain)6 FacetedQueryDefinition (io.vertigo.dynamo.collections.metamodel.FacetedQueryDefinition)4 DtDefinition (io.vertigo.dynamo.domain.metamodel.DtDefinition)4 TaskDefinition (io.vertigo.dynamo.task.metamodel.TaskDefinition)4 FormatterDefault (io.vertigo.dynamox.domain.formatter.FormatterDefault)4 ListFilter (io.vertigo.dynamo.collections.ListFilter)3 FacetDefinition (io.vertigo.dynamo.collections.metamodel.FacetDefinition)3 FormatterDefinition (io.vertigo.dynamo.domain.metamodel.FormatterDefinition)3 Task (io.vertigo.dynamo.task.model.Task)3 VTransactionWritable (io.vertigo.commons.transaction.VTransactionWritable)2 SqlConnection (io.vertigo.database.sql.connection.SqlConnection)2 DslDefinition (io.vertigo.dynamo.plugins.environment.dsl.dynamic.DslDefinition)2 Item (io.vertigo.dynamo.search.data.domain.Item)2 ItemDataBase (io.vertigo.dynamo.search.data.domain.ItemDataBase)2 Car (io.vertigo.dynamo.search_2_4.data.domain.Car)2 CarDataBase (io.vertigo.dynamo.search_2_4.data.domain.CarDataBase)2 TaskResult (io.vertigo.dynamo.task.model.TaskResult)2