Search in sources :

Example 1 with ColumnConfiguration

use of jakarta.nosql.column.ColumnConfiguration in project jnosql-communication-driver by eclipse.

the class HBaseColumnConfigurationTest method shouldCreatesColumnFamilyManagerFactoryFromConfiguration.

@Test
public void shouldCreatesColumnFamilyManagerFactoryFromConfiguration() {
    ColumnConfiguration configuration = new HBaseColumnConfiguration();
    assertNotNull(configuration.get());
}
Also used : ColumnConfiguration(jakarta.nosql.column.ColumnConfiguration) Test(org.junit.jupiter.api.Test)

Example 2 with ColumnConfiguration

use of jakarta.nosql.column.ColumnConfiguration in project jnosql-diana-driver by eclipse.

the class HBaseColumnConfigurationTest method shouldCreatesColumnFamilyManagerFactoryFromConfiguration.

@Test
public void shouldCreatesColumnFamilyManagerFactoryFromConfiguration() {
    ColumnConfiguration configuration = new HBaseColumnConfiguration();
    assertNotNull(configuration.get());
}
Also used : ColumnConfiguration(jakarta.nosql.column.ColumnConfiguration) Test(org.junit.jupiter.api.Test)

Example 3 with ColumnConfiguration

use of jakarta.nosql.column.ColumnConfiguration in project jnosql-diana-driver by eclipse.

the class HBaseColumnConfigurationTest method shouldCreatesColumnFamilyManagerFactory.

@Test
public void shouldCreatesColumnFamilyManagerFactory() {
    ColumnConfiguration configuration = new HBaseColumnConfiguration();
    assertNotNull(configuration.get());
}
Also used : ColumnConfiguration(jakarta.nosql.column.ColumnConfiguration) Test(org.junit.jupiter.api.Test)

Example 4 with ColumnConfiguration

use of jakarta.nosql.column.ColumnConfiguration in project jnosql-diana-driver by eclipse.

the class CassandraConfigurationTest method shouldCreateConfiguration.

@Test
public void shouldCreateConfiguration() {
    ColumnConfiguration configuration = ColumnConfiguration.getConfiguration();
    Assertions.assertNotNull(configuration);
    Assertions.assertTrue(configuration instanceof CassandraConfiguration);
}
Also used : ColumnConfiguration(jakarta.nosql.column.ColumnConfiguration) Test(org.junit.jupiter.api.Test)

Example 5 with ColumnConfiguration

use of jakarta.nosql.column.ColumnConfiguration in project jnosql-diana by eclipse.

the class ColumnFamilyManagerFactoryConverter method success.

@Override
public ColumnFamilyManagerFactory success(String value) {
    final SettingsConverter settingsConverter = BeanManagers.getInstance(SettingsConverter.class);
    Config config = BeanManagers.getInstance(Config.class);
    final Settings settings = settingsConverter.convert(value);
    String provider = value + ".provider";
    final Class<?> configurationClass = config.getValue(provider, Class.class);
    if (ColumnConfiguration.class.isAssignableFrom(configurationClass)) {
        final Reflections reflections = BeanManagers.getInstance(Reflections.class);
        final ColumnConfiguration configuration = (ColumnConfiguration) reflections.newInstance(configurationClass);
        return configuration.get(settings);
    }
    throw new ConfigurationException("The class " + configurationClass + " is not valid to " + ColumnConfiguration.class);
}
Also used : SettingsConverter(org.eclipse.jnosql.mapping.configuration.SettingsConverter) ConfigurationException(org.eclipse.jnosql.mapping.configuration.ConfigurationException) Config(org.eclipse.microprofile.config.Config) ColumnConfiguration(jakarta.nosql.column.ColumnConfiguration) Settings(jakarta.nosql.Settings) Reflections(org.eclipse.jnosql.mapping.reflection.Reflections)

Aggregations

ColumnConfiguration (jakarta.nosql.column.ColumnConfiguration)7 Test (org.junit.jupiter.api.Test)6 Settings (jakarta.nosql.Settings)1 ConfigurationException (org.eclipse.jnosql.mapping.configuration.ConfigurationException)1 SettingsConverter (org.eclipse.jnosql.mapping.configuration.SettingsConverter)1 Reflections (org.eclipse.jnosql.mapping.reflection.Reflections)1 Config (org.eclipse.microprofile.config.Config)1