/* // $Id: //guest/julian_hyde/mondrian/src/main/mondrian/test/TestContext.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.Connection; import mondrian.olap.DriverManager; import java.util.StringTokenizer; import java.net.URL; import java.io.File; import java.io.PrintWriter; /** * <code>TestContext</code> is a singleton class which contains the information * necessary to run mondrian tests (otherwise we'd have to pass this information * into the constructor of TestCases). * * @author jhyde * @since 29 March, 2002 * @version $Id: //guest/julian_hyde/mondrian/src/main/mondrian/test/TestContext.java#1 $ **/ class TestContext { private static TestContext instance; // the singleton private PrintWriter pw; private Connection foodMartConnection; public static TestContext instance() { return instance; } /** Instantiates the singleton. **/ public static void init() { instance = new TestContext(); } /** Creates a TestContext. Called only from {@link #init}. **/ private TestContext() { this.pw = new PrintWriter(System.out,true); String jdbcDrivers = System.getProperty( "mondrian.jdbcDrivers", "org.hsqldb.jdbcDriver"); StringTokenizer tok = new java.util.StringTokenizer(jdbcDrivers, ","); while (tok.hasMoreTokens()) { String jdbcDriver = tok.nextToken(); try { Class.forName(jdbcDriver); } catch (ClassNotFoundException e) { pw.println("Could not find driver " + jdbcDriver); } } String connectString = System.getProperty("mondrian.test.connectString"); if (connectString == null) { URL catalogUrl = mondrian.resource.Util.convertPathToURL( new File("demo/FoodMart.xml")); String jdbcURL = System.getProperty( "mondrian.test.jdbcURL", "jdbc:hsqldb:demo/hsql/FoodMart"); connectString = "Provider=mondrian;" + "Jdbc=" + jdbcURL + ";" + "Catalog=" + catalogUrl; } foodMartConnection = DriverManager.getConnection(connectString, null, false); } /** Returns a connection to the FoodMart database. **/ Connection getFoodMartConnection() { return foodMartConnection; } PrintWriter getWriter() { return pw; } } // End TestContext.java
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#7 | 1788 | Julian Hyde | mondrian: More of the same. | ||
#6 | 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. |
||
#5 | 1674 | Julian Hyde | mondrian: Paul Dymecki: implement builtin functions FirstChild, FirstSibling, Lag, Lead, etc. | ||
#4 | 1627 | Julian Hyde |
mondrian: Fix bug where aggregation manager was not checking measure when looking up aggregations. |
||
#3 | 1611 | Julian Hyde |
mondrian: Add XOMGen ant task; Improve JavaCUP ant task; Upgrade to JavaCUP 0.10k beta 2; Fix test oopses. |
||
#2 | 1609 | Julian Hyde |
mondrian: Forgot a couple of files last change. Unit tests for builtin functions. Don't return null members (e.g. [Gender].[F].PrevMember). |
||
#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. |