Skip to content

Commit

Permalink
Fixed a faulty race condition and updated tests to detect it.
Browse files Browse the repository at this point in the history
git-svn-id: https://olap4j.svn.sourceforge.net/svnroot/olap4j/trunk@117 c6a108a4-781c-0410-a6c6-c2d559e19af0
  • Loading branch information
lucboudreau committed Sep 15, 2008
1 parent 81d65b0 commit c8f266e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/org/olap4j/driver/xmla/XmlaOlap4jConnection.java
Original file line number Diff line number Diff line change
Expand Up @@ -1687,7 +1687,7 @@ public boolean requiresDatasourceName() {
* @return whether this request requires a CatalogName element
*/
public boolean requiresCatalogName() {
return this != DBSCHEMA_CATALOGS;
return (this != DBSCHEMA_CATALOGS && this != DISCOVER_DATASOURCES);
}
}

Expand Down
16 changes: 15 additions & 1 deletion testsrc/org/olap4j/ConnectionTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,16 @@ public void testXmlaCatalogParameter() throws Exception {
tester.getURL().replaceFirst("\\;Catalog=FoodMart", ""),
info);
assertEquals("FoodMart", connection.getCatalog());
((OlapConnection)connection).getCatalogs();
Statement statement = connection.createStatement();
OlapStatement olapStatement =
tester.getWrapper().unwrap(statement, OlapStatement.class);
CellSet cellSet =
olapStatement.executeOlapQuery(
"SELECT FROM [Sales]");
List<CellSetAxis> axesList = cellSet.getAxes();
assertNotNull(axesList);
assertEquals(0, axesList.size());

info.setProperty(
XmlaOlap4jDriver.Property.Catalog.name(), "FoodMart");
Expand All @@ -333,7 +343,11 @@ public void testXmlaCatalogParameter() throws Exception {
info);
connection.getCatalog();
} catch (OlapException e) {
return;
if (e.getMessage().equals(
"There is no catalog named FoodMartError available to query against."))
{
return;
}
}
fail("XmlaOlap4jConnection did not detect an inexistant catalog name.");
}
Expand Down

0 comments on commit c8f266e

Please sign in to comment.