Skip to content

Commit

Permalink
Update tests for functions
Browse files Browse the repository at this point in the history
  • Loading branch information
sualeh committed Nov 21, 2023
1 parent 78bc916 commit 37dca56
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import java.util.regex.Pattern;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import schemacrawler.inclusionrule.IncludeAll;
import schemacrawler.schemacrawler.InfoLevel;
import schemacrawler.schemacrawler.LimitOptionsBuilder;
import schemacrawler.schemacrawler.LoadOptionsBuilder;
Expand Down Expand Up @@ -49,7 +50,6 @@ public void createDatabase() {
final String localDatacenter = cassandraContainer.getLocalDatacenter();
final String connectionUrl = String.format("jdbc:cassandra://%s:%d/%s?localdatacenter=%s",
host, port, keyspace, localDatacenter);
System.out.printf("url=%s%n", connectionUrl);
createDataSource(connectionUrl);
}

Expand All @@ -65,8 +65,8 @@ public void givenDatabase_whenCompleteMetadataExtracted_shouldMatchExpectedOutpu
throws Exception {

final LimitOptionsBuilder limitOptionsBuilder =
LimitOptionsBuilder.builder().includeSchemas(Pattern.compile("test_keyspace.*"));
// .includeRoutines(new IncludeAll());
LimitOptionsBuilder.builder().includeSchemas(Pattern.compile("test_keyspace.*"))
.includeRoutines(new IncludeAll());
final SchemaInfoLevelBuilder schemaInfoLevelBuilder =
SchemaInfoLevelBuilder.builder().withInfoLevel(InfoLevel.maximum);
final LoadOptionsBuilder loadOptionsBuilder =
Expand Down
19 changes: 17 additions & 2 deletions src/test/resources/expected_metadata_output.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ System Information
========================================================================

generated by SchemaCrawler 16.20.6
generated on 2023-11-20 13:27:26
generated on 2023-11-21 22:11:52
database version Cassandra 5.0.0
driver version Cassandra JDBC Driver 4.10.2

Expand Down Expand Up @@ -232,6 +232,21 @@ Primary Key



Routines
========================================================================



test_keyspace.function_test1 [function, does not return a table]
------------------------------------------------------------------------
var1 INT, in
var2 TEXT, in

[specific name]
function_test1



Data Types
========================================================================

Expand Down Expand Up @@ -844,7 +859,7 @@ uses local files false

JDBC Driver Information
-=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=-
connection url jdbc:cassandra://localhost:53429/test_keyspace
connection url jdbc:cassandra://localhost:60543/test_keyspace
driver name Cassandra JDBC Driver
driver version 4.10.2
driver class name com.ing.data.cassandra.jdbc.CassandraDriver
Expand Down

0 comments on commit 37dca56

Please sign in to comment.