Search in sources :

Example 1 with RelationOrJoin

use of mondrian.olap.MondrianDef.RelationOrJoin in project mondrian by pentaho.

the class RolapCubeHierarchyTest method testInit_FactCube_FactTableEquals.

public void testInit_FactCube_FactTableEquals() {
    RolapCubeDimension cubeDimension = mock(RolapCubeDimension.class);
    RolapCube cubeDimension_cube = mock(RolapCube.class);
    boolean cubeDimension_cube_isVirtual = true;
    String cubeDimension_uniqueName = "TheDimUniqueName";
    RolapSchema cubeDimension_schema = mock(RolapSchema.class);
    RolapConnection cubeDimension_schema_connection = mock(RolapConnection.class);
    DataSource cubeDimension_schema_connection_DS = mock(DataSource.class);
    MondrianDef.CubeDimension cubeDim = null;
    RolapHierarchy rolapHierarchy = mock(RolapHierarchy.class);
    Hierarchy rolapHierarchy_hierarchy = null;
    String rolapHierarchy_uniqueName = "TheDimUniqueName";
    Level[] rolapHierarchy_levels = new Level[] {};
    RelationOrJoin rolapHierarchy_relation = mock(Relation.class);
    String subName = null;
    int ordinal = 0;
    RolapCube factCube = mock(RolapCube.class);
    RelationOrJoin factCube_Fact = rolapHierarchy_relation;
    boolean factCube_Fact_equals = true;
    // check
    assertEquals(factCube_Fact_equals, factCube_Fact.equals(rolapHierarchy_relation));
    assertEquals(factCube_Fact_equals, rolapHierarchy_relation.equals(factCube_Fact));
    doReturn(cubeDimension_cube).when(cubeDimension).getCube();
    doReturn(cubeDimension_cube_isVirtual).when(cubeDimension_cube).isVirtual();
    doReturn(cubeDimension_schema).when(cubeDimension).getSchema();
    doReturn(cubeDimension_schema_connection).when(cubeDimension_schema).getInternalConnection();
    doReturn(cubeDimension_schema_connection_DS).when(cubeDimension_schema_connection).getDataSource();
    doReturn(cubeDimension_uniqueName).when(cubeDimension).getUniqueName();
    doReturn(rolapHierarchy_hierarchy).when(rolapHierarchy).getHierarchy();
    doReturn(rolapHierarchy_levels).when(rolapHierarchy).getLevels();
    doReturn(rolapHierarchy_uniqueName).when(rolapHierarchy).getUniqueName();
    doReturn(rolapHierarchy_relation).when(rolapHierarchy).getRelation();
    doReturn(factCube_Fact).when(factCube).getFact();
    RolapCubeHierarchy rch = new RolapCubeHierarchy(cubeDimension, cubeDim, rolapHierarchy, subName, ordinal, factCube);
    assertEquals(true, rch.isUsingCubeFact());
}
Also used : DataSource(javax.sql.DataSource) Hierarchy(mondrian.olap.Hierarchy) MondrianDef(mondrian.olap.MondrianDef) Level(mondrian.olap.Level) RelationOrJoin(mondrian.olap.MondrianDef.RelationOrJoin)

Example 2 with RelationOrJoin

use of mondrian.olap.MondrianDef.RelationOrJoin in project mondrian by pentaho.

the class RolapCubeHierarchyTest method testInit_FactCube_FactTableDiffers.

public void testInit_FactCube_FactTableDiffers() {
    RolapCubeDimension cubeDimension = mock(RolapCubeDimension.class);
    RolapCube cubeDimension_cube = mock(RolapCube.class);
    boolean cubeDimension_cube_isVirtual = true;
    String cubeDimension_uniqueName = "TheDimUniqueName";
    RolapSchema cubeDimension_schema = mock(RolapSchema.class);
    RolapConnection cubeDimension_schema_connection = mock(RolapConnection.class);
    DataSource cubeDimension_schema_connection_DS = mock(DataSource.class);
    MondrianDef.CubeDimension cubeDim = null;
    RolapHierarchy rolapHierarchy = mock(RolapHierarchy.class);
    Hierarchy rolapHierarchy_hierarchy = null;
    String rolapHierarchy_uniqueName = "TheDimUniqueName";
    Level[] rolapHierarchy_levels = new Level[] {};
    RelationOrJoin rolapHierarchy_relation = mock(Relation.class);
    String subName = null;
    int ordinal = 0;
    RolapCube factCube = mock(RolapCube.class);
    RelationOrJoin factCube_Fact = mock(Relation.class);
    boolean factCube_Fact_equals = false;
    // check
    assertEquals(factCube_Fact_equals, factCube_Fact.equals(rolapHierarchy_relation));
    assertEquals(factCube_Fact_equals, rolapHierarchy_relation.equals(factCube_Fact));
    doReturn(cubeDimension_cube).when(cubeDimension).getCube();
    doReturn(cubeDimension_cube_isVirtual).when(cubeDimension_cube).isVirtual();
    doReturn(cubeDimension_schema).when(cubeDimension).getSchema();
    doReturn(cubeDimension_schema_connection).when(cubeDimension_schema).getInternalConnection();
    doReturn(cubeDimension_schema_connection_DS).when(cubeDimension_schema_connection).getDataSource();
    doReturn(cubeDimension_uniqueName).when(cubeDimension).getUniqueName();
    doReturn(rolapHierarchy_hierarchy).when(rolapHierarchy).getHierarchy();
    doReturn(rolapHierarchy_levels).when(rolapHierarchy).getLevels();
    doReturn(rolapHierarchy_uniqueName).when(rolapHierarchy).getUniqueName();
    doReturn(rolapHierarchy_relation).when(rolapHierarchy).getRelation();
    doReturn(factCube_Fact).when(factCube).getFact();
    RolapCubeHierarchy rch = new RolapCubeHierarchy(cubeDimension, cubeDim, rolapHierarchy, subName, ordinal, factCube);
    assertEquals(false, rch.isUsingCubeFact());
}
Also used : DataSource(javax.sql.DataSource) Hierarchy(mondrian.olap.Hierarchy) MondrianDef(mondrian.olap.MondrianDef) Level(mondrian.olap.Level) RelationOrJoin(mondrian.olap.MondrianDef.RelationOrJoin)

Aggregations

DataSource (javax.sql.DataSource)2 Hierarchy (mondrian.olap.Hierarchy)2 Level (mondrian.olap.Level)2 MondrianDef (mondrian.olap.MondrianDef)2 RelationOrJoin (mondrian.olap.MondrianDef.RelationOrJoin)2