/* // $Id: //guest/julian_hyde/mondrian/src/main/mondrian/test/FoodMartTestCase.java#1 $ // (C) Copyright 2002 Kana Software, Inc. // This software is subject to the terms of the Common Public License // Agreement, available at the following URL: // http://www.opensource.org/licenses/cpl.html. // (C) Copyright 2002 Kana Software, Inc. and others. // All Rights Reserved. // You must accept the terms of that agreement to use this software. // // jhyde, 29 March, 2002 */ package mondrian.test; import mondrian.olap.Result; import mondrian.olap.Connection; import mondrian.olap.Query; import mondrian.olap.Axis; import junit.framework.TestCase; /** * <code>FoodMartTestCase</code> is a unit test which runs against the FoodMart * database. * * @author jhyde * @since 29 March, 2002 * @version $Id: //guest/julian_hyde/mondrian/src/main/mondrian/test/FoodMartTestCase.java#1 $ **/ public abstract class FoodMartTestCase extends TestCase { FoodMartTestCase(String name) { super(name); } Result runQuery(String queryString) { Connection connection = getConnection(); Query query = connection.parseQuery(queryString); return connection.execute(query); } protected Connection getConnection() { return TestContext.instance().getFoodMartConnection(); } /** * Runs a query, and asserts that the result has a given number of columns * and rows. */ protected void assertSize(String queryString, int columnCount, int rowCount) { Result result = runQuery(queryString); Axis[] axes = result.getAxes(); assertTrue(axes.length == 2); assertTrue(axes[0].positions.length == columnCount); assertTrue(axes[1].positions.length == rowCount); } } // End FoodMartTestCase.java
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#3 | 1893 | Julian Hyde | mondrian: Integrate //guest/paul_dymecki/mondrian/...@1892 to //guest/julian_hyde/mondrian/... | ||
#2 | 1787 | Julian Hyde |
mondrian: Organize tests into more JUnit-friendly structure. Get properties from TestContext.getProperties. Read properties from mondrian.properties, if it exists. Add Paul's code for <Member>.Hierarchy, disabled. |
||
#1 | 1603 | Julian Hyde |
mondrian: Add Andreas' taglib; Rename 'mondrian.rolap.Util.assert' to 'assertTrue', because 'assert' is a keyword in jdk 1.4; Fix 'NON EMPTY'; JUnit framework for tests; Add Oracle dataset. |