Skip to content

Commit

Permalink
MONDRIAN: Fix tests on JDK 1.4.
Browse files Browse the repository at this point in the history
[git-p4: depot-paths = "//open/mondrian/": change = 14434]
  • Loading branch information
julianhyde committed Jul 7, 2011
1 parent 8fd7981 commit 675fc9b
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 2 deletions.
2 changes: 1 addition & 1 deletion testsrc/main/mondrian/olap/ParserTest.java
Expand Up @@ -464,7 +464,7 @@ public void testNumbers() {

// exponents akimbo
assertParseExpr("1e2", "100", true);
assertParseExpr("1e2", "1E+2", false);
assertParseExpr("1e2", Util.PreJdk15 ? "100" : "1E+2", false);
assertParseExprFails(
"1e2e3",
"Syntax error at line 1, column 37, token 'e3'");
Expand Down
4 changes: 4 additions & 0 deletions testsrc/main/mondrian/olap/UtilTestCase.java
Expand Up @@ -623,6 +623,10 @@ public void testServiceDiscovery() {
for (Class<Driver> driverClass : list) {
expectedClassNames.remove(driverClass.getName());
}
if (Util.PreJdk15) {
// JDK only discovers services from jars in JDK 1.5 and later.
return;
}
assertTrue(expectedClassNames.toString(), expectedClassNames.isEmpty());
}

Expand Down
4 changes: 4 additions & 0 deletions testsrc/main/mondrian/olap/fun/FunctionTest.java
Expand Up @@ -7166,6 +7166,10 @@ public void testOrderDepends() {
}

public void testOrderCalc() {
if (Util.Retrowoven) {
// If retrowoven, we don't use Iterable, so plans are different.
return;
}
// [Measures].[Unit Sales] is a constant member, so it is evaluated in
// a ContextCalc.
assertAxisCompilesTo(
Expand Down
10 changes: 10 additions & 0 deletions testsrc/main/mondrian/test/BasicQueryTest.java
Expand Up @@ -7190,6 +7190,11 @@ public void testDirectMemberReferenceOnDimensionWithCalculationsDefined() {
}

public void testExplain() throws SQLException {
if (Util.PreJdk15) {
// Cannot use explain before JDK 1.5. EmptyResultSet relies on
// javax.sql.rowset.RowSetMetaDataImpl, which arrived in JDK 1.5.
return;
}
OlapConnection connection =
TestContext.instance().getOlap4jConnection();
final OlapStatement statement = connection.createStatement();
Expand Down Expand Up @@ -7222,6 +7227,11 @@ public void testExplain() throws SQLException {
}

public void testExplainComplex() throws SQLException {
if (Util.PreJdk15) {
// Cannot use explain before JDK 1.5. EmptyResultSet relies on
// javax.sql.rowset.RowSetMetaDataImpl, which arrived in JDK 1.5.
return;
}
OlapConnection connection =
TestContext.instance().getOlap4jConnection();
final OlapStatement statement = connection.createStatement();
Expand Down
4 changes: 3 additions & 1 deletion testsrc/main/mondrian/test/TestCalculatedMembers.java
Expand Up @@ -938,7 +938,9 @@ public void testCalcMemberCustomFormatterInQueryNegative2() {
"Failed to load formatter class 'java.lang.String' for member '[Measures].[Foo]'.");
assertQueryThrows(
query,
"java.lang.ClassCastException: java.lang.String");
Util.PreJdk15
? "java.lang.ClassCastException"
: "java.lang.ClassCastException: java.lang.String");
}

public void testCalcMemberCustomFormatterInNonMeasureInQuery() {
Expand Down

0 comments on commit 675fc9b

Please sign in to comment.