mirror of
https://github.com/aljazceru/turso.git
synced 2025-12-29 14:04:22 +01:00
Implement driver name and version related methods
This commit is contained in:
@@ -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());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user