diff --git a/common/src/main/java/org/eclipse/daanse/olap/connection/ConnectionBase.java b/common/src/main/java/org/eclipse/daanse/olap/connection/ConnectionBase.java index 2dbdced9..6d5e80b7 100644 --- a/common/src/main/java/org/eclipse/daanse/olap/connection/ConnectionBase.java +++ b/common/src/main/java/org/eclipse/daanse/olap/connection/ConnectionBase.java @@ -114,7 +114,7 @@ public QueryComponent parseStatement( parser = getContext().getMdxParserProvider().newParser(queryToParse, funTable.getPropertyWords()); MdxStatement mdxStatement = parser.parseMdxStatement(); return getQueryProvider().createQuery(statement, mdxStatement, strictValidation); - } catch (MdxParserException mdxPE) { + } catch (Exception mdxPE) { Optional oSqlGuardFactory = getContext().getSqlGuardFactory(); if (oSqlGuardFactory.isEmpty()) { @@ -122,7 +122,8 @@ public QueryComponent parseStatement( } else { List ds = (List) this.getCatalogReader().getDatabaseSchemas(); org.eclipse.daanse.sql.guard.api.elements.DatabaseCatalog dc = new DatabaseCatalogImpl("", ds); - SqlGuard guard = oSqlGuardFactory.get().create("", "", dc, List.of(), this.getContext().getDialect()); + //TODO need resolve function list from other place + SqlGuard guard = oSqlGuardFactory.get().create("", "", dc, List.of("sum", "avg", "min", "max", "count", "concat"), this.getContext().getDialect()); // TODO add white list functions try { String sanetizedSql = guard.guard(queryToParse); diff --git a/common/src/test/java/org/eclipse/daanse/olap/function/def/crossjoin/CrossJoinTest.java b/common/src/test/java/org/eclipse/daanse/olap/function/def/crossjoin/CrossJoinTest.java index 28915a91..cd1c62f7 100644 --- a/common/src/test/java/org/eclipse/daanse/olap/function/def/crossjoin/CrossJoinTest.java +++ b/common/src/test/java/org/eclipse/daanse/olap/function/def/crossjoin/CrossJoinTest.java @@ -32,6 +32,7 @@ import java.util.Collections; import java.util.Comparator; import java.util.List; +import java.util.Optional; import org.eclipse.daanse.mdx.model.api.expression.operation.FunctionOperationAtom; import org.eclipse.daanse.mdx.model.api.expression.operation.OperationAtom; @@ -64,6 +65,7 @@ import org.eclipse.daanse.olap.function.core.FunctionParameterR; import org.eclipse.daanse.olap.query.component.ResolvedFunCallImpl; import org.eclipse.daanse.olap.api.execution.ExecutionContext; +import org.eclipse.daanse.olap.api.execution.ExecutionMetadata; import org.eclipse.daanse.olap.execution.ExecutionImpl; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; @@ -137,7 +139,8 @@ void testListTupleListTupleIterCalc() { when(rolapConnection.getContext()).thenReturn(context); when(statement.getDaanseConnection()).thenReturn(rolapConnection); when(excMock.getDaanseStatement()).thenReturn(statement); - ExecutionContext executionContext = mock(ExecutionContext.class); + ExecutionMetadata executionMetadata = mock(ExecutionMetadata.class); + ExecutionContext executionContext = ExecutionContext.root(Optional.empty(), executionMetadata); when(excMock.asContext()).thenReturn(executionContext); CrossJoinIterCalc calc = new CrossJoinIterCalc( getResolvedFunCall(), null, crossJoinFunDef.getCtag() ); diff --git a/format/src/test/java/org/eclipse/daanse/olap/format/FormatterFactoryTest.java b/format/src/test/java/org/eclipse/daanse/olap/format/FormatterFactoryTest.java index 9add793b..eb7657f7 100644 --- a/format/src/test/java/org/eclipse/daanse/olap/format/FormatterFactoryTest.java +++ b/format/src/test/java/org/eclipse/daanse/olap/format/FormatterFactoryTest.java @@ -44,16 +44,16 @@ class FormatterFactoryTest { void shouldCreateFormatterByClassName() { FormatterCreateContext cellFormatterContext = new FormatterCreateContext.Builder("name") - .formatterAttr("org.eclipse.daanse.rolap.common.format.CellFormatterTestImpl") + .formatterAttr("org.eclipse.daanse.olap.format.CellFormatterTestImpl") .build(); FormatterCreateContext memberFormatterContext = new FormatterCreateContext.Builder("name") - .formatterAttr("org.eclipse.daanse.rolap.common.format.MemberFormatterTestImpl") + .formatterAttr("org.eclipse.daanse.olap.format.MemberFormatterTestImpl") .build(); FormatterCreateContext propertyFormatterContext = new FormatterCreateContext.Builder("name") .formatterAttr( - "org.eclipse.daanse.rolap.common.format.PropertyFormatterTestImpl") + "org.eclipse.daanse.olap.format.PropertyFormatterTestImpl") .build(); CellFormatter cellFormatter = @@ -109,18 +109,18 @@ void shouldCreateFormatterByScript() { void shouldCreateFormatterByClassNameIfBothSpecified() { FormatterCreateContext cellFormatterContext = new FormatterCreateContext.Builder("name") - .formatterAttr("org.eclipse.daanse.rolap.common.format.CellFormatterTestImpl") + .formatterAttr("org.eclipse.daanse.olap.format.CellFormatterTestImpl") .script("return null;", "JavaScript") .build(); FormatterCreateContext memberFormatterContext = new FormatterCreateContext.Builder("name") - .formatterAttr("org.eclipse.daanse.rolap.common.format.MemberFormatterTestImpl") + .formatterAttr("org.eclipse.daanse.olap.format.MemberFormatterTestImpl") .script("return null;", "JavaScript") .build(); FormatterCreateContext propertyFormatterContext = new FormatterCreateContext.Builder("name") .formatterAttr( - "org.eclipse.daanse.rolap.common.format.PropertyFormatterTestImpl") + "org.eclipse.daanse.olap.format.PropertyFormatterTestImpl") .script("return null;", "JavaScript") .build(); diff --git a/xmla/bridge/src/test/java/org/eclipse/daanse/olap/xmla/bridge/ContextGroupXmlaService_OSGiServiceTest.java b/xmla/bridge/src/test/java/org/eclipse/daanse/olap/xmla/bridge/integration/ContextGroupXmlaService_OSGiServiceTest.java similarity index 93% rename from xmla/bridge/src/test/java/org/eclipse/daanse/olap/xmla/bridge/ContextGroupXmlaService_OSGiServiceTest.java rename to xmla/bridge/src/test/java/org/eclipse/daanse/olap/xmla/bridge/integration/ContextGroupXmlaService_OSGiServiceTest.java index d0d33f73..75dc7211 100644 --- a/xmla/bridge/src/test/java/org/eclipse/daanse/olap/xmla/bridge/ContextGroupXmlaService_OSGiServiceTest.java +++ b/xmla/bridge/src/test/java/org/eclipse/daanse/olap/xmla/bridge/integration/ContextGroupXmlaService_OSGiServiceTest.java @@ -11,8 +11,9 @@ * SmartCity Jena - initial * Stefan Bischof (bipolis.org) - initial */ -package org.eclipse.daanse.olap.xmla.bridge; +package org.eclipse.daanse.olap.xmla.bridge.integration; +import org.eclipse.daanse.olap.xmla.bridge.ContextGroupXmlaService; import org.eclipse.daanse.xmla.api.XmlaService; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith;