diff --git a/src/org/olap4j/OlapDatabaseMetaData.java b/src/org/olap4j/OlapDatabaseMetaData.java index ac8adfd..97d526f 100644 --- a/src/org/olap4j/OlapDatabaseMetaData.java +++ b/src/org/olap4j/OlapDatabaseMetaData.java @@ -198,38 +198,6 @@ ResultSet getActions( */ ResultSet getDatabases() throws OlapException; - /** - * Retrieves a list of olap4j catalogs that are available on the server. - * - *
Specification as for XML/A DBSCHEMA_CATALOGS schema rowset. - * - *
- * The list of returned catalogs is dependent on the underlying connection - * Database parameter. To discover catalogs in another database, use - * {@link OlapDatabaseMetaData#getDatabases()} and - * {@link OlapConnection#setDatabase(String)} - * - *
null
)null
)null
)ResultSet
object in which each row is an
- * OLAP catalog description
- * @throws OlapException if a database access error occurs
- */
- ResultSet getCatalogs() throws OlapException;
-
/**
* Returns a list of {@link org.olap4j.metadata.Catalog} objects which
* belong to this connection's OLAP server.
@@ -248,33 +216,6 @@ ResultSet getActions(
*/
NamedListSpecification as for XML/A DBSCHEMA_SCHEMATA schema rowset. - * - *
- * The list of returned catalogs is dependent on the underlying connection - * Database parameter. To discover schemas in another database, use - * {@link OlapDatabaseMetaData#getDatabases()} and - * {@link OlapConnection#setDatabase(String)} - * - *
null
)ResultSet
object in which each row is an OLAP
- * schema description
- * @throws OlapException if a database access error occurs
- */
- ResultSet getSchemas() throws OlapException;
-
/**
* Retrieves a list of information on supported literals, including data
* types and values.
diff --git a/testsrc/org/olap4j/ConnectionTest.java b/testsrc/org/olap4j/ConnectionTest.java
index 47053d4..7e7ad52 100644
--- a/testsrc/org/olap4j/ConnectionTest.java
+++ b/testsrc/org/olap4j/ConnectionTest.java
@@ -383,15 +383,14 @@ public void testXmlaCatalogParameter() throws Exception {
Statement statement2 = connection.createStatement();
OlapStatement olapStatement2 =
TestContext.Wrapper.NONE.unwrap(
- statement,
+ statement2,
OlapStatement.class);
- CellSet cellSet2 =
- olapStatement.executeOlapQuery(
- "SELECT FROM [Sales]");
+ olapStatement2.executeOlapQuery(
+ "SELECT FROM [Sales]");
fail();
} catch (OlapException e) {
- if (e.getMessage().equals(
- "No catalog named FoodMartError exist on the server."))
+ if (e.getMessage().contains(
+ "unknown schema 'FoodMartError'"))
{
return;
}
diff --git a/testsrc/org/olap4j/MetadataTest.java b/testsrc/org/olap4j/MetadataTest.java
index 2aa5e65..42e2b65 100644
--- a/testsrc/org/olap4j/MetadataTest.java
+++ b/testsrc/org/olap4j/MetadataTest.java
@@ -9,6 +9,8 @@
package org.olap4j;
import junit.framework.TestCase;
+import mondrian.olap.Util;
+
import org.olap4j.impl.Olap4jUtil;
import org.olap4j.metadata.*;
import org.olap4j.test.TestContext;
@@ -246,7 +248,7 @@ public void testDatabaseMetaDataGetActions() throws SQLException {
public void testDatabaseMetaDataGetDatasources() throws SQLException {
String s = checkResultSet(
- olapDatabaseMetaData.getDatasources(),
+ olapDatabaseMetaData.getDatabases(),
DATASOURCES_COLUMN_NAMES);
switch (tester.getFlavor()) {
case MONDRIAN:
@@ -271,13 +273,6 @@ public void testDatabaseMetaDataGetDatasources() throws SQLException {
+ " DATA_SOURCE_INFO=FoodMart,"
+ " PROVIDER_NAME=Mondrian,"
+ " PROVIDER_TYPE=MDP,"
- + " AUTHENTICATION_MODE=Unauthenticated\n"
- + "DATA_SOURCE_NAME=FoodMart2,"
- + " DATA_SOURCE_DESCRIPTION=Mondrian FoodMart data source,"
- + " URL=http://localhost:8080/mondrian/xmla,"
- + " DATA_SOURCE_INFO=FoodMart2,"
- + " PROVIDER_NAME=Mondrian,"
- + " PROVIDER_TYPE=MDP,"
+ " AUTHENTICATION_MODE=Unauthenticated\n",
s);
break;
@@ -453,7 +448,7 @@ public void testDatabaseMetaDataGetCubes() throws SQLException {
public void testGetCatalogs() throws SQLException {
int k = 0;
- for (Catalog catalog : olapConnection.getCatalogs()) {
+ for (Catalog catalog : olapConnection.getMetaData().getOlapCatalogs()) {
++k;
assertEquals(catalog.getMetaData(), olapDatabaseMetaData);
for (Schema schema : catalog.getSchemas()) {
@@ -464,9 +459,11 @@ public void testGetCatalogs() throws SQLException {
assertEquals(cube.getSchema(), schema);
}
for (Dimension dimension : schema.getSharedDimensions()) {
+ Util.discard(dimension);
++k;
}
for (Locale locale : schema.getSupportedLocales()) {
+ Util.discard(locale);
++k;
}
}