EmbeddedDB.getDataSource
Code IndexAdd Codota to your IDE (free)

Best code snippets using org.killbill.commons.embeddeddb.EmbeddedDB.getDataSource(Showing top 12 results out of 315)

origin: org.kill-bill.billing/killbill-util

@Override
@BeforeMethod(groups = "slow")
public void beforeMethod() throws Exception {
  super.beforeMethod();
  final KillBillJdbcRealm realm = new KillBillJdbcRealm(helper.getDataSource(), securityConfig);
  securityManager = new DefaultSecurityManager(realm);
  SecurityUtils.setSecurityManager(securityManager);
}
origin: org.kill-bill.commons/killbill-embeddeddb-common

public void stop() throws IOException {
  final DataSource dataSource = getDataSource();
  if (dataSource instanceof HikariDataSource) {
    ((HikariDataSource) dataSource).shutdown();
  }
}
origin: org.kill-bill.billing/killbill-platform-test

public synchronized void start() throws IOException, SQLException {
  instance.initialize();
  instance.start();
  final DataSource realDataSource = instance.getDataSource();
  dataSource = new ReferenceableDataSourceSpy(realDataSource, TEST_DATA_SOURCE_ID);
  idbi = new DBIProvider(null, dataSource, null).get();
  if (isUsingLocalInstance()) {
    return;
  }
  executeEngineSpecificScripts();
  executePostStartupScripts();
  instance.refreshTableNames();
}
origin: org.kill-bill.billing.plugin.java/killbill-base-plugin

@Override
@BeforeClass(groups = "slow")
public void setUpBeforeClass() throws Exception {
  super.setUpBeforeClass();
  this.dao = new TestPluginPaymentDao(embeddedDB.getDataSource());
  final Clock clock = new DefaultClock();
  final UUID tenantId = UUID.randomUUID();
  context = Mockito.mock(CallContext.class);
  Mockito.when(context.getTenantId()).thenReturn(tenantId);
  account = TestUtils.buildAccount(Currency.JPY, "JP");
  final OSGIKillbillAPI killbillApi = TestUtils.buildOSGIKillbillAPI(account);
  final Payment payment = TestUtils.buildPayment(account.getId(), account.getPaymentMethodId(), account.getCurrency(), killbillApi);
  final OSGIKillbillLogService logService = TestUtils.buildLogService();
  final OSGIConfigPropertiesService configPropertiesService = Mockito.mock(OSGIConfigPropertiesService.class);
  api = new TestPaymentPluginApi(killbillApi, configPropertiesService, logService, clock, dao);
  TestUtils.updateOSGIKillbillAPI(killbillApi, api);
}
origin: org.kill-bill.commons/killbill-jdbi

private DataSource buildDataSource() {
  switch(config.getConnectionPoolingType()) {
    case C3P0:
      loadDriver();
      return new C3P0DataSourceBuilder().buildDataSource();
    case HIKARICP:
      if (dataSourceClassName != null) {
        loadDriver();
      }
      return new HikariDataSourceBuilder().buildDataSource();
    case NONE:
      if (embeddedDB != null) {
        try {
          embeddedDB.initialize();
          embeddedDB.start();
          return embeddedDB.getDataSource();
        } catch (final IOException e) {
          throw new RuntimeException(e);
        } catch (final SQLException e) {
          throw new RuntimeException(e);
        }
      }
    default:
      break;
  }
  throw new IllegalArgumentException("DataSource " + config.getConnectionPoolingType() + " unsupported");
}
origin: org.kill-bill.commons/killbill-queue

dbi = new DBI(embeddedDB.getDataSource());
InTransaction.setupDBI(dbi);
dbi.setTransactionHandler(new NotificationTransactionHandler(databaseTransactionNotificationApi));
origin: org.kill-bill.commons/killbill-embeddeddb-common

protected Connection getConnection() throws SQLException, IOException {
  return getDataSource().getConnection();
}
origin: org.kill-bill.billing/killbill-util

@Override
@BeforeMethod(groups = "slow")
public void beforeMethod() throws Exception {
  super.beforeMethod();
  final KillBillJdbcRealm realm = new KillBillJdbcRealm(helper.getDataSource(), securityConfig);
  securityManager = new DefaultSecurityManager(realm);
  SecurityUtils.setSecurityManager(securityManager);
}
origin: org.kill-bill.commons/killbill-embeddeddb-common

public void stop() throws IOException {
  final DataSource dataSource = getDataSource();
  if (dataSource instanceof HikariDataSource) {
    ((HikariDataSource) dataSource).shutdown();
  }
}
origin: org.kill-bill.commons/killbill-embeddeddb-common

protected Connection getConnection() throws SQLException, IOException {
  return getDataSource().getConnection();
}
origin: org.kill-bill.commons/killbill-queue

dbi = new DBI(embeddedDB.getDataSource());
InTransaction.setupDBI(dbi);
dbi.setTransactionHandler(new NotificationTransactionHandler(databaseTransactionNotificationApi));
origin: org.kill-bill.commons/killbill-queue

dbi = new DBI(embeddedDB.getDataSource());
InTransaction.setupDBI(dbi);
dbi.setTransactionHandler(new NotificationTransactionHandler(databaseTransactionNotificationApi));
org.killbill.commons.embeddeddbEmbeddedDBgetDataSource

Popular methods of EmbeddedDB

  • getDBEngine
  • executeScript
  • initialize
  • start
  • cleanupAllTables
  • refreshTableNames
  • stop
  • getDatabaseName
  • cleanupTable
  • execute
  • executeUpdate
  • getCmdLineConnectionString
  • executeUpdate,
  • getCmdLineConnectionString,
  • getConnection,
  • getJdbcConnectionString,
  • getPassword,
  • getUsername,
  • setDataSource

Popular classes and methods

  • requestLocationUpdates (LocationManager)
  • getResourceAsStream (ClassLoader)
    Returns a stream for the resource with the specified name. See #getResource(String) for a descriptio
  • startActivity (Activity)
  • URLEncoder (java.net)
    This class is used to encode a string using the format required by application/x-www-form-urlencoded
  • NumberFormat (java.text)
    The abstract base class for all number formats. This class provides the interface for formatting and
  • Random (java.util)
    This class provides methods that return pseudo-random values.It is dangerous to seed Random with the
  • Annotation (javassist.bytecode.annotation)
    The annotation structure.An instance of this class is returned bygetAnnotations() in AnnotationsAttr
  • Response (javax.ws.rs.core)
    Defines the contract between a returned instance and the runtime when an application needs to provid
  • Loader (org.hibernate.loader)
    Abstract superclass of object loading (and querying) strategies. This class implements useful common
  • Join (org.hibernate.mapping)

For IntelliJ IDEA,
Android Studio or Eclipse

  • Codota IntelliJ IDEA pluginCodota Android Studio pluginCode IndexSign in
  • EnterpriseFAQAboutContact Us
  • Terms of usePrivacy policyCodeboxFind Usages
Add Codota to your IDE (free)