Add JDBC.java

This commit is contained in:
김선우
2025-01-10 20:03:32 +09:00
parent d88204252f
commit e8e09cc745
2 changed files with 85 additions and 0 deletions

View File

@@ -0,0 +1,23 @@
package org.github.tursodatabase;
import org.junit.jupiter.api.Test;
import java.util.Properties;
import static org.assertj.core.api.AssertionsForClassTypes.assertThat;
class JDBCTest {
@Test
void null_is_returned_when_invalid_url_is_passed() throws Exception {
LimboConnection connection = JDBC.createConnection("jdbc:invalid:xxx", new Properties());
assertThat(connection).isNull();
}
@Test
void non_null_connection_is_returned_when_valid_url_is_passed() throws Exception {
String fileUrl = TestUtils.createTempFile();
LimboConnection connection = JDBC.createConnection("jdbc:limbo:" + fileUrl, new Properties());
assertThat(connection).isNotNull();
}
}