Skip to content

Commit

Permalink
Add test mode that wraps connections in a connection-pool (currently …
Browse files Browse the repository at this point in the history
…just apache commons-dbcp); fix xmla driver for JDK 1.4; fix connection-leak in test framework; make test framework work with commons-dbcp (but still some bugs with XMLA driver and commons-dbcp); collect into an enum all properties used by the test framework; more javadoc.

git-svn-id: https://olap4j.svn.sourceforge.net/svnroot/olap4j/trunk@83 c6a108a4-781c-0410-a6c6-c2d559e19af0
  • Loading branch information
julianhyde committed Apr 2, 2008
1 parent e1b7a59 commit 2496cad
Show file tree
Hide file tree
Showing 9 changed files with 434 additions and 84 deletions.
8 changes: 6 additions & 2 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ ${jar-jdk14.file}"/>
<pathelement location="${lib.dir}/xercesImpl.jar"/>
<pathelement location="${testlib.dir}/junit.jar"/>
<pathelement location="${testlib.dir}/servlet.jar"/>
<pathelement location="${testlib.dir}/commons-dbcp.jar"/>
<pathelement location="${testlib.dir}/commons-pool.jar"/>
</path>

<path id="project.test.classpath">
Expand All @@ -75,8 +77,6 @@ ${jar-jdk14.file}"/>
<pathelement location="${mondrian.lib.dir}/eigenbase-xom.jar"/>
<pathelement location="${mondrian.lib.dir}/eigenbase-properties.jar"/>
<pathelement location="${mondrian.lib.dir}/eigenbase-resgen.jar"/>
<pathelement location="${mondrian.lib.dir}/commons-dbcp.jar"/>
<pathelement location="${mondrian.lib.dir}/commons-pool.jar"/>
<pathelement location="${mondrian.lib.dir}/commons-collections.jar"/>
<pathelement location="${mondrian.lib.dir}/commons-vfs.jar"/>
<pathelement location="${mondrian.lib.dir}/commons-logging.jar"/>
Expand Down Expand Up @@ -491,6 +491,10 @@ META-INF/**"/>
</target>

<target name="test" depends="prepare, compile, compile.tests">
<antcall target="test-nobuild"/>
</target>

<target name="test-nobuild">
<junit printsummary="yes" fork="yes" failureproperty="junit.failure"
tempdir="${testlog.dir}">
<formatter type="plain"/>
Expand Down
22 changes: 6 additions & 16 deletions src/org/olap4j/driver/xmla/XmlaOlap4jConnection.java
Original file line number Diff line number Diff line change
Expand Up @@ -740,22 +740,12 @@ public String generateRequest(
* @param value to be xml encoded
* @return an XML encode string or the value is not required.
*/
private static String xmlEncode(String value){
if (value.indexOf('&') >= 0) {
value = value.replace("&", "&amp;");
}
if (value.indexOf('<') >= 0) {
value = value.replace("<", "&lt;");
}
if (value.indexOf('>') >= 0) {
value = value.replace(">", "&gt;");
}
if (value.indexOf('"') >= 0) {
value = value.replace("\"", "&quot;");
}
if (value.indexOf('\'') >= 0) {
value = value.replace("'", "&apos;");
}
private static String xmlEncode(String value) {
value = Olap4jUtil.replace(value, "&", "&amp;");
value = Olap4jUtil.replace(value, "<", "&lt;");
value = Olap4jUtil.replace(value, ">", "&gt;");
value = Olap4jUtil.replace(value, "\"", "&quot;");
value = Olap4jUtil.replace(value, "'", "&apos;");
return value;
}

Expand Down
Binary file added testlib/commons-dbcp.jar
Binary file not shown.
Binary file added testlib/commons-pool.jar
Binary file not shown.
Loading

0 comments on commit 2496cad

Please sign in to comment.