use of jakarta.nosql.keyvalue.BucketManagerFactory in project jnosql-diana by eclipse.
the class BucketManagerFactoryConverterTest 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", KeyValueConfigurationMock.class.getName());
final BucketManagerFactory managerFactory = config.getValue(prefix, BucketManagerFactory.class);
final BucketManagerFactoryMock factoryMock = BucketManagerFactoryMock.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");
}
use of jakarta.nosql.keyvalue.BucketManagerFactory in project jnosql-diana by eclipse.
the class BucketManagerConverter method success.
@Override
public BucketManager success(String value) {
Config config = BeanManagers.getInstance(Config.class);
final BucketManagerFactory managerFactory = config.getValue(value, BucketManagerFactory.class);
final String database = value + ".database";
final String entity = config.getValue(database, String.class);
return managerFactory.getBucketManager(entity);
}
use of jakarta.nosql.keyvalue.BucketManagerFactory in project jnosql-diana-driver by eclipse.
the class ArangoDBConfigurationTest method shouldCreateKeyValueFactoryFromFile.
@Test
public void shouldCreateKeyValueFactoryFromFile() {
BucketManagerFactory managerFactory = configuration.get();
assertNotNull(managerFactory);
}
use of jakarta.nosql.keyvalue.BucketManagerFactory in project jnosql-diana-driver by eclipse.
the class CouchbaseKeyValueConfigurationTest method shouldCreateKeyValueFactoryFromFile.
@Test
public void shouldCreateKeyValueFactoryFromFile() {
BucketManagerFactory managerFactory = configuration.get();
assertNotNull(managerFactory);
}
use of jakarta.nosql.keyvalue.BucketManagerFactory in project jnosql-diana-driver by eclipse.
the class CouchbaseMapTest method afterClass.
@AfterAll
public static void afterClass() {
CouchbaseKeyValueConfiguration configuration = CouchbaseKeyValueTcConfiguration.getTcConfiguration();
BucketManagerFactory keyValueEntityManagerFactory = configuration.get();
BucketManager keyValueEntityManager = keyValueEntityManagerFactory.getBucketManager(CouchbaseUtil.BUCKET_NAME);
keyValueEntityManager.delete("jnosql:map");
}
Aggregations