Extract LimboPropertiesHolder

This commit is contained in:
김선우
2025-03-03 14:23:20 +09:00
parent 482d7b639e
commit 6b223421ae
4 changed files with 67 additions and 30 deletions

View File

@@ -1,8 +1,10 @@
package tech.turso;
import static org.assertj.core.api.AssertionsForClassTypes.assertThat;
import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
import java.sql.Connection;
import java.sql.Driver;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.util.Properties;
@@ -30,4 +32,22 @@ class JDBCTest {
assertThat(connection).isNotNull();
}
}
@Test
void retrieve_version() {
assertDoesNotThrow(() -> DriverManager.getDriver("jdbc:sqlite:").getMajorVersion());
assertDoesNotThrow(() -> DriverManager.getDriver("jdbc:sqlite:").getMinorVersion());
}
@Test
void all_driver_property_info_should_have_a_description() throws Exception {
Driver driver = DriverManager.getDriver("jdbc:sqlite:");
assertThat(driver.getPropertyInfo(null, null))
.allSatisfy((info) -> assertThat(info.description).isNotNull());
}
@Test
void return_null_when_protocol_can_not_be_handled() throws Exception {
assertThat(JDBC.createConnection("jdbc:unknownprotocol:", null)).isNull();
}
}