Skip to content

Commit

Permalink
Fix test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
terrymanu committed Oct 5, 2023
1 parent e7a0ced commit fddfa13
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ public static Map<String, StorageNode> fromDataSources(final Map<String, DataSou
private static StorageNode fromDataSource(final String storageUnitName, final DataSource dataSource) {
DataSourcePoolProperties props = DataSourcePoolPropertiesCreator.create(dataSource);
String url = props.getConnectionPropertySynonyms().getStandardProperties().get("url").toString();
return new StorageNode(new StorageNodeName(storageUnitName), url);
boolean isInstanceConnectionAvailable = new DatabaseTypeRegistry(DatabaseTypeFactory.get(url)).getDialectDatabaseMetaData().isInstanceConnectionAvailable();
return createStorageNode(new StorageNodeName(storageUnitName), url, isInstanceConnectionAvailable);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ protected Collection<String> getDatabaseNames(final ConnectionSession connection
protected void preProcess(final String databaseName, final Map<String, Object> rows, final Map<String, String> alias) {
ResourceMetaData resourceMetaData = ProxyContext.getInstance().getContextManager().getMetaDataContexts().getMetaData().getDatabase(databaseName).getResourceMetaData();
Collection<String> catalogs = resourceMetaData.getStorageUnits().keySet()
.stream().map(each -> resourceMetaData.getStorageUnits().get(each).getConnectionProperties().getCatalog()).collect(Collectors.toSet());
.stream().map(each -> resourceMetaData.getStorageUnits().get(each).getStorageNode().getCatalog()).collect(Collectors.toSet());
schemaNameAlias = alias.getOrDefault(SCHEMA_NAME, "");
String rowValue = rows.getOrDefault(schemaNameAlias, "").toString();
queryDatabase = !rowValue.isEmpty();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ public NullsOrderType getDefaultNullsOrderType() {
return NullsOrderType.FIRST;
}

@Override
public boolean isInstanceConnectionAvailable() {
return true;
}

@Override
public String getDatabaseType() {
return "FIXTURE";
Expand Down

0 comments on commit fddfa13

Please sign in to comment.