From 57c37b81aa871c7f17cb5e6a0224c839e82f3023 Mon Sep 17 00:00:00 2001 From: Julian Hyde Date: Tue, 24 May 2011 10:01:26 +0000 Subject: [PATCH] Enforce formatting for hanging arguments; update copyright notices. Cosmetic changes only. git-svn-id: https://olap4j.svn.sourceforge.net/svnroot/olap4j/trunk@455 c6a108a4-781c-0410-a6c6-c2d559e19af0 --- .../olap4j/driver/xmla/XmlaOlap4jCatalog.java | 10 +- .../olap4j/driver/xmla/XmlaOlap4jCellSet.java | 7 +- .../driver/xmla/XmlaOlap4jConnection.java | 30 +++-- .../driver/xmla/XmlaOlap4jDatabase.java | 19 ++-- .../xmla/XmlaOlap4jDatabaseMetaData.java | 12 +- .../XmlaOlap4jConcurrentMemoryCache.java | 15 ++- .../cache/XmlaOlap4jNamedMemoryCache.java | 12 +- .../proxy/XmlaOlap4jAbstractHttpProxy.java | 13 ++- .../xmla/proxy/XmlaOlap4jCookieManager.java | 13 ++- .../xmla/proxy/XmlaOlap4jHttpProxy.java | 23 ++-- src/org/olap4j/query/LevelSelectionImpl.java | 10 +- src/org/olap4j/query/MemberSelectionImpl.java | 13 ++- src/org/olap4j/query/Olap4jNodeConverter.java | 105 ++++++++++-------- src/org/olap4j/query/QueryAxis.java | 8 +- src/org/olap4j/query/QueryDimension.java | 38 ++++--- src/org/olap4j/query/SelectionFactory.java | 19 ++-- .../transform/DrillReplaceTransform.java | 8 +- src/org/olap4j/type/LevelType.java | 9 +- src/org/olap4j/type/MemberType.java | 11 +- src/org/olap4j/type/TypeUtil.java | 5 +- testsrc/org/olap4j/ConnectionTest.java | 13 ++- testsrc/org/olap4j/OlapTest.java | 42 +++---- testsrc/org/olap4j/RemoteXmlaTester.java | 5 +- testsrc/org/olap4j/XmlaConnectionTest.java | 22 ++-- .../driver/xmla/cache/XmlaDatabaseCache.java | 12 +- .../xmla/proxy/XmlaCachedProxyTest.java | 42 ++++--- testsrc/org/olap4j/test/TestContext.java | 5 +- 27 files changed, 306 insertions(+), 215 deletions(-) diff --git a/src/org/olap4j/driver/xmla/XmlaOlap4jCatalog.java b/src/org/olap4j/driver/xmla/XmlaOlap4jCatalog.java index d137e9a..8568cd9 100644 --- a/src/org/olap4j/driver/xmla/XmlaOlap4jCatalog.java +++ b/src/org/olap4j/driver/xmla/XmlaOlap4jCatalog.java @@ -3,7 +3,7 @@ // This software is subject to the terms of the Eclipse Public License v1.0 // Agreement, available at the following URL: // http://www.eclipse.org/legal/epl-v10.html. -// Copyright (C) 2007-2010 Julian Hyde +// Copyright (C) 2007-2011 Julian Hyde // All Rights Reserved. // You must accept the terms of that agreement to use this software. */ @@ -62,9 +62,10 @@ class XmlaOlap4jCatalog implements Catalog, Named { null) { private boolean useSchemata = false; + @Override protected void populateList( - NamedList list) + NamedList list) throws OlapException { try { @@ -95,8 +96,9 @@ protected void populateList( // Fallback to MDSCHEMA_CUBES trick populateInternal(list); } + private void populateInternal( - NamedList list) + NamedList list) throws OlapException { XmlaOlap4jConnection conn = @@ -148,3 +150,5 @@ public XmlaOlap4jDatabase getDatabase() { } // End XmlaOlap4jCatalog.java + + diff --git a/src/org/olap4j/driver/xmla/XmlaOlap4jCellSet.java b/src/org/olap4j/driver/xmla/XmlaOlap4jCellSet.java index 60ef988..ec02662 100644 --- a/src/org/olap4j/driver/xmla/XmlaOlap4jCellSet.java +++ b/src/org/olap4j/driver/xmla/XmlaOlap4jCellSet.java @@ -2,7 +2,7 @@ // This software is subject to the terms of the Eclipse Public License v1.0 // Agreement, available at the following URL: // http://www.eclipse.org/legal/epl-v10.html. -// Copyright (C) 2007-2010 Julian Hyde +// Copyright (C) 2007-2011 Julian Hyde // All Rights Reserved. // You must accept the terms of that agreement to use this software. */ @@ -258,8 +258,8 @@ void populate() throws OlapException { XmlaOlap4jCellSetMemberProperty property = ((XmlaOlap4jCellSetAxisMetaData) cellSetAxis.getAxisMetaData()).lookupProperty( - hierarchyName, - childNode.getLocalName()); + hierarchyName, + childNode.getLocalName()); if (property != null) { String value = childNode.getTextContent(); propertyValues.put(property, value); @@ -1488,3 +1488,4 @@ public boolean isVisible() { } // End XmlaOlap4jCellSet.java + diff --git a/src/org/olap4j/driver/xmla/XmlaOlap4jConnection.java b/src/org/olap4j/driver/xmla/XmlaOlap4jConnection.java index 7db5381..1a8df6f 100644 --- a/src/org/olap4j/driver/xmla/XmlaOlap4jConnection.java +++ b/src/org/olap4j/driver/xmla/XmlaOlap4jConnection.java @@ -256,7 +256,7 @@ private void initSoapCache(Map map) throws OlapException { for (Entry entry : map.entrySet()) { // Check if the current entry relates to cache config. if (entry.getKey().startsWith( - XmlaOlap4jDriver.Property.CACHE.name() + ".")) + XmlaOlap4jDriver.Property.CACHE.name() + ".")) { props.put(entry.getKey().substring( XmlaOlap4jDriver.Property.CACHE.name() @@ -454,9 +454,9 @@ public void setSchema(String schemaName) throws OlapException { (XmlaOlap4jSchema) catalog.getSchemas().get(schemaName); if (this.olap4jSchema == null) { throw new OlapException( - "No schema named " + schemaName - + " could be found in catalog " - + catalog.getName()); + "No schema named " + schemaName + + " could be found in catalog " + + catalog.getName()); } this.schemaName = schemaName; } @@ -1139,9 +1139,14 @@ public void handle( stringElement(row, "DEFAULT_HIERARCHY"); final Integer dimensionOrdinal = integerElement(row, "DIMENSION_ORDINAL"); - XmlaOlap4jDimension dimension = new XmlaOlap4jDimension( - context.olap4jCube, dimensionUniqueName, dimensionName, - dimensionCaption, description, type, + XmlaOlap4jDimension dimension = + new XmlaOlap4jDimension( + context.olap4jCube, + dimensionUniqueName, + dimensionName, + dimensionCaption, + description, + type, defaultHierarchyUniqueName, dimensionOrdinal == null ? 0 : dimensionOrdinal); list.add(dimension); @@ -1150,8 +1155,8 @@ public void handle( list, new Comparator () { public int compare( - XmlaOlap4jDimension d1, - XmlaOlap4jDimension d2) + XmlaOlap4jDimension d1, + XmlaOlap4jDimension d2) { if (d1.getOrdinal() == d2.getOrdinal()) { return 0; @@ -1549,7 +1554,7 @@ private void addUserDefinedDimensionProperties( for (Property property : level.getProperties()) { if (property instanceof XmlaOlap4jProperty && property.getName().equalsIgnoreCase( - node.getLocalName())) + node.getLocalName())) { map.put(property, node.getTextContent()); } @@ -2303,3 +2308,8 @@ public SelectNode validateSelect( } // End XmlaOlap4jConnection.java + + + + + diff --git a/src/org/olap4j/driver/xmla/XmlaOlap4jDatabase.java b/src/org/olap4j/driver/xmla/XmlaOlap4jDatabase.java index 4625218..c18b590 100644 --- a/src/org/olap4j/driver/xmla/XmlaOlap4jDatabase.java +++ b/src/org/olap4j/driver/xmla/XmlaOlap4jDatabase.java @@ -37,14 +37,14 @@ class XmlaOlap4jDatabase implements Database, Named { private final List authenticationMode; public XmlaOlap4jDatabase( - XmlaOlap4jConnection olap4jConnection, - String name, - String description, - String providerName, - String url, - String dataSourceInfo, - List providerType, - List authenticationMode) + XmlaOlap4jConnection olap4jConnection, + String name, + String description, + String providerName, + String url, + String dataSourceInfo, + List providerType, + List authenticationMode) { this.olap4jConnection = olap4jConnection; this.name = name; @@ -106,4 +106,5 @@ public String getDataSourceInfo() throws OlapException { return this.dataSourceInfo; } } -// End XmlaOlap4jDatabase.java \ No newline at end of file +// End XmlaOlap4jDatabase.java + diff --git a/src/org/olap4j/driver/xmla/XmlaOlap4jDatabaseMetaData.java b/src/org/olap4j/driver/xmla/XmlaOlap4jDatabaseMetaData.java index 3773217..16ff032 100644 --- a/src/org/olap4j/driver/xmla/XmlaOlap4jDatabaseMetaData.java +++ b/src/org/olap4j/driver/xmla/XmlaOlap4jDatabaseMetaData.java @@ -2,7 +2,7 @@ // This software is subject to the terms of the Eclipse Public License v1.0 // Agreement, available at the following URL: // http://www.eclipse.org/legal/epl-v10.html. -// Copyright (C) 2007-2010 Julian Hyde +// Copyright (C) 2007-2011 Julian Hyde // All Rights Reserved. // You must accept the terms of that agreement to use this software. */ @@ -129,8 +129,8 @@ private ResultSet getMetadata( rowLoop: for (Element row : XmlaOlap4jUtil.childElements(root)) { if (row.getNamespaceURI() != null - && !row.getNamespaceURI().equals( - "urn:schemas-microsoft-com:xml-analysis:rowset")) + && !row.getNamespaceURI().equals( + "urn:schemas-microsoft-com:xml-analysis:rowset")) { // Ignore any vendor specific namespaced elements that // are not part of the rowset namespace @@ -245,8 +245,8 @@ public String getDatabaseProductVersion() throws SQLException { try { while (rs.next()) { if (rs.getString( - XmlaConstants.Literal.PROPERTY_NAME.name()) - .equals("ProviderVersion")) + XmlaConstants.Literal.PROPERTY_NAME.name()) + .equals("ProviderVersion")) { return rs.getString("PROPERTY_VALUE"); } @@ -1241,3 +1241,5 @@ static class Wildcard { } // End XmlaOlap4jDatabaseMetaData.java + + diff --git a/src/org/olap4j/driver/xmla/cache/XmlaOlap4jConcurrentMemoryCache.java b/src/org/olap4j/driver/xmla/cache/XmlaOlap4jConcurrentMemoryCache.java index 5165f15..c45a57c 100644 --- a/src/org/olap4j/driver/xmla/cache/XmlaOlap4jConcurrentMemoryCache.java +++ b/src/org/olap4j/driver/xmla/cache/XmlaOlap4jConcurrentMemoryCache.java @@ -3,7 +3,7 @@ // This software is subject to the terms of the Eclipse Public License v1.0 // Agreement, available at the following URL: // http://www.eclipse.org/legal/epl-v10.html. -// Copyright (C) 2008-2010 Julian Hyde +// Copyright (C) 2008-2011 Julian Hyde // All Rights Reserved. // You must accept the terms of that agreement to use this software. */ @@ -85,17 +85,17 @@ public XmlaOlap4jConcurrentMemoryCache( { for (Entry entry : props.entrySet()) { if (Property.SIZE.name().equalsIgnoreCase( - entry.getKey().toString())) + entry.getKey().toString())) { this.setCacheSize( - Integer.parseInt(entry.getValue().toString())); + Integer.parseInt(entry.getValue().toString())); } else if (Property.TIMEOUT.name().equalsIgnoreCase( - entry.getKey().toString())) + entry.getKey().toString())) { this.setCacheTimeout( - Integer.parseInt(entry.getValue().toString())); + Integer.parseInt(entry.getValue().toString())); } else if (Property.MODE.name().equalsIgnoreCase( - entry.getKey().toString())) + entry.getKey().toString())) { this.setCacheMode( entry.getValue().toString()); @@ -328,3 +328,6 @@ private String hitBasedEviction(boolean makeRoom) } // End XmlaOlap4jConcurrentMemoryCache.java + + + diff --git a/src/org/olap4j/driver/xmla/cache/XmlaOlap4jNamedMemoryCache.java b/src/org/olap4j/driver/xmla/cache/XmlaOlap4jNamedMemoryCache.java index 28d6111..1f28aa0 100644 --- a/src/org/olap4j/driver/xmla/cache/XmlaOlap4jNamedMemoryCache.java +++ b/src/org/olap4j/driver/xmla/cache/XmlaOlap4jNamedMemoryCache.java @@ -3,7 +3,7 @@ // This software is subject to the terms of the Eclipse Public License v1.0 // Agreement, available at the following URL: // http://www.eclipse.org/legal/epl-v10.html. -// Copyright (C) 2008-2010 Julian Hyde +// Copyright (C) 2008-2011 Julian Hyde // All Rights Reserved. // You must accept the terms of that agreement to use this software. */ @@ -151,8 +151,8 @@ public String setParameters( if (props.containsKey( XmlaOlap4jNamedMemoryCache.Property.NAME.name())) { - refId = (String)props.get( - XmlaOlap4jNamedMemoryCache.Property.NAME.name()); + refId = (String) props.get( + XmlaOlap4jNamedMemoryCache.Property.NAME.name()); } else { refId = String.valueOf(UUID.randomUUID()); props.put(XmlaOlap4jNamedMemoryCache.Property.NAME.name(), refId); @@ -163,8 +163,8 @@ public String setParameters( synchronized (caches) { // Create a cache for this URL if it is not created yet if (!caches.containsKey( - props.get( - XmlaOlap4jNamedMemoryCache.Property.NAME.name()))) + props.get( + XmlaOlap4jNamedMemoryCache.Property.NAME.name()))) { caches.put( (String) props.get( @@ -242,3 +242,5 @@ private void validateState() throws XmlaOlap4jInvalidStateException { } // End XmlaOlap4jNamedMemoryCache.java + + diff --git a/src/org/olap4j/driver/xmla/proxy/XmlaOlap4jAbstractHttpProxy.java b/src/org/olap4j/driver/xmla/proxy/XmlaOlap4jAbstractHttpProxy.java index 664a893..9c5b910 100644 --- a/src/org/olap4j/driver/xmla/proxy/XmlaOlap4jAbstractHttpProxy.java +++ b/src/org/olap4j/driver/xmla/proxy/XmlaOlap4jAbstractHttpProxy.java @@ -119,7 +119,7 @@ public void setCache( try { // Loads the cache class Class clazz = Class.forName(config.get( - XmlaOlap4jDriver.Property.CACHE.name())); + XmlaOlap4jDriver.Property.CACHE.name())); // Instantiates it this.cache = (XmlaOlap4jCache) clazz.newInstance(); @@ -151,8 +151,8 @@ public void setCache( // implement XmlaOlap4jProxy public byte[] get( - XmlaOlap4jServerInfos serverInfos, - String request) + XmlaOlap4jServerInfos serverInfos, + String request) throws XmlaOlap4jProxyException { byte[] response = null; @@ -226,8 +226,8 @@ private void addToCache(URL url, byte[] request, byte[] response) // implement XmlaOlap4jProxy public Future submit( - final XmlaOlap4jServerInfos serverInfos, - final String request) + final XmlaOlap4jServerInfos serverInfos, + final String request) { // The submit operation doesn't need to be cached yet, since it will // call the get operation to fetch the data later on. It will get cached @@ -251,3 +251,6 @@ private void initCookieManager() { } // End XmlaOlap4jAbstractHttpProxy.java + + + diff --git a/src/org/olap4j/driver/xmla/proxy/XmlaOlap4jCookieManager.java b/src/org/olap4j/driver/xmla/proxy/XmlaOlap4jCookieManager.java index 3600a9e..83ab2ee 100644 --- a/src/org/olap4j/driver/xmla/proxy/XmlaOlap4jCookieManager.java +++ b/src/org/olap4j/driver/xmla/proxy/XmlaOlap4jCookieManager.java @@ -3,7 +3,7 @@ // This software is subject to the terms of the Eclipse Public License v1.0 // Agreement, available at the following URL: // http://www.eclipse.org/legal/epl-v10.html. -// Copyright (C) 2007-2010 Julian Hyde +// Copyright (C) 2007-2011 Julian Hyde // All Rights Reserved. // You must accept the terms of that agreement to use this software. */ @@ -105,7 +105,7 @@ public void storeCookies(URLConnection conn) { if (headerName.equalsIgnoreCase(SET_COOKIE)) { Map cookie = new ConcurrentHashMap(); StringTokenizer st = new StringTokenizer( - conn.getHeaderField(i), COOKIE_VALUE_DELIMITER); + conn.getHeaderField(i), COOKIE_VALUE_DELIMITER); // the specification dictates that the first name/value pair // in the string is the cookie name and value, so let's handle @@ -208,12 +208,12 @@ && isNotExpired((String) cookie.get(EXPIRES))) && !(cookieStringBuffer.toString().equals(""))) { System.out.println( - "Using cookie : " + cookieStringBuffer.toString()); + "Using cookie : " + cookieStringBuffer.toString()); } conn.setRequestProperty(COOKIE, cookieStringBuffer.toString()); } catch (java.lang.IllegalStateException ise) { throw new RuntimeException( - "Illegal State! Cookies cannot be set on a URLConnection that is already connected. Only call setCookies(java.net.URLConnection) AFTER calling java.net.URLConnection.connect()."); + "Illegal State! Cookies cannot be set on a URLConnection that is already connected. Only call setCookies(java.net.URLConnection) AFTER calling java.net.URLConnection.connect()."); } } @@ -244,7 +244,7 @@ private boolean comparePaths(String cookiePath, String targetPath) { } else if (cookiePath.equals("/")) { return true; } else if (targetPath.regionMatches( - 0, cookiePath, 0, cookiePath.length())) + 0, cookiePath, 0, cookiePath.length())) { return true; } else { @@ -262,3 +262,6 @@ public String toString() { } // End XmlaOlap4jCookieManager.java + + + diff --git a/src/org/olap4j/driver/xmla/proxy/XmlaOlap4jHttpProxy.java b/src/org/olap4j/driver/xmla/proxy/XmlaOlap4jHttpProxy.java index 9e13af8..7f42ca4 100644 --- a/src/org/olap4j/driver/xmla/proxy/XmlaOlap4jHttpProxy.java +++ b/src/org/olap4j/driver/xmla/proxy/XmlaOlap4jHttpProxy.java @@ -41,11 +41,17 @@ public class XmlaOlap4jHttpProxy extends XmlaOlap4jAbstractHttpProxy * @param driver Driver */ public XmlaOlap4jHttpProxy( - XmlaOlap4jDriver driver) + XmlaOlap4jDriver driver) { this.driver = driver; } + private static final String DISCOVER = + " selections) null, "CrossJoin", Syntax.Function, sel1, sel2); } else { return new CallNode( - null, "CrossJoin", Syntax.Function, sel1, - generateCrossJoin(selections)); + null, "CrossJoin", Syntax.Function, sel1, + generateCrossJoin(selections)); } } @@ -114,9 +114,9 @@ protected static CallNode generateUnion(List> unions) { generateUnion(unions)); } else { return new CallNode( - null, "Union", Syntax.Function, - generateCrossJoin(unions.get(0)), - generateCrossJoin(unions.get(1))); + null, "Union", Syntax.Function, + generateCrossJoin(unions.get(0)), + generateCrossJoin(unions.get(1))); } } @@ -164,36 +164,39 @@ private static void generateUnionsRecursively( // If a sort Order was specified for this dimension // apply it for this inclusion if (qDim.getSortOrder() != null) { - CallNode currentMemberNode = new CallNode( + CallNode currentMemberNode = + new CallNode( null, "CurrentMember", Syntax.Property, new DimensionNode(null, sel.getDimension())); - CallNode currentMemberNameNode = new CallNode( + CallNode currentMemberNameNode = + new CallNode( null, "Name", Syntax.Property, currentMemberNode); - selectionNode = - new CallNode( + selectionNode = + new CallNode( + null, + "Order", + Syntax.Function, + generateSetCall(selectionNode), + currentMemberNameNode, + LiteralNode.createSymbol( null, - "Order", - Syntax.Function, - generateSetCall(selectionNode), - currentMemberNameNode, - LiteralNode.createSymbol( - null, - qDim.getSortOrder().name())); + qDim.getSortOrder().name())); } // If there are exlclusions wrap the ordered selection // in an Except() function if (exceptSet != null) { - selectionNode = new CallNode( - null, - "Except", - Syntax.Function, - generateSetCall(selectionNode), - exceptSet); + selectionNode = + new CallNode( + null, + "Except", + Syntax.Function, + generateSetCall(selectionNode), + exceptSet); } if (sel.getSelectionContext() != null && sel.getSelectionContext().size() > 0) @@ -217,7 +220,7 @@ private static void generateUnionsRecursively( : sel.getSelectionContext()) { if (selection.getDimension().equals( - dimension.getDimension())) + dimension.getDimension())) { sels.add(toOlap4j(selection)); found = true; @@ -227,7 +230,7 @@ private static void generateUnionsRecursively( // add the first selection of the dimension if (dimension.getInclusions().size() > 0) { sels.add(toOlap4j( - dimension.getInclusions().get(0))); + dimension.getInclusions().get(0))); } } } @@ -376,7 +379,7 @@ private static List toOlap4j(QueryDimension dimension) { CallNode hierarchyNode; // There are two modes available, PRE and POST. if (dimension.getHierarchizeMode().equals( - QueryDimension.HierarchizeMode.PRE)) + QueryDimension.HierarchizeMode.PRE)) { // In pre mode, we don't add the "POST" literal. hierarchyNode = new CallNode( @@ -393,7 +396,7 @@ private static List toOlap4j(QueryDimension dimension) { Syntax.Function, generateListSetCall(listWithExclusions), LiteralNode.createSymbol( - null, dimension.getHierarchizeMode().name())); + null, dimension.getHierarchizeMode().name())); } else { throw new RuntimeException("Missing value handler."); } @@ -472,28 +475,28 @@ static ParseTreeNode toOlap4j( } static ParseTreeNode toOlap4j( - Level level, - Selection.Operator oper) - { - ParseTreeNode node = null; - try { - switch (oper) { - case MEMBERS: - node = - new CallNode( - null, - "Members", - Syntax.Property, - new LevelNode(null, level)); - break; - default: - System.out.println("NOT IMPLEMENTED: " + oper); - } - } catch (Exception e) { - e.printStackTrace(); + Level level, + Selection.Operator oper) + { + ParseTreeNode node = null; + try { + switch (oper) { + case MEMBERS: + node = + new CallNode( + null, + "Members", + Syntax.Property, + new LevelNode(null, level)); + break; + default: + System.out.println("NOT IMPLEMENTED: " + oper); } - return node; + } catch (Exception e) { + e.printStackTrace(); } + return node; + } private static List toOlap4j(List axes) { final ArrayList axisList = new ArrayList(); @@ -508,3 +511,13 @@ private static List toOlap4j(List axes) { } // End Olap4jNodeConverter.java + + + + + + + + + + diff --git a/src/org/olap4j/query/QueryAxis.java b/src/org/olap4j/query/QueryAxis.java index 5677167..5cd1d84 100644 --- a/src/org/olap4j/query/QueryAxis.java +++ b/src/org/olap4j/query/QueryAxis.java @@ -3,7 +3,7 @@ // This software is subject to the terms of the Eclipse Public License v1.0 // Agreement, available at the following URL: // http://www.eclipse.org/legal/epl-v10.html. -// Copyright (C) 2007-2010 Julian Hyde +// Copyright (C) 2007-2011 Julian Hyde // All Rights Reserved. // You must accept the terms of that agreement to use this software. */ @@ -133,7 +133,7 @@ public void pushDown(int index) { public void addDimension(QueryDimension dimension) { this.getDimensions().add(dimension); Integer index = Integer.valueOf( - this.getDimensions().indexOf(dimension)); + this.getDimensions().indexOf(dimension)); this.notifyAdd(dimension, index); } @@ -157,7 +157,7 @@ public void addDimension(int index, QueryDimension dimension) { */ public void removeDimension(QueryDimension dimension) { Integer index = Integer.valueOf( - this.getDimensions().indexOf(dimension)); + this.getDimensions().indexOf(dimension)); this.getDimensions().remove(dimension); this.notifyRemove(dimension, index); } @@ -352,3 +352,5 @@ public String getSortIdentifierNodeName() { } // End QueryAxis.java + + diff --git a/src/org/olap4j/query/QueryDimension.java b/src/org/olap4j/query/QueryDimension.java index 2feb5cc..f841600 100644 --- a/src/org/olap4j/query/QueryDimension.java +++ b/src/org/olap4j/query/QueryDimension.java @@ -3,7 +3,7 @@ // This software is subject to the terms of the Eclipse Public License v1.0 // Agreement, available at the following URL: // http://www.eclipse.org/legal/epl-v10.html. -// Copyright (C) 2007-2010 Julian Hyde +// Copyright (C) 2007-2011 Julian Hyde // All Rights Reserved. // You must accept the terms of that agreement to use this software. */ @@ -170,13 +170,13 @@ public Selection include(Level level) { * @param member Root member to select and include. */ public Selection createSelection( - Selection.Operator operator, - Member member) + Selection.Operator operator, + Member member) { if (member.getDimension().equals(this.dimension)) { Selection selection = - query.getSelectionFactory().createMemberSelection( - member, operator); + query.getSelectionFactory().createMemberSelection( + member, operator); return selection; } return null; @@ -208,13 +208,13 @@ public Selection createSelection(Level level) * @param member Root member to select and include. */ public Selection include( - Selection.Operator operator, - Member member) + Selection.Operator operator, + Member member) { if (member.getDimension().equals(this.dimension)) { Selection selection = - query.getSelectionFactory().createMemberSelection( - member, operator); + query.getSelectionFactory().createMemberSelection( + member, operator); this.include(selection); return selection; } @@ -228,7 +228,7 @@ public Selection include( private void include(Selection selection) { this.getInclusions().add(selection); Integer index = Integer.valueOf( - this.getInclusions().indexOf(selection)); + this.getInclusions().indexOf(selection)); this.notifyAdd(selection, index); } @@ -325,13 +325,13 @@ public void exclude(Member member) { * @param member Root member to select and exclude. */ public void exclude( - Selection.Operator operator, - Member member) + Selection.Operator operator, + Member member) { if (member.getDimension().equals(this.dimension)) { Selection selection = - query.getSelectionFactory().createMemberSelection( - member, operator); + query.getSelectionFactory().createMemberSelection( + member, operator); this.exclude(selection); } } @@ -343,7 +343,7 @@ public void exclude( private void exclude(Selection selection) { this.getExclusions().add(selection); Integer index = Integer.valueOf( - this.getExclusions().indexOf(selection)); + this.getExclusions().indexOf(selection)); this.notifyAdd(selection, index); } @@ -583,3 +583,11 @@ void tearDown() { } // End QueryDimension.java + + + + + + + + diff --git a/src/org/olap4j/query/SelectionFactory.java b/src/org/olap4j/query/SelectionFactory.java index d20bce5..fc0ce91 100644 --- a/src/org/olap4j/query/SelectionFactory.java +++ b/src/org/olap4j/query/SelectionFactory.java @@ -3,7 +3,7 @@ // This software is subject to the terms of the Eclipse Public License v1.0 // Agreement, available at the following URL: // http://www.eclipse.org/legal/epl-v10.html. -// Copyright (C) 2007-2010 Julian Hyde +// Copyright (C) 2007-2011 Julian Hyde // All Rights Reserved. // You must accept the terms of that agreement to use this software. */ @@ -34,15 +34,14 @@ Selection createMemberSelection( operator); } - Selection createLevelSelection( - Level level) - { - return - new LevelSelectionImpl( - level, - level.getDimension(), - Selection.Operator.MEMBERS); - } + Selection createLevelSelection(Level level) + { + return + new LevelSelectionImpl( + level, + level.getDimension(), + Selection.Operator.MEMBERS); + } } // End SelectionFactory.java diff --git a/src/org/olap4j/transform/DrillReplaceTransform.java b/src/org/olap4j/transform/DrillReplaceTransform.java index 51d4e28..f347f5f 100644 --- a/src/org/olap4j/transform/DrillReplaceTransform.java +++ b/src/org/olap4j/transform/DrillReplaceTransform.java @@ -3,7 +3,7 @@ // This software is subject to the terms of the Eclipse Public License v1.0 // Agreement, available at the following URL: // http://www.eclipse.org/legal/epl-v10.html. -// Copyright (C) 2008-2010 Julian Hyde +// Copyright (C) 2008-2011 Julian Hyde // All Rights Reserved. // You must accept the terms of that agreement to use this software. */ @@ -87,10 +87,12 @@ protected ParseTreeNode processAxisExp(ParseTreeNode exp) { // FIXME: for now only 1 dimension on an axis is supported, // (naive implementation only used for proof of concept) return MdxHelper.makeSetCallNode( - MdxHelper.makeChildrenCallNode( - MdxHelper.makeMemberNode(memberToDrill))); + MdxHelper.makeChildrenCallNode( + MdxHelper.makeMemberNode(memberToDrill))); } } // End DrillReplaceTransform.java + + diff --git a/src/org/olap4j/type/LevelType.java b/src/org/olap4j/type/LevelType.java index d6a95c1..6969382 100755 --- a/src/org/olap4j/type/LevelType.java +++ b/src/org/olap4j/type/LevelType.java @@ -3,7 +3,7 @@ // This software is subject to the terms of the Eclipse Public License v1.0 // Agreement, available at the following URL: // http://www.eclipse.org/legal/epl-v10.html. -// Copyright (C) 2005-2010 Julian Hyde +// Copyright (C) 2005-2011 Julian Hyde // All Rights Reserved. // You must accept the terms of that agreement to use this software. */ @@ -72,9 +72,9 @@ public LevelType( // not part of public olap4j API private static LevelType forType(Type type) throws OlapException { return new LevelType( - type.getDimension(), - type.getHierarchy(), - type.getLevel()); + type.getDimension(), + type.getHierarchy(), + type.getLevel()); } public boolean usesDimension(Dimension dimension, boolean maybe) { @@ -103,3 +103,4 @@ public String toString() { } // End LevelType.java + diff --git a/src/org/olap4j/type/MemberType.java b/src/org/olap4j/type/MemberType.java index e0c986e..135b640 100644 --- a/src/org/olap4j/type/MemberType.java +++ b/src/org/olap4j/type/MemberType.java @@ -3,7 +3,7 @@ // This software is subject to the terms of the Eclipse Public License v1.0 // Agreement, available at the following URL: // http://www.eclipse.org/legal/epl-v10.html. -// Copyright (C) 2005-2010 Julian Hyde +// Copyright (C) 2005-2011 Julian Hyde // All Rights Reserved. // You must accept the terms of that agreement to use this software. */ @@ -126,12 +126,13 @@ static MemberType forType(Type type) throws OlapException { return (MemberType) type; } else { return new MemberType( - type.getDimension(), - type.getHierarchy(), - type.getLevel(), - null); + type.getDimension(), + type.getHierarchy(), + type.getLevel(), + null); } } } // End MemberType.java + diff --git a/src/org/olap4j/type/TypeUtil.java b/src/org/olap4j/type/TypeUtil.java index 4b31cb4..1038ded 100755 --- a/src/org/olap4j/type/TypeUtil.java +++ b/src/org/olap4j/type/TypeUtil.java @@ -3,7 +3,7 @@ // This software is subject to the terms of the Eclipse Public License v1.0 // Agreement, available at the following URL: // http://www.eclipse.org/legal/epl-v10.html. -// Copyright (C) 2005-2010 Julian Hyde +// Copyright (C) 2005-2011 Julian Hyde // All Rights Reserved. // You must accept the terms of that agreement to use this software. */ @@ -87,7 +87,7 @@ static boolean isUnionCompatible( if (type1 instanceof TupleType) { return type2 instanceof TupleType && ((TupleType) type1).isUnionCompatibleWith( - (TupleType) type2); + (TupleType) type2); } else { final MemberType memberType1 = toMemberType(type1); if (memberType1 == null) { @@ -165,3 +165,4 @@ static boolean equal(Object o, Object p) { } // End TypeUtil.java + diff --git a/testsrc/org/olap4j/ConnectionTest.java b/testsrc/org/olap4j/ConnectionTest.java index 5a94bfa..5d93295 100644 --- a/testsrc/org/olap4j/ConnectionTest.java +++ b/testsrc/org/olap4j/ConnectionTest.java @@ -3,7 +3,7 @@ // This software is subject to the terms of the Eclipse Public License v1.0 // Agreement, available at the following URL: // http://www.eclipse.org/legal/epl-v10.html. -// Copyright (C) 2007-2010 Julian Hyde +// Copyright (C) 2007-2011 Julian Hyde // All Rights Reserved. // You must accept the terms of that agreement to use this software. */ @@ -367,7 +367,7 @@ public void testXmlaCatalogParameter() throws Exception { assertEquals(0, axesList.size()); info.setProperty( - XmlaOlap4jDriver.Property.CATALOG.name(), "FoodMart"); + XmlaOlap4jDriver.Property.CATALOG.name(), "FoodMart"); connection = DriverManager.getConnection( tester.getURL().replaceFirst("\\;Catalog=FoodMart", ""), @@ -375,11 +375,11 @@ public void testXmlaCatalogParameter() throws Exception { assertEquals("FoodMart", connection.getCatalog()); info.setProperty( - XmlaOlap4jDriver.Property.CATALOG.name(), "FoodMartError"); + XmlaOlap4jDriver.Property.CATALOG.name(), "FoodMartError"); try { connection = DriverManager.getConnection( - tester.getURL().replaceFirst("\\;Catalog=FoodMart", ""), - info); + tester.getURL().replaceFirst("\\;Catalog=FoodMart", ""), + info); Statement statement2 = connection.createStatement(); OlapStatement olapStatement2 = TestContext.Wrapper.NONE.unwrap( @@ -2840,3 +2840,6 @@ public void testTransactionIsolation() throws SQLException { } // End ConnectionTest.java + + + diff --git a/testsrc/org/olap4j/OlapTest.java b/testsrc/org/olap4j/OlapTest.java index 6421af0..a5158dd 100644 --- a/testsrc/org/olap4j/OlapTest.java +++ b/testsrc/org/olap4j/OlapTest.java @@ -155,7 +155,7 @@ public void testModel() { // create some selections for Product productQuery.clearInclusions(); productQuery.include( - Selection.Operator.CHILDREN, productMember); + Selection.Operator.CHILDREN, productMember); productQuery.include( Selection.Operator.CHILDREN, nameList("Product", "Food")); @@ -303,10 +303,10 @@ public void testSelectionModes() { mdx = query.getSelect(); mdxString = mdx.toString(); TestContext.assertEqualsVerbose( - "SELECT\n" - + "{[Measures].[Store Sales]} ON COLUMNS,\n" - + "{[Product].[Drink].Siblings, [Product].[Product Department].Members} ON ROWS\n" - + "FROM [Sales]", mdxString); + "SELECT\n" + + "{[Measures].[Store Sales]} ON COLUMNS,\n" + + "{[Product].[Drink].Siblings, [Product].[Product Department].Members} ON ROWS\n" + + "FROM [Sales]", mdxString); } catch (Exception e) { e.printStackTrace(); fail(); @@ -1415,26 +1415,26 @@ public void testCompoundFilter() { // Validate the generated MDX String mdxString = query.getSelect().toString(); TestContext.assertEqualsVerbose( - "SELECT\n" - + "{[Measures].[Sales Count]} ON COLUMNS,\n" - + "{[Store].[USA]} ON ROWS\n" - + "FROM [Sales]\n" - + "WHERE Hierarchize(Union(CrossJoin({[Product].[Drink].[Beverages]}, {[Time].[1997].[Q3].[7]}), CrossJoin({[Product].[Food].[Frozen Foods]}, {[Time].[1997].[Q3].[7]})))", + "SELECT\n" + + "{[Measures].[Sales Count]} ON COLUMNS,\n" + + "{[Store].[USA]} ON ROWS\n" + + "FROM [Sales]\n" + + "WHERE Hierarchize(Union(CrossJoin({[Product].[Drink].[Beverages]}, {[Time].[1997].[Q3].[7]}), CrossJoin({[Product].[Food].[Frozen Foods]}, {[Time].[1997].[Q3].[7]})))", mdxString); // Validate the returned results CellSet results = query.execute(); String resultsString = TestContext.toString(results); TestContext.assertEqualsVerbose( - "Axis #0:\n" - + "{[Product].[Drink].[Beverages], [Time].[1997].[Q3].[7]}\n" - + "{[Product].[Food].[Frozen Foods], [Time].[1997].[Q3].[7]}\n" - + "Axis #1:\n" - + "{[Measures].[Sales Count]}\n" - + "Axis #2:\n" - + "{[Store].[USA]}\n" - + "Row #0: 1,187\n", - resultsString); + "Axis #0:\n" + + "{[Product].[Drink].[Beverages], [Time].[1997].[Q3].[7]}\n" + + "{[Product].[Food].[Frozen Foods], [Time].[1997].[Q3].[7]}\n" + + "Axis #1:\n" + + "{[Measures].[Sales Count]}\n" + + "Axis #2:\n" + + "{[Store].[USA]}\n" + + "Row #0: 1,187\n", + resultsString); } catch (Exception e) { e.printStackTrace(); fail(); @@ -1505,3 +1505,7 @@ public static void main(String args[]) { } // End OlapTest.java + + + + diff --git a/testsrc/org/olap4j/RemoteXmlaTester.java b/testsrc/org/olap4j/RemoteXmlaTester.java index a79f179..7877f2e 100644 --- a/testsrc/org/olap4j/RemoteXmlaTester.java +++ b/testsrc/org/olap4j/RemoteXmlaTester.java @@ -2,7 +2,7 @@ // This software is subject to the terms of the Eclipse Public License v1.0 // Agreement, available at the following URL: // http://www.eclipse.org/legal/epl-v10.html. -// Copyright (C) 2007-2010 Julian Hyde +// Copyright (C) 2007-2011 Julian Hyde // All Rights Reserved. // You must accept the terms of that agreement to use this software. */ @@ -75,7 +75,7 @@ public Connection createConnectionWithUserPassword() throws SQLException { } private Connection createConnection( - String url, String user, String password) + String url, String user, String password) { try { Class.forName(DRIVER_CLASS_NAME); @@ -110,3 +110,4 @@ public Wrapper getWrapper() { } } // End RemoteXmlaTester.java + diff --git a/testsrc/org/olap4j/XmlaConnectionTest.java b/testsrc/org/olap4j/XmlaConnectionTest.java index 5557767..33e474c 100644 --- a/testsrc/org/olap4j/XmlaConnectionTest.java +++ b/testsrc/org/olap4j/XmlaConnectionTest.java @@ -21,8 +21,8 @@ public class XmlaConnectionTest extends TestCase { static class XmlaOlap4jProxyMock implements XmlaOlap4jProxy { public byte[] get( - XmlaOlap4jServerInfos serverInfos, - String request) + XmlaOlap4jServerInfos serverInfos, + String request) { throw new RuntimeException("Non-Trivial Call!"); } @@ -32,8 +32,8 @@ public String getEncodingCharsetName() { } public Future submit( - XmlaOlap4jServerInfos serverInfos, - String request) + XmlaOlap4jServerInfos serverInfos, + String request) { throw new RuntimeException("Non-Trivial Call!"); } @@ -138,7 +138,7 @@ static XmlaOlap4jProxy createProxy( clazz.getConstructor(Map.class, String.class); return (XmlaOlap4jProxy) constructor.newInstance( - catalogNameUrls, urlString); + catalogNameUrls, urlString); } catch (ClassNotFoundException e) { throw new RuntimeException(e); } catch (NoSuchMethodException e) { @@ -218,14 +218,15 @@ class Proxy extends DoubleSubmissionTestProxy { boolean schemata = false; boolean cubes = false; public Proxy( - Map catalogNameUrls, - String urlString) + Map catalogNameUrls, + String urlString) { super(catalogNameUrls, urlString); } @Override public byte[] get( - XmlaOlap4jServerInfos serverInfos, String request) + XmlaOlap4jServerInfos serverInfos, + String request) throws XmlaOlap4jProxyException { if (request.contains("DBSCHEMA_SCHEMATA")) { @@ -338,3 +339,8 @@ private static String convertToHex(byte[] data) { } // End XmlaConnectionTest.java + + + + + diff --git a/testsrc/org/olap4j/driver/xmla/cache/XmlaDatabaseCache.java b/testsrc/org/olap4j/driver/xmla/cache/XmlaDatabaseCache.java index f4c62d0..461a96c 100644 --- a/testsrc/org/olap4j/driver/xmla/cache/XmlaDatabaseCache.java +++ b/testsrc/org/olap4j/driver/xmla/cache/XmlaDatabaseCache.java @@ -157,8 +157,8 @@ public void put(String id, URL url, byte[] request, byte[] response) } public String setParameters( - Map config, - Map props) + Map config, + Map props) { this.props = props; if (connection == null) { @@ -166,9 +166,9 @@ public String setParameters( Class.forName(Properties.JDBC_DRIVER.getValueOrDefault(props)); connection = DriverManager.getConnection( - Properties.JDBC_URL.getValueOrDefault(props), - Properties.JDBC_USER.getValueOrDefault(props), - Properties.JDBC_PASS.getValueOrDefault(props)); + Properties.JDBC_URL.getValueOrDefault(props), + Properties.JDBC_USER.getValueOrDefault(props), + Properties.JDBC_PASS.getValueOrDefault(props)); if (Boolean.valueOf( Properties.INIT.getValueOrDefault(props))) { @@ -194,3 +194,5 @@ public String setParameters( } // End XmlaDatabaseCache.java + + diff --git a/testsrc/org/olap4j/driver/xmla/proxy/XmlaCachedProxyTest.java b/testsrc/org/olap4j/driver/xmla/proxy/XmlaCachedProxyTest.java index 2578db9..e99283c 100644 --- a/testsrc/org/olap4j/driver/xmla/proxy/XmlaCachedProxyTest.java +++ b/testsrc/org/olap4j/driver/xmla/proxy/XmlaCachedProxyTest.java @@ -2,7 +2,7 @@ // This software is subject to the terms of the Eclipse Public License v1.0 // Agreement, available at the following URL: // http://www.eclipse.org/legal/epl-v10.html. -// Copyright (C) 2008-2010 Julian Hyde +// Copyright (C) 2008-2011 Julian Hyde // All Rights Reserved. // You must accept the terms of that agreement to use this software. */ @@ -192,8 +192,8 @@ public void testCacheSizeError() throws Exception } catch (OlapException t) { try { cacheProperties.put( - XmlaOlap4jNamedMemoryCache.Property.SIZE.name(), - "-30"); + XmlaOlap4jNamedMemoryCache.Property.SIZE.name(), + "-30"); proxy.setCache(driverParameters, cacheProperties); } catch (OlapException t2) { return; @@ -290,26 +290,26 @@ public void testCacheSharing() throws Exception } driverParameters.put( - XmlaOlap4jDriver.Property.SERVER.name(), - "http://example2.com"); + XmlaOlap4jDriver.Property.SERVER.name(), + "http://example2.com"); driverParameters.put( - XmlaOlap4jDriver.Property.CATALOG.name(), - "CatalogName2"); + XmlaOlap4jDriver.Property.CATALOG.name(), + "CatalogName2"); driverParameters.put( - XmlaOlap4jDriver.Property.CACHE.name(), - "org.olap4j.driver.xmla.cache.XmlaOlap4jNamedMemoryCache"); + XmlaOlap4jDriver.Property.CACHE.name(), + "org.olap4j.driver.xmla.cache.XmlaOlap4jNamedMemoryCache"); cacheProperties.put( - XmlaOlap4jNamedMemoryCache.Property.NAME.name(), - "testCacheSharing"); + XmlaOlap4jNamedMemoryCache.Property.NAME.name(), + "testCacheSharing"); cacheProperties.put( - XmlaOlap4jNamedMemoryCache.Property.MODE.name(), - "Erronous value which won't trigger an exception since a shared cache should be used."); + XmlaOlap4jNamedMemoryCache.Property.MODE.name(), + "Erronous value which won't trigger an exception since a shared cache should be used."); cacheProperties.put( - XmlaOlap4jNamedMemoryCache.Property.TIMEOUT.name(), - "Erronous value which won't trigger an exception since a shared cache should be used."); + XmlaOlap4jNamedMemoryCache.Property.TIMEOUT.name(), + "Erronous value which won't trigger an exception since a shared cache should be used."); cacheProperties.put( - XmlaOlap4jNamedMemoryCache.Property.SIZE.name(), - "Erronous value which won't trigger an exception since a shared cache should be used."); + XmlaOlap4jNamedMemoryCache.Property.SIZE.name(), + "Erronous value which won't trigger an exception since a shared cache should be used."); try { // Create a new object and try with a faulty cache parameters, @@ -330,3 +330,11 @@ public void testCacheSharing() throws Exception } // End XmlaCachedProxyTest.java + + + + + + + + diff --git a/testsrc/org/olap4j/test/TestContext.java b/testsrc/org/olap4j/test/TestContext.java index 3d3224b..7488751 100644 --- a/testsrc/org/olap4j/test/TestContext.java +++ b/testsrc/org/olap4j/test/TestContext.java @@ -3,7 +3,7 @@ // This software is subject to the terms of the Eclipse Public License v1.0 // Agreement, available at the following URL: // http://www.eclipse.org/legal/epl-v10.html. -// Copyright (C) 2007-2010 Julian Hyde +// Copyright (C) 2007-2011 Julian Hyde // All Rights Reserved. // You must accept the terms of that agreement to use this software. */ @@ -333,7 +333,7 @@ private static Tester createTester( if (helperClassName == null) { helperClassName = "org.olap4j.XmlaTester"; if (!testProperties.containsKey( - TestContext.Property.XMLA_CATALOG_URL.path)) + TestContext.Property.XMLA_CATALOG_URL.path)) { testProperties.setProperty( TestContext.Property.XMLA_CATALOG_URL.path, @@ -799,3 +799,4 @@ private SafeString(String s) { } // End TestContext.java +