Search in sources :

Example 1 with ColumnFamilyManagerFactory

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

the class ColumnFamilyManagerFactoryConverterTest method shouldReturnManagerFactory.

@Test
public void shouldReturnManagerFactory() {
    final String prefix = UUID.randomUUID().toString();
    System.setProperty(prefix, prefix);
    System.setProperty(prefix + ".settings.key", "value");
    System.setProperty(prefix + ".settings.key2", "value2");
    System.setProperty(prefix + ".provider", ColumnConfigurationMock.class.getName());
    final ColumnFamilyManagerFactory managerFactory = config.getValue(prefix, ColumnFamilyManagerFactory.class);
    final ColumnConfigurationMock.ColumnFamilyManagerFactoryMock factoryMock = ColumnConfigurationMock.ColumnFamilyManagerFactoryMock.class.cast(managerFactory);
    final Settings settings = factoryMock.getSettings();
    assertEquals(2, settings.size());
    assertEquals(settings.get("key").get(), "value");
    assertEquals(settings.get("key2").get(), "value2");
    assertNotNull(managerFactory);
    System.clearProperty(prefix);
    System.clearProperty(prefix + ".settings.key");
    System.clearProperty(prefix + ".settings.key2");
    System.clearProperty(prefix + ".provider");
}
Also used : ColumnFamilyManagerFactory(jakarta.nosql.column.ColumnFamilyManagerFactory) Settings(jakarta.nosql.Settings) Test(org.junit.jupiter.api.Test)

Example 2 with ColumnFamilyManagerFactory

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

the class CassandraConfigurationTest method shouldCreateDocumentEntityManagerFactoryFromSettings.

@Test
public void shouldCreateDocumentEntityManagerFactoryFromSettings() {
    Settings settings = ManagerFactorySupplier.INSTANCE.getSettings();
    CassandraConfiguration cassandraConfiguration = new CassandraConfiguration();
    ColumnFamilyManagerFactory entityManagerFactory = cassandraConfiguration.get(settings);
    assertNotNull(entityManagerFactory);
}
Also used : ColumnFamilyManagerFactory(jakarta.nosql.column.ColumnFamilyManagerFactory) Settings(jakarta.nosql.Settings) Test(org.junit.jupiter.api.Test)

Example 3 with ColumnFamilyManagerFactory

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

the class CassandraConfigurationTest method shouldCreateDocumentEntityManagerFactoryFromFile.

@Test
public void shouldCreateDocumentEntityManagerFactoryFromFile() {
    Settings settings = ManagerFactorySupplier.INSTANCE.getSettings();
    CassandraConfiguration cassandraConfiguration = new CassandraConfiguration();
    ColumnFamilyManagerFactory entityManagerFactory = cassandraConfiguration.get(settings);
    assertNotNull(entityManagerFactory);
}
Also used : ColumnFamilyManagerFactory(jakarta.nosql.column.ColumnFamilyManagerFactory) Settings(jakarta.nosql.Settings) Test(org.junit.jupiter.api.Test)

Example 4 with ColumnFamilyManagerFactory

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

the class HBaseColumnFamilyManagerFactoryTest method shouldCreateColumnFamilyManager.

@Test
public void shouldCreateColumnFamilyManager() {
    ColumnFamilyManagerFactory managerFactory = configuration.get();
    assertNotNull(managerFactory);
}
Also used : ColumnFamilyManagerFactory(jakarta.nosql.column.ColumnFamilyManagerFactory) Test(org.junit.jupiter.api.Test)

Example 5 with ColumnFamilyManagerFactory

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

the class ColumnFamilyManagerConverter method success.

@Override
public ColumnFamilyManager success(String value) {
    Config config = BeanManagers.getInstance(Config.class);
    final ColumnFamilyManagerFactory managerFactory = config.getValue(value, ColumnFamilyManagerFactory.class);
    final String database = value + ".database";
    final String entity = config.getValue(database, String.class);
    return managerFactory.get(entity);
}
Also used : ColumnFamilyManagerFactory(jakarta.nosql.column.ColumnFamilyManagerFactory) Config(org.eclipse.microprofile.config.Config)

Aggregations

ColumnFamilyManagerFactory (jakarta.nosql.column.ColumnFamilyManagerFactory)5 Test (org.junit.jupiter.api.Test)4 Settings (jakarta.nosql.Settings)3 Config (org.eclipse.microprofile.config.Config)1