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)} - * - *

    - *
  1. CATALOG_NAME String => The catalog name, such as - * FoodMart.
  2. - * - *
  3. DESCRIPTION String => A description of the - * catalog, as entered by the publisher. (may be - * null)
- * - *
  • ROLES String => A comma separated list of role names - * that users can impersonate. (may be - * null)
  • - * - *
  • DATE_MODIFIED String => The date of the latest modifications - * to the catalog. (may be null)
  • - * - * @return a 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( */ NamedList getOlapCatalogs() throws OlapException; - /** - * Retrieves a list of olap4j schemas that are available on the server. - * - *

    Specification 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)} - * - *

      - *
    1. CATALOG_NAME String => The name of the parent catalog to which - * the schema belongs to.
    2. - * - *
    3. SCHEMA_NAME String => The name of the schema.
    4. - * - *
    5. SCHEMA_OWNER String => The name of the user who is the owner - * of the schema (may be null)
    6. - *
    - * - * @return a 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; } }