use of com.google.security.zynamics.binnavi.Database.AbstractSQLProvider in project binnavi by google.
the class PostgreSQLProviderTest method testCGenericSQLHelpersDeleteByID3.
@Test(expected = NullPointerException.class)
public void testCGenericSQLHelpersDeleteByID3() throws CouldntDeleteException {
final AbstractSQLProvider connectionProvider = (AbstractSQLProvider) getProvider();
final CConnection connection = connectionProvider.getConnection();
PostgreSQLHelpers.deleteById(connection, null, 0);
}
use of com.google.security.zynamics.binnavi.Database.AbstractSQLProvider in project binnavi by google.
the class PostgreSQLProviderTest method testCGenericSQLHelpersDeleteByID1.
@Test
public void testCGenericSQLHelpersDeleteByID1() throws CouldntDeleteException {
final AbstractSQLProvider connectionProvider = (AbstractSQLProvider) getProvider();
final CConnection connection = connectionProvider.getConnection();
final String tableName = CTableNames.ADDRESS_SPACES_TABLE;
PostgreSQLHelpers.deleteById(connection, tableName, 1);
}
use of com.google.security.zynamics.binnavi.Database.AbstractSQLProvider in project binnavi by google.
the class PostgreSQLProviderTest method testCGenericSQLHelpersDeleteByID4.
@Test(expected = IllegalArgumentException.class)
public void testCGenericSQLHelpersDeleteByID4() throws CouldntDeleteException {
final AbstractSQLProvider connectionProvider = (AbstractSQLProvider) getProvider();
final CConnection connection = connectionProvider.getConnection();
final String tableName = CTableNames.ADDRESS_SPACES_TABLE;
PostgreSQLHelpers.deleteById(connection, tableName, 0);
}
use of com.google.security.zynamics.binnavi.Database.AbstractSQLProvider in project binnavi by google.
the class PostgreSQLProviderTest method testCGenericSQLHelpersRollBack1.
@Test
public void testCGenericSQLHelpersRollBack1() throws SQLException {
final AbstractSQLProvider connectionProvider = (AbstractSQLProvider) getProvider();
final CConnection connection = connectionProvider.getConnection();
PostgreSQLHelpers.beginTransaction(connection);
PostgreSQLHelpers.rollback(connection);
}
use of com.google.security.zynamics.binnavi.Database.AbstractSQLProvider in project binnavi by google.
the class PostgreSQLProviderTest method testCModuleFunctionsgetViewsWithAddresses1.
@Test
public void testCModuleFunctionsgetViewsWithAddresses1() throws CouldntLoadDataException, LoadCancelledException {
final INaviModule module = getProvider().loadModules().get(0);
module.load();
final IFilledList<UnrelocatedAddress> addresses = new FilledList<UnrelocatedAddress>();
List<INaviView> views = PostgreSQLModuleFunctions.getViewsWithAddresses((AbstractSQLProvider) getProvider(), module, addresses, true);
assertEquals(0, views.size());
addresses.add(new UnrelocatedAddress(new CAddress(0x10033DCL)));
views = PostgreSQLModuleFunctions.getViewsWithAddresses((AbstractSQLProvider) getProvider(), module, addresses, true);
assertEquals(1, views.size());
addresses.add(new UnrelocatedAddress(new CAddress(0x1003429)));
views = PostgreSQLModuleFunctions.getViewsWithAddresses((AbstractSQLProvider) getProvider(), module, addresses, true);
assertEquals(0, views.size());
views = PostgreSQLModuleFunctions.getViewsWithAddresses((AbstractSQLProvider) getProvider(), module, addresses, false);
assertEquals(2, views.size());
}
Aggregations