Search in sources :

Example 26 with Connection

use of mondrian.olap.Connection in project mondrian by pentaho.

the class DynamicSchemaProcessorTest method testDBInfoDSP.

/**
 * Tests to ensure we have access to Connect properies in a DSP
 */
public void testDBInfoDSP() {
    Connection monConnection = TestContext.instance().withSchemaProcessor(FoodMartCatalogDsp.class).getConnection();
    assertEquals(monConnection.getSchema().getName(), "FoodmartFoundInCatalogProperty");
}
Also used : Connection(mondrian.olap.Connection)

Example 27 with Connection

use of mondrian.olap.Connection in project mondrian by pentaho.

the class DynamicSchemaProcessorTest method testFoodmartDsp.

/**
 * Tests to make sure that our base DynamicSchemaProcessor works, and
 * Mondrian is able to parse and connect to FoodMart with it
 */
public void testFoodmartDsp() {
    final Connection monConnection = TestContext.instance().withSchemaProcessor(BaseDsp.class).getConnection();
    assertEquals(monConnection.getSchema().getName(), "REPLACEME");
}
Also used : Connection(mondrian.olap.Connection)

Example 28 with Connection

use of mondrian.olap.Connection in project mondrian by pentaho.

the class DynamicSchemaProcessorTest method testCheckJdbcPropertyDsp.

/**
 * Tests to ensure we have access to Connect properties in a DSP
 */
public void testCheckJdbcPropertyDsp() {
    Connection monConnection = TestContext.instance().withSchemaProcessor(CheckJdbcPropertyDsp.class).getConnection();
    assertEquals(monConnection.getSchema().getName(), CheckJdbcPropertyDsp.RETURNTRUESTRING);
}
Also used : Connection(mondrian.olap.Connection)

Example 29 with Connection

use of mondrian.olap.Connection in project mondrian by pentaho.

the class DynamicSchemaProcessorTest method testProviderTestDSP.

/**
 * Tests to ensure we have access to Connect properies in a DSP
 */
public void testProviderTestDSP() {
    Connection monConnection = TestContext.instance().withSchemaProcessor(ProviderTestDSP.class).getConnection();
    assertEquals(monConnection.getSchema().getName(), "mondrian");
}
Also used : Connection(mondrian.olap.Connection)

Example 30 with Connection

use of mondrian.olap.Connection in project mondrian by pentaho.

the class SchemaVersionTest method testSchema4noVersion.

public void testSchema4noVersion() {
    TestContext testContext = TestContext.instance().withSchema(SCHEMA_4_NVHEADER + SCHEMA_4_BODY);
    Util.PropertyList connectInfo = testContext.getConnectionProperties();
    try {
        Connection conn = DriverManager.getConnection(connectInfo, null);
        conn.close();
        Assert.fail("No exception thrown for version 4 schema.");
    } catch (MondrianException e) {
        assertTrue(e.getMessage().contains("Schema version"));
    }
}
Also used : Connection(mondrian.olap.Connection) Util(mondrian.olap.Util) MondrianException(mondrian.olap.MondrianException)

Aggregations

Connection (mondrian.olap.Connection)38 RolapConnection (mondrian.rolap.RolapConnection)8 Util (mondrian.olap.Util)5 MondrianException (mondrian.olap.MondrianException)4 Result (mondrian.olap.Result)4 Member (mondrian.olap.Member)3 Query (mondrian.olap.Query)3 MDXConnection (org.pentaho.platform.plugin.services.connections.mondrian.MDXConnection)3 MemberExpr (mondrian.mdx.MemberExpr)2 Cube (mondrian.olap.Cube)2 QueryAxis (mondrian.olap.QueryAxis)2 TestMember (mondrian.olap.fun.TestMember)2 Execution (mondrian.server.Execution)2 FoodMartTestCase (mondrian.test.FoodMartTestCase)2 TestContext (mondrian.test.TestContext)2 OlapConnection (org.olap4j.OlapConnection)2 IMondrianCatalogService (org.pentaho.platform.plugin.action.mondrian.catalog.IMondrianCatalogService)2 MondrianCatalog (org.pentaho.platform.plugin.action.mondrian.catalog.MondrianCatalog)2 SQLException (java.sql.SQLException)1 Properties (java.util.Properties)1