org.sqlite.SQLiteException Java Examples

The following examples show how to use org.sqlite.SQLiteException. 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 File: SqliteLoaderTest.java    From tessera with 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 File: SqliteLoaderTest.java    From tessera with 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)");
}