• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java Result类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中mondrian.olap.Result的典型用法代码示例。如果您正苦于以下问题:Java Result类的具体用法?Java Result怎么用?Java Result使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Result类属于mondrian.olap包,在下文中一共展示了Result类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: testBugMondrian902

import mondrian.olap.Result; //导入依赖的package包/类
/**
 * Test case for bug <a href="http://jira.pentaho.com/browse/MONDRIAN-902">
 * MONDRIAN-902, "mondrian populating the same members on both axes"</a>.
 */
public void testBugMondrian902() {
    Result result = executeQuery(
        "SELECT\n"
        + "NON EMPTY CrossJoin(\n"
        + "  [Education Level].[Education Level].Members,\n"
        + "  CrossJoin(\n"
        + "    [Product].[Product Family].Members,\n"
        + "    [Store].[Store State].Members)) ON COLUMNS,\n"
        + "NON EMPTY CrossJoin(\n"
        + "  [Promotions].[Promotion Name].Members,\n"
        + "  [Marital Status].[Marital Status].Members) ON ROWS\n"
        + "FROM [Warehouse and Sales]");
    assertEquals(
        "[[Education Level].[Bachelors Degree], [Product].[Drink], [Store].[USA].[CA]]",
        result.getAxes()[0].getPositions().get(0).toString());
    assertEquals(45, result.getAxes()[0].getPositions().size());
    // With bug MONDRIAN-902, this gave the same result as for axis #0:
    assertEquals(
        "[[Promotions].[Bag Stuffers], [Marital Status].[M]]",
        result.getAxes()[1].getPositions().get(0).toString());
    assertEquals(96, result.getAxes()[1].getPositions().size());
}
 
开发者ID:OSBI,项目名称:mondrian,代码行数:27,代码来源:VirtualCubeTest.java


示例2: _testNullDefaultMeasure

import mondrian.olap.Result; //导入依赖的package包/类
/**
 * This ought to give the same result as the above testD2() method.
 * In this case, the FT2Extra cube has a default measure with no
 * data (null) for all members. This default measure is used
 * in the evaluation even though there is an implicit use of the
 * measure [Measures].[Value].
 *
 * @throws Exception
 */
public void _testNullDefaultMeasure() throws Exception {
    if (!isApplicable()) {
        return;
    }

    String mdx =
        "select "
        + " NON EMPTY filter({[D1].[a],[D1].[b],[D1].[c]}, "
        + "    [Measures].[Value] > 0) "
        + " ON COLUMNS, "
        + " {[D2].[x],[D2].[y],[D2].[z]} "
        + " ON ROWS "
        + "from FT2Extra";

    //getCubeTestContext().assertQueryReturns(mdx, RESULTS);
    Result result = getTestContext().executeQuery(mdx);
    String resultString = TestContext.toString(result);
    assertTrue(resultString.equals(RESULTS));
}
 
开发者ID:OSBI,项目名称:mondrian,代码行数:29,代码来源:RolapResultTest.java


示例3: run

import mondrian.olap.Result; //导入依赖的package包/类
protected Result run() {
    getConnection().getCacheControl(null).flushSchemaCache();
    IntegerProperty monLimit =
        MondrianProperties.instance().ResultLimit;
    int oldLimit = monLimit.get();
    try {
        monLimit.set(this.resultLimit);
        Result result = executeQuery(query, con);

        // Check the number of positions on the last axis, which is
        // the ROWS axis in a 2 axis query.
        int numAxes = result.getAxes().length;
        Axis a = result.getAxes()[numAxes - 1];
        final int positionCount = a.getPositions().size();
        assertEquals(rowCount, positionCount);
        return result;
    } finally {
        monLimit.set(oldLimit);
    }
}
 
开发者ID:OSBI,项目名称:mondrian,代码行数:21,代码来源:BatchTestCase.java


示例4: testImplicitMember

import mondrian.olap.Result; //导入依赖的package包/类
public void testImplicitMember() throws Exception {
    // explicit use of [Product].[Class1]
    String mdx =
        " select NON EMPTY Crossjoin("
        + " Hierarchize(Union({[Product].[Class1]}, "
        + "[Product].[Class1].Children)), "
        + " {[Measures].[Requested Value], "
        + " [Measures].[Shipped Value]}"
        + ") ON COLUMNS,"
        + " NON EMPTY Hierarchize(Union({[Geography].[All Regions]},"
        + "[Geography].[All Regions].Children)) ON ROWS"
        + " from [ImplicitMember]";

    Result result1 = getTestContext().executeQuery(mdx);
    String resultString1 = TestContext.toString(result1);
    Result result2 = getTestContext().executeQuery(mdx);
    String resultString2 = TestContext.toString(result2);

    assertEquals(resultString1, resultString2);
}
 
开发者ID:OSBI,项目名称:mondrian,代码行数:21,代码来源:Checkin_7641.java


示例5: testStoreCount

import mondrian.olap.Result; //导入依赖的package包/类
public void testStoreCount() throws Exception {
    if (!isApplicable()) {
        return;
    }

    MondrianProperties props = MondrianProperties.instance();

    // get value without aggregates
    propSaver.set(props.UseAggregates, false);

    String mdx =
        "select {[Measures].[Store Count]} on columns from Cheques";
    Result result = getTestContext().executeQuery(mdx);
    Object v = result.getCell(new int[]{0}).getValue();

    propSaver.set(props.UseAggregates, true);

    Result result1 = getTestContext().executeQuery(mdx);
    Object v1 = result1.getCell(new int[]{0}).getValue();

    assertTrue(v.equals(v1));
}
 
开发者ID:OSBI,项目名称:mondrian,代码行数:23,代码来源:BUG_1541077.java


示例6: testSalesCount

import mondrian.olap.Result; //导入依赖的package包/类
public void testSalesCount() throws Exception {
    if (!isApplicable()) {
        return;
    }

    MondrianProperties props = MondrianProperties.instance();

    // get value without aggregates
    propSaver.set(props.UseAggregates, false);

    String mdx =
        "select {[Measures].[Sales Count]} on columns from Cheques";
    Result result = getTestContext().executeQuery(mdx);
    Object v = result.getCell(new int[]{0}).getValue();

    propSaver.set(props.UseAggregates, true);

    Result result1 = getTestContext().executeQuery(mdx);
    Object v1 = result1.getCell(new int[]{0}).getValue();

    assertTrue(v.equals(v1));
}
 
开发者ID:OSBI,项目名称:mondrian,代码行数:23,代码来源:BUG_1541077.java


示例7: testTotalAmount

import mondrian.olap.Result; //导入依赖的package包/类
public void testTotalAmount() throws Exception {
    if (!isApplicable()) {
        return;
    }

    MondrianProperties props = MondrianProperties.instance();

    // get value without aggregates
    propSaver.set(props.UseAggregates, false);

    String mdx =
        "select {[Measures].[Total Amount]} on columns from Cheques";
    Result result = getTestContext().executeQuery(mdx);
    Object v = result.getCell(new int[]{0}).getValue();

    propSaver.set(props.UseAggregates, false);

    Result result1 = getTestContext().executeQuery(mdx);
    Object v1 = result1.getCell(new int[]{0}).getValue();

    assertTrue(v.equals(v1));
}
 
开发者ID:OSBI,项目名称:mondrian,代码行数:23,代码来源:BUG_1541077.java


示例8: testBug1541077

import mondrian.olap.Result; //导入依赖的package包/类
public void testBug1541077() throws Exception {
    if (!isApplicable()) {
        return;
    }

    MondrianProperties props = MondrianProperties.instance();

    // get value without aggregates
    propSaver.set(props.UseAggregates, false);

    String mdx = "select {[Measures].[Avg Amount]} on columns from Cheques";

    Result result = getTestContext().executeQuery(mdx);
    Object v = result.getCell(new int[]{0}).getFormattedValue();

    // get value with aggregates
    propSaver.set(props.UseAggregates, true);

    Result result1 = getTestContext().executeQuery(mdx);
    Object v1 = result1.getCell(new int[]{0}).getFormattedValue();

    assertTrue(v.equals(v1));
}
 
开发者ID:OSBI,项目名称:mondrian,代码行数:24,代码来源:BUG_1541077.java


示例9: testScenarioPropertyBug1496

import mondrian.olap.Result; //导入依赖的package包/类
public void testScenarioPropertyBug1496() {
    // looking up the $scenario property for a non ScenarioCalc member
    // causes class cast exception
    // http://jira.pentaho.com/browse/MONDRIAN-1496
    Result result = TestContext.instance().executeQuery(
        "select {[Gender].[Gender].members} on columns from Sales");

    // non calc member, should return null
    Object o = result.getAxes()[0].getPositions().get(0).get(0)
        .getPropertyValue("$scenario");
    assertEquals(null, o);

    result = TestContext.instance().executeQuery(
        "with member gender.cal as '1' "
        + "select {[Gender].cal} on 0 from Sales");
    // calc member, should return null
    o = result.getAxes()[0].getPositions().get(0).get(0)
        .getPropertyValue("$scenario");
    assertEquals(null, o);
}
 
开发者ID:OSBI,项目名称:mondrian,代码行数:21,代码来源:ScenarioTest.java


示例10: testNonEmptyUnionQuery

import mondrian.olap.Result; //导入依赖的package包/类
public void testNonEmptyUnionQuery() {
    Result result = executeQuery(
        "select {[Measures].[Unit Sales], [Measures].[Store Cost], [Measures].[Store Sales]} on columns,\n"
        + " NON EMPTY Hierarchize(\n"
        + "   Union(\n"
        + "     Crossjoin(\n"
        + "       Crossjoin([Gender].[All Gender].children,\n"
        + "                 [Marital Status].[All Marital Status].children),\n"
        + "       Crossjoin([Customers].[All Customers].children,\n"
        + "                 [Product].[All Products].children) ),\n"
        + "     Crossjoin({([Gender].[All Gender].[M], [Marital Status].[All Marital Status].[M])},\n"
        + "       Crossjoin(\n"
        + "         [Customers].[All Customers].[USA].children,\n"
        + "         [Product].[All Products].children) ) )) on rows\n"
        + "from Sales where ([Time].[1997])");
    final Axis rowsAxis = result.getAxes()[1];
    Assert.assertEquals(21, rowsAxis.getPositions().size());
}
 
开发者ID:Twixer,项目名称:mondrian-3.1.5,代码行数:19,代码来源:NonEmptyTest.java


示例11: testCalcMemberWithNonEmptyCrossJoin

import mondrian.olap.Result; //导入依赖的package包/类
/**
 * Make sure that the Crossjoin in [Measures].[CustomerCount]
 * is not evaluated in NON EMPTY context.
 */
public void testCalcMemberWithNonEmptyCrossJoin() {
    TestContext.instance().flushSchemaCache();
    Result result = executeQuery(
            "with member [Measures].[CustomerCount] as \n"
            + "'Count(CrossJoin({[Product].[All Products]}, [Customers].[Name].Members))'\n"
            + "select \n"
            + "NON EMPTY{[Measures].[CustomerCount]} ON columns,\n"
            + "NON EMPTY{[Product].[All Products]} ON rows\n"
            + "from [Sales]\n"
            + "where ([Store].[All Stores].[USA].[CA].[San Francisco].[Store 14], [Time].[1997].[Q1].[1])");
    Cell c = result.getCell(new int[] {0, 0});
    // we expect 10281 customers, although there are only 20 non-empty ones
    // @see #testLevelMembers
    assertEquals("10,281", c.getFormattedValue());
}
 
开发者ID:Twixer,项目名称:mondrian-3.1.5,代码行数:20,代码来源:NonEmptyTest.java


示例12: _testNullDefaultMeasure

import mondrian.olap.Result; //导入依赖的package包/类
/**
 * This ought to give the same result as the above testD2() method.
 * In this case, the FT2Extra cube has a default measure with no
 * data (null) for all members. This default measure is used
 * in the evaluation even though there is an implicit use of the
 * measure [Measures].[Value].
 *
 * @throws Exception
 */
public void _testNullDefaultMeasure() throws Exception {
    if (!isApplicable()) {
        return;
    }

    String mdx =
        "select "
        + " NON EMPTY filter({[D1].[a],[D1].[b],[D1].[c]}, "
        + "    [Measures].[Value] > 0) "
        + " ON COLUMNS, "
        + " {[D2].[x],[D2].[y],[D2].[z]} "
        + " ON ROWS "
        + "from FT2Extra";

    //getCubeTestContext().assertQueryReturns(mdx, RESULTS);
    Result result = getCubeTestContext().executeQuery(mdx);
    String resultString = TestContext.toString(result);
    assertTrue(resultString.equals(RESULTS));
}
 
开发者ID:Twixer,项目名称:mondrian-3.1.5,代码行数:29,代码来源:RolapResultTest.java


示例13: testImplicitMember

import mondrian.olap.Result; //导入依赖的package包/类
public void testImplicitMember() throws Exception {
    // explicit use of [Product].[Class1]
    String mdx =
        " select NON EMPTY Crossjoin("
        + " Hierarchize(Union({[Product].[Class1]}, "
        + "[Product].[Class1].Children)), "
        + " {[Measures].[Requested Value], "
        + " [Measures].[Shipped Value]}"
        + ") ON COLUMNS,"
        + " NON EMPTY Hierarchize(Union({[Geography].[All Regions]},"
        + "[Geography].[All Regions].Children)) ON ROWS"
        + " from [ImplicitMember]";

    Result result1 = getCubeTestContext().executeQuery(mdx);
    String resultString1 = TestContext.toString(result1);
    Result result2 = getCubeTestContext().executeQuery(mdx);
    String resultString2 = TestContext.toString(result2);

    assertEquals(resultString1, resultString2);
}
 
开发者ID:Twixer,项目名称:mondrian-3.1.5,代码行数:21,代码来源:Checkin_7641.java


示例14: testCrossJoin

import mondrian.olap.Result; //导入依赖的package包/类
public void testCrossJoin() throws Exception {
    // explicit use of [Product].[Class1]
    String mdx =
    "select {[Measures].[Requested Value]} ON COLUMNS,"+
    " NON EMPTY Crossjoin("+
    " {[Geography].[All Regions].Children},"+
    " {[Product].[All Products].Children}"+
    ") ON ROWS"+
    " from [Checkin_7634]";


    // Execute query but do not used the CrossJoin nonEmptyList optimization
    MondrianProperties.instance().CrossJoinOptimizerSize.set(
        Integer.MAX_VALUE);
    Result result1 = getCubeTestContext().executeQuery(mdx);
    String resultString1 = TestContext.toString(result1);

    // Execute query using the new version of the CrossJoin
    // nonEmptyList optimization
    MondrianProperties.instance().CrossJoinOptimizerSize.set(0);
    Result result2 = getCubeTestContext().executeQuery(mdx);
    String resultString2 = TestContext.toString(result2);

    // This succeeds.
    assertEquals(resultString1, resultString2);
}
 
开发者ID:Twixer,项目名称:mondrian-3.1.5,代码行数:27,代码来源:Checkin_7634.java


示例15: testStoreCount

import mondrian.olap.Result; //导入依赖的package包/类
public void testStoreCount() throws Exception {
    if (!isApplicable()) {
        return;
    }

    MondrianProperties props = MondrianProperties.instance();

    // get value without aggregates
    props.UseAggregates.setString("false");

    String mdx =
        "select {[Measures].[Store Count]} on columns from Cheques";
    Result result = getCubeTestContext().executeQuery(mdx);
    Object v = result.getCell(new int[]{0}).getValue();

    props.UseAggregates.setString("true");

    Result result1 = getCubeTestContext().executeQuery(mdx);
    Object v1 = result1.getCell(new int[]{0}).getValue();

    assertTrue(v.equals(v1));
}
 
开发者ID:Twixer,项目名称:mondrian-3.1.5,代码行数:23,代码来源:BUG_1541077.java


示例16: testSalesCount

import mondrian.olap.Result; //导入依赖的package包/类
public void testSalesCount() throws Exception {
    if (!isApplicable()) {
        return;
    }

    MondrianProperties props = MondrianProperties.instance();

    // get value without aggregates
    props.UseAggregates.setString("false");

    String mdx =
        "select {[Measures].[Sales Count]} on columns from Cheques";
    Result result = getCubeTestContext().executeQuery(mdx);
    Object v = result.getCell(new int[]{0}).getValue();

    props.UseAggregates.setString("true");

    Result result1 = getCubeTestContext().executeQuery(mdx);
    Object v1 = result1.getCell(new int[]{0}).getValue();

    assertTrue(v.equals(v1));
}
 
开发者ID:Twixer,项目名称:mondrian-3.1.5,代码行数:23,代码来源:BUG_1541077.java


示例17: testTotalAmount

import mondrian.olap.Result; //导入依赖的package包/类
public void testTotalAmount() throws Exception {
    if (!isApplicable()) {
        return;
    }

    MondrianProperties props = MondrianProperties.instance();

    // get value without aggregates
    props.UseAggregates.setString("false");

    String mdx =
        "select {[Measures].[Total Amount]} on columns from Cheques";
    Result result = getCubeTestContext().executeQuery(mdx);
    Object v = result.getCell(new int[]{0}).getValue();

    props.UseAggregates.setString("true");

    Result result1 = getCubeTestContext().executeQuery(mdx);
    Object v1 = result1.getCell(new int[]{0}).getValue();

    assertTrue(v.equals(v1));
}
 
开发者ID:Twixer,项目名称:mondrian-3.1.5,代码行数:23,代码来源:BUG_1541077.java


示例18: testBug1541077

import mondrian.olap.Result; //导入依赖的package包/类
public void testBug1541077() throws Exception {
    if (!isApplicable()) {
        return;
    }

    MondrianProperties props = MondrianProperties.instance();

    // get value without aggregates
    props.UseAggregates.setString("false");

    String mdx = "select {[Measures].[Avg Amount]} on columns from Cheques";

    Result result = getCubeTestContext().executeQuery(mdx);
    Object v = result.getCell(new int[]{0}).getFormattedValue();

    // get value with aggregates
    props.UseAggregates.setString("true");

    Result result1 = getCubeTestContext().executeQuery(mdx);
    Object v1 = result1.getCell(new int[]{0}).getFormattedValue();

    assertTrue(v.equals(v1));
}
 
开发者ID:Twixer,项目名称:mondrian-3.1.5,代码行数:24,代码来源:BUG_1541077.java


示例19: checkDrillThroughSql

import mondrian.olap.Result; //导入依赖的package包/类
private void checkDrillThroughSql(
    Result result,
    int row,
    boolean extendedContext,
    String expectedMember,
    String expectedCell,
    String expectedSql,
    int expectedRows) throws Exception
{
    final Member empMember =
        result.getAxes()[1].getPositions().get(row).get(0);
    assertEquals(expectedMember, empMember.getUniqueName());
    // drill through member
    final Cell cell = result.getCell(new int[]{0, row});
    assertEquals(expectedCell, cell.getFormattedValue());
    String sql = cell.getDrillThroughSQL(extendedContext);

    getTestContext().assertSqlEquals(expectedSql, sql, expectedRows);
}
 
开发者ID:Twixer,项目名称:mondrian-3.1.5,代码行数:20,代码来源:ParentChildHierarchyTest.java


示例20: JRMondrianResult

import mondrian.olap.Result; //导入依赖的package包/类
public JRMondrianResult(Result result)
{
	this.result = result;

	JRMondrianFactory factory = new JRMondrianFactory();

	Query query = result.getQuery();
	Axis[] resultAxes = result.getAxes();
	axes = new JRMondrianAxis[resultAxes.length];
	for (int i = 0; i < resultAxes.length; i++)
	{
		AxisOrdinal ordinal = AxisOrdinal.StandardAxisOrdinal.forLogicalOrdinal(i);
		axes[i] = new JRMondrianAxis(resultAxes[i], query.getMdxHierarchiesOnAxis(ordinal), factory);
	}
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:16,代码来源:JRMondrianResult.java



注:本文中的mondrian.olap.Result类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java UploadOptions类代码示例发布时间:2022-05-22
下一篇:
Java CSVReader类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap