Implement driver name and version related methods

This commit is contained in:
김선우
2025-02-09 13:54:34 +09:00
parent 6011526755
commit 91e5ed8bb9
5 changed files with 96 additions and 40 deletions

View File

@@ -1,28 +1,47 @@
package org.github.tursodatabase.jdbc4;
import static org.junit.jupiter.api.Assertions.*;
import static org.junit.jupiter.api.Assertions.assertFalse;
import java.util.Properties;
import org.github.tursodatabase.TestUtils;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
class JDBC4DatabaseMetaDataTest {
private JDBC4Connection connection;
private JDBC4DatabaseMetaData metaData;
private JDBC4Connection connection;
private JDBC4DatabaseMetaData metaData;
@BeforeEach
void setUp() throws Exception {
String filePath = TestUtils.createTempFile();
String url = "jdbc:sqlite:" + filePath;
connection = new JDBC4Connection(url, filePath, new Properties());
metaData = new JDBC4DatabaseMetaData(connection);
}
@BeforeEach
void set_up() throws Exception {
String filePath = TestUtils.createTempFile();
String url = "jdbc:sqlite:" + filePath;
connection = new JDBC4Connection(url, filePath, new Properties());
metaData = new JDBC4DatabaseMetaData(connection);
}
@Test
void getURLShouldReturnNonEmptyString() throws Exception{
assertFalse(metaData.getURL().isEmpty());
}
@Test
void getURL_should_return_non_empty_string() {
assertFalse(metaData.getURL().isEmpty());
}
@Test
void getDriverName_should_not_return_empty_string() {
assertFalse(metaData.getDriverName().isEmpty());
}
@Test
void test_getDriverMajorVersion() {
metaData.getDriverMajorVersion();
}
@Test
void test_getDriverMinorVersion() {
metaData.getDriverMinorVersion();
}
@Test
void getDriverVersion_should_not_return_empty_string() {
assertFalse(metaData.getDriverVersion().isEmpty());
}
}