Package mondrian.test

Class UdfTest

    • Constructor Detail

      • UdfTest

        public UdfTest()
      • UdfTest

        public UdfTest​(java.lang.String name)
    • Method Detail

      • setUp

        protected void setUp()
                      throws java.lang.Exception
        Throws:
        java.lang.Exception
      • tearDown

        protected void tearDown()
                         throws java.lang.Exception
        Overrides:
        tearDown in class FoodMartTestCase
        Throws:
        java.lang.Exception
      • testSanity

        public void testSanity()
      • testFun

        public void testFun()
      • testFunWithProfiling

        public void testFunWithProfiling()
                                  throws java.sql.SQLException
        Test case for bug MONDRIAN-1200, "User-defined function + profiling causes NPE in CalcWriter". The bug only occurs if manually enable "mondrian.profile" logger before running this test. (The bug requires olap4j, plus profiling, plus a query that calls a UDF with one or more arguments on an axis.)
        Throws:
        java.sql.SQLException - on error
      • testLastNonEmpty

        public void testLastNonEmpty()
      • testLastNonEmptyBig

        public void testLastNonEmptyBig()
        Tests a performance issue with LastNonEmpty (bug 1533677). The naive implementation of LastNonEmpty crawls backward one period at a time, generates a cache miss, and the next iteration reads precisely one cell. So the query soon exceeds the MondrianProperties.MaxEvalDepth property.
      • testBadFun

        public void testBadFun()
      • testGenericFun

        public void testGenericFun()
      • testComplexFun

        public void testComplexFun()
      • testException

        public void testException()
      • testCurrentDateString

        public void testCurrentDateString()
      • testCurrentDateMemberBefore

        public void testCurrentDateMemberBefore()
      • testCurrentDateMemberBeforeUsingQuotes

        public void testCurrentDateMemberBeforeUsingQuotes()
      • testCurrentDateMemberAfter

        public void testCurrentDateMemberAfter()
      • testCurrentDateMemberExact

        public void testCurrentDateMemberExact()
      • testCurrentDateMemberNoFindArg

        public void testCurrentDateMemberNoFindArg()
      • testCurrentDateMemberHierarchy

        public void testCurrentDateMemberHierarchy()
      • testCurrentDateMemberHierarchyNullReturn

        public void testCurrentDateMemberHierarchyNullReturn()
      • testCurrentDateMemberRealAfter

        public void testCurrentDateMemberRealAfter()
      • testCurrentDateMemberRealExact1

        public void testCurrentDateMemberRealExact1()
      • testCurrentDateMemberRealExact2

        public void testCurrentDateMemberRealExact2()
      • testCurrentDateMemberPrev

        public void testCurrentDateMemberPrev()
      • testCurrentDateLag

        public void testCurrentDateLag()
      • testMatches

        public void testMatches()
      • testNotMatches

        public void testNotMatches()
      • testIn

        public void testIn()
      • testNotIn

        public void testNotIn()
      • testChildMemberIn

        public void testChildMemberIn()
      • testUdfToString

        public void testUdfToString()
        Test case for the problem where a string expression gave a ClassCastException because it was evaluating to a member, whereas the member should have been evaluated to a scalar.
      • testAnotherMemberFun

        public void testAnotherMemberFun()
        Tests a UDF whose return type is not the same as its first parameter. The return type needs to have full dimensional information; in this case, HierarchyType(dimension=Time, hierarchy=unknown).

        Also tests applying a UDF to arguments of coercible type. In this case, applies f(member,dimension) to args(member,hierarchy).

      • testCachingCurrentDate

        public void testCachingCurrentDate()
      • testNonStaticUdfFails

        public void testNonStaticUdfFails()
        Tests that a non-static function gives an error.
      • testMemberUdfDoesNotEvaluateToScalar

        public void testMemberUdfDoesNotEvaluateToScalar()
        Tests a function that takes a member as argument. Want to make sure that Mondrian leaves it as a member, does not try to evaluate it to a scalar value.
      • testUdfNeitherScriptNorClassname

        public void testUdfNeitherScriptNorClassname()
        Unit test that ensures that a UDF has either a script or a className.
      • testUdfBothScriptAndClassname

        public void testUdfBothScriptAndClassname()
        Unit test that ensures that a UDF does not have both a script and a className.
      • testUdfScriptBadLanguage

        public void testUdfScriptBadLanguage()
        Unit test that ensures that a UDF has either a script or a className.
      • testScriptUdf

        public void testScriptUdf()
        Unit test for a UDF defined in JavaScript.
      • testScriptUdfFactorial

        public void testScriptUdfFactorial()
        Unit test for a UDF defined in JavaScript, this time the factorial function. We also use 'CDATA' section to mask the '<' symbol.
      • testScriptUdfInvalid

        public void testScriptUdfInvalid()
        Unit test that we get a nice error if a script UDF contains an error.
      • testCellFormatter

        public void testCellFormatter()
        Unit test for a cell formatter defined in the old way -- a 'formatter' attribute of a Measure element.
      • testCellFormatterNested

        public void testCellFormatterNested()
        As testCellFormatter(), but using new-style nested CellFormatter element.
      • testCellFormatterOnCalcMember

        public void testCellFormatterOnCalcMember()
        Unit test for a cell formatter defined against a calculated member, using the old syntax (a member property called "CELL_FORMATTER").
      • testCellFormatterOnCalcMemberNested

        public void testCellFormatterOnCalcMemberNested()
        Unit test for a cell formatter defined against a calculated member, using the new syntax (a nested CellFormatter element).
      • testCellFormatterOnCalcMemberScript

        public void testCellFormatterOnCalcMemberScript()
        Unit test for a cell formatter defined against a calculated member, using a script.
      • testMemberFormatter

        public void testMemberFormatter()
        Unit test for a member formatter defined in the old way -- a 'formatter' attribute of a Measure element.
      • testMemberFormatterNested

        public void testMemberFormatterNested()
        As testMemberFormatter(), but using new-style nested memberFormatter element.
      • testPropertyFormatter

        public void testPropertyFormatter()
                                   throws java.sql.SQLException
        Unit test for a property formatter defined in the old way -- a 'formatter' attribute of a Property element.
        Throws:
        java.sql.SQLException - on error
      • testPropertyFormatterNested

        public void testPropertyFormatterNested()
                                         throws java.sql.SQLException
        As testPropertyFormatter(), but using new-style nested PropertyFormatter element.
        Throws:
        java.sql.SQLException - on error
      • testPropertyFormatterScript

        public void testPropertyFormatterScript()
                                         throws java.sql.SQLException
        As testPropertyFormatterNested(), but using a script.
        Throws:
        java.sql.SQLException - on error
      • testMdc

        public void testMdc()
        This is a test for MONDRIAN-994. It checks that the MDC logging context is passed through all the threads.