Skip to content

Commit

Permalink
Enhance XMLA proxy used by testing infrastructure to include charset.…
Browse files Browse the repository at this point in the history
… XMLA driver tolerates if HierarchyInfo contains hierarchy's unique name rather than name.

git-svn-id: https://olap4j.svn.sourceforge.net/svnroot/olap4j/trunk@77 c6a108a4-781c-0410-a6c6-c2d559e19af0
  • Loading branch information
julianhyde committed Mar 5, 2008
1 parent 8b4b2e3 commit 94d2d1f
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 19 deletions.
6 changes: 6 additions & 0 deletions build.properties
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@
# suite.
#

mondrian.dir=/home/jhyde/open2/mondrian

# retroweaver.dir=E:/retroweaver-1.2.4

# Uncomment to use yDoc doclet for enhanced javadoc (requires commercial
# license).
#ydoc.home=/usr/local/ydoc-2.2_03-jdk1.5

# End build.properties
27 changes: 14 additions & 13 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<property file="${project.location}/test.properties"/>
<property name="project.build.debug" value="on"/>
<property name="name" value="olap4j"/>
<property name="version" value="0.9.4-svn072"/>
<property name="version" value="0.9.5-svn076"/>
<property name="dist.name" value="${name}-${version}" />

<!-- properties related to paths -->
Expand Down Expand Up @@ -68,8 +68,8 @@ ${jar-jdk14.file}"/>

<!-- Mondrian jars. If you are running against the mondrian driver,
define mondrian.lib.dir and uncomment the following lines. -->
<!--
<pathelement location="${mondrian.lib.dir}/mondrian.jar"/>
<!-- -->
<pathelement location="${mondrian.dir}/classes"/>
<pathelement location="${mondrian.dir}/testclasses"/>
<pathelement location="${mondrian.lib.dir}/eigenbase-xom.jar"/>
<pathelement location="${mondrian.lib.dir}/eigenbase-properties.jar"/>
Expand All @@ -81,7 +81,7 @@ ${jar-jdk14.file}"/>
<pathelement location="${mondrian.lib.dir}/commons-logging.jar"/>
<pathelement location="${mondrian.lib.dir}/commons-math-1.0.jar"/>
<pathelement location="${mondrian.lib.dir}/xercesImpl.jar"/>
-->
<!-- -->

</path>

Expand Down Expand Up @@ -128,14 +128,15 @@ ${jar-jdk14.file}"/>

<target name="compile" depends="prepare,parser,compile.java"/>

<condition property="jdk16.present">
<condition property="jdk16.present">
<equals arg1="${ant.java.version}" arg2="1.6"/>
</condition>

<condition property="jdk16.not.present">
<not>
<equals arg1="${ant.java.version}" arg2="1.6"/>
</condition>
<condition property="jdk16.not.present">
<not>
<equals arg1="${ant.java.version}" arg2="1.6"/>
</not>
</condition>
</not>
</condition>

<target name="compile.java">
<javac
Expand Down Expand Up @@ -296,8 +297,8 @@ must be run under JDK 1.5." />
</target>

<target name="compileJdk16">
<exec os="linux" executable="buildJdk16.sh"/>
<exec os="windows" executable="buildJdk16.bat"/>
<exec osfamily="unix" executable="buildJdk16.sh"/>
<exec osfamily="windows" executable="buildJdk16.bat"/>
</target>

<target name="jar" depends="version,checkIsNotJdk16,compile,compileJdk16">
Expand Down
17 changes: 13 additions & 4 deletions src/org/olap4j/driver/xmla/XmlaOlap4jCellSet.java
Original file line number Diff line number Diff line change
Expand Up @@ -343,12 +343,21 @@ private XmlaOlap4jCellSetMetaData createMetaData(
for (Element hierarchyInfo : hierarchyInfos) {
final String hierarchyName =
hierarchyInfo.getAttribute("name");
final Hierarchy hierarchy =
Hierarchy hierarchy =
cube.getHierarchies().get(hierarchyName);
if (hierarchy == null) {
throw olap4jStatement.olap4jConnection.helper.createException(
"Internal error: hierarchy '" + hierarchyName
+ "' not found in cube '" + cubeName + "'");
for (Hierarchy hierarchy1 : cube.getHierarchies()) {
if (hierarchy1.getUniqueName().equals(hierarchyName)) {
hierarchy = hierarchy1;
break;
}
}
if (hierarchy == null) {
throw olap4jStatement.olap4jConnection.helper
.createException(
"Internal error: hierarchy '" + hierarchyName
+ "' not found in cube '" + cubeName + "'");
}
}
hierarchyList.add(hierarchy);
for (Element childNode : childElements(hierarchyInfo)) {
Expand Down
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 @@ -506,7 +506,7 @@ public String generateRequest(
final String dataSourceInfo =
context.olap4jConnection.getDataSourceInfo();
final String content = "Data";
final String encoding = "UTF-8"; // proxy.getEncodingCharsetName();
final String encoding = proxy.getEncodingCharsetName();
final StringBuilder buf = new StringBuilder(
"<?xml version=\"1.0\" encoding=\"" + encoding + "\"?>\n"
+ "<SOAP-ENV:Envelope\n"
Expand Down
2 changes: 1 addition & 1 deletion src/org/olap4j/driver/xmla/XmlaOlap4jDriver.java
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ Future<byte[]> submit(
* Returns the name of the character set use for encoding the XML
* string.
*/
// String getEncodingCharsetName();
String getEncodingCharsetName();
}

/**
Expand Down

0 comments on commit 94d2d1f

Please sign in to comment.