アプリケーションで OracleDriver に接続すると、すべて問題ありません。しかし、JUnit テストを実行するために接続しようとすると、ClassNotFoundException が発生しました。そして、私はまったく同じことをします!
ライブラリとテストライブラリに ojbc を追加しました。
public JDBCDataStorage(boolean production) throws DataStorageException {
this.production = production;
try {
rb = (PropertyResourceBundle) PropertyResourceBundle.getBundle("app.control.database.JDBCconfig");
Class.forName(rb.getString("driver"));
} catch (ClassNotFoundException e) {
throw new DataStorageException("Something went wrong in new JDBCDataStorage()" + ": " + e.getMessage());
}
DriverManager.setLoginTimeout(3);
}