Skip to content

Commit

Permalink
MONDRIAN: Upgrade to olap4j-0.9.7.232.
Browse files Browse the repository at this point in the history
    Obsolete CoordinateIterator, and use olap4j's CoordinateIterator instead.
    Match changes to olap4j's IdentifierNode.

[git-p4: depot-paths = "//open/mondrian/": change = 12702]
  • Loading branch information
julianhyde committed May 12, 2009
1 parent df811ca commit 5420858
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 140 deletions.
2 changes: 1 addition & 1 deletion ivy.xml
Expand Up @@ -54,7 +54,7 @@
<dependency org="javax.servlet" name="jsp-api" rev="2.0"/>
<dependency org="javax.servlet" name="servlet-api" rev="2.4"/>
<dependency org="log4j" name="log4j" rev="1.2.9"/>
<dependency org="org.olap4j" name="olap4j" rev="0.9.7.145"
<dependency org="org.olap4j" name="olap4j" rev="0.9.7.232"
conf="default->default" changing="true">
<artifact name="olap4j"/>
<artifact name="olap4j" type="source" ext="jar"
Expand Down
2 changes: 1 addition & 1 deletion src/main/mondrian/olap4j/MondrianOlap4jConnection.java
Expand Up @@ -786,7 +786,7 @@ private IdentifierNode toOlap4j(Id id) {
new ArrayList<IdentifierNode.Segment>();
for (Id.Segment segment : id.getSegments()) {
list.add(
new IdentifierNode.Segment(
new IdentifierNode.NameSegment(
null,
segment.name,
toOlap4j(segment.quoting)));
Expand Down
76 changes: 0 additions & 76 deletions src/main/mondrian/util/CoordinateIterator.java

This file was deleted.

60 changes: 0 additions & 60 deletions testsrc/main/mondrian/olap/UtilTestCase.java
Expand Up @@ -505,66 +505,6 @@ public void testServiceDiscovery() {
assertTrue(expectedClassNames.toString(), expectedClassNames.isEmpty());
}

/**
* Tests {@link mondrian.util.CoordinateIterator}.
*/
public void testCoordinateIterator() {
// no axes, should produce one result
CoordinateIterator iter = new CoordinateIterator(new int[]{});
assertTrue(iter.hasNext());
assertEqualsArray(iter.next(), new int[] {});

// one axis of length n, should produce n elements
iter = new CoordinateIterator(new int[]{2});
assertTrue(iter.hasNext());
assertEqualsArray(iter.next(), new int[] {0});
assertTrue(iter.hasNext());
assertEqualsArray(iter.next(), new int[] {1});
assertFalse(iter.hasNext());

// one axis of length 0, should produce 0 elements
iter = new CoordinateIterator(new int[]{0});
assertFalse(iter.hasNext());

// two axes of length 0, should produce 0 elements
iter = new CoordinateIterator(new int[]{0, 0});
assertFalse(iter.hasNext());

// five axes of length 0, should produce 0 elements
iter = new CoordinateIterator(new int[]{0, 0, 0, 0, 0});
assertFalse(iter.hasNext());

// two axes, neither empty
iter = new CoordinateIterator(new int[]{2, 3});
assertTrue(iter.hasNext());
assertEqualsArray(iter.next(), new int[] {0, 0});
assertTrue(iter.hasNext());
assertEqualsArray(iter.next(), new int[] {0, 1});
assertTrue(iter.hasNext());
assertEqualsArray(iter.next(), new int[] {0, 2});
assertTrue(iter.hasNext());
assertEqualsArray(iter.next(), new int[] {1, 0});
assertTrue(iter.hasNext());
assertEqualsArray(iter.next(), new int[] {1, 1});
assertTrue(iter.hasNext());
assertEqualsArray(iter.next(), new int[] {1, 2});
assertFalse(iter.hasNext());

// three axes, one of length 0, should produce 0 elements
iter = new CoordinateIterator(new int[]{10, 0, 2});
assertFalse(iter.hasNext());
iter = new CoordinateIterator(new int[]{0, 10, 2});
assertFalse(iter.hasNext());

// if any axis has negative length, produces 0 elements
iter = new CoordinateIterator(new int[]{3, 4, 5, -6, 7});
assertFalse(iter.hasNext());
iter = new CoordinateIterator(new int[]{3, 4, 5, 6, -7});
assertFalse(iter.hasNext());
iter = new CoordinateIterator(new int[]{-3, 4, 5, 6, 7});
assertFalse(iter.hasNext());
}

/**
* Asserts that two integer arrays have equal length and contents.
*
Expand Down
4 changes: 2 additions & 2 deletions testsrc/main/mondrian/test/TestContext.java
Expand Up @@ -27,7 +27,6 @@
import mondrian.spi.Dialect;
import mondrian.spi.DialectManager;
import mondrian.util.DelegatingInvocationHandler;
import mondrian.util.CoordinateIterator;

import javax.sql.DataSource;
import java.io.*;
Expand All @@ -40,6 +39,7 @@

import org.olap4j.OlapWrapper;
import org.olap4j.OlapConnection;
import org.olap4j.impl.CoordinateIterator;

/**
* <code>TestContext</code> is a singleton class which contains the information
Expand Down Expand Up @@ -119,7 +119,7 @@ protected TestContext() {
* FoodMart database.
*
* <p>In the base class, the result is the same as the static method
* {@link #getConnectString}. If a derived class overrides
* {@link #getDefaultConnectString}. If a derived class overrides
* {@link #getFoodMartConnectionProperties()}, the result of this method
* will change also.
*/
Expand Down

0 comments on commit 5420858

Please sign in to comment.