com.jgcomptech.tools.databasetools.jdbc.TableNotFoundException Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of java-ultimate-tools Show documentation
Show all versions of java-ultimate-tools Show documentation
A large repository of scripts for use in any Java program.
package com.jgcomptech.tools.databasetools.jdbc;
import org.jetbrains.annotations.NotNull;
import static org.junit.Assert.fail;
/**
* Thrown to indicate that a table does not exist.
* @since 1.4.0
*/
public class TableNotFoundException extends RuntimeException {
/**
* Constructs an {@link TableNotFoundException} with the specified table name.
* @param tableName the table name
*/
public TableNotFoundException(final String tableName) { super('"' + tableName + "\" Table Not Found!"); }
/**
* Asserts that the specified runnable throws this exception and if not throws an junit assertion failure.
* @param runnable the runnable to verify
*/
public static void assertThrown(@NotNull final Runnable runnable) {
try {
runnable.run();
fail( "This method should have thrown TableNotFoundException!" );
} catch (final TableNotFoundException ignore) { }
}
}