Java Code Examples for org.sqlite.SQLiteException

The following examples show how to use org.sqlite.SQLiteException. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: tessera   Source File: SqliteLoaderTest.java    License: Apache License 2.0 5 votes vote down vote up
@Test
public void loadOnInvalidFile() throws IOException {
    final Path randomFile = Files.createTempFile("other", ".txt");

    final Throwable throwable = catchThrowable(() -> loader.load(randomFile));
    assertThat(throwable)
        .isNotNull()
        .isInstanceOf(SQLiteException.class)
        .hasMessageContaining("[SQLITE_ERROR] SQL error or missing database (no such table: payload)");
}
 
Example 2
Source Project: tessera   Source File: SqliteLoaderTest.java    License: Apache License 2.0 5 votes vote down vote up
@Test
public void loadOnNonexistentFile() throws IOException {
    final Path randomFile = Files.createTempFile("other", ".txt").getParent().resolve("unknown");

    final Throwable throwable = catchThrowable(() -> loader.load(randomFile));
    assertThat(throwable)
        .isNotNull()
        .isInstanceOf(SQLiteException.class)
        .hasMessageContaining("[SQLITE_ERROR] SQL error or missing database (no such table: payload)");
}