Ejemplo n.º 1
0
 @Test
 public final void testGetHierarchyRootMembers() throws SaikuOlapException {
   List<SaikuMember> rootMembers =
       olapMetaExplorer.getHierarchyRootMembers(
           olapMetaExplorer.getAllCubes().get(0), "Department");
   assertNotNull(rootMembers);
 }
Ejemplo n.º 2
0
  /**
   * Test to make sure you can get a single dimension in a cube.
   *
   * @throws SaikuOlapException
   */
  @Test
  public final void testGetDimensionNull() throws SaikuOlapException {
    List<SaikuCube> cubes = olapMetaExplorer.getAllCubes();

    SaikuDimension dim = olapMetaExplorer.getDimension(cubes.get(0), "No dimension");

    assertNull(dim);
  }
Ejemplo n.º 3
0
  @Test
  public final void testGetMember() throws SaikuOlapException {
    SaikuMember member =
        olapMetaExplorer.getMember(
            olapMetaExplorer.getAllCubes().get(0), "[Department].[All Departments]");

    assertNotNull(member);
    assertEquals("[Department].[Department].[All Departments]", member.getUniqueName());
  }
Ejemplo n.º 4
0
  @Test
  public final void testGetAllMeasures() throws SaikuOlapException {
    List<SaikuMember> members =
        olapMetaExplorer.getAllMeasures(olapMetaExplorer.getAllCubes().get(0));

    assertNotNull(members);

    assertEquals(5, members.size());
  }
Ejemplo n.º 5
0
  @Test
  public final void testGetHierarchy() throws SaikuOlapException {
    SaikuHierarchy hier =
        olapMetaExplorer.getHierarchy(olapMetaExplorer.getAllCubes().get(0), "Department");

    assertNotNull(hier);

    assertEquals("Department", hier.getName());
  }
Ejemplo n.º 6
0
  /**
   * Test to make sure you can get all the dimensions in a cube.
   *
   * @throws SaikuOlapException
   */
  @Test
  public final void testGetAllDimensions() throws SaikuOlapException {
    List<SaikuCube> cubes = olapMetaExplorer.getAllCubes();

    List<SaikuDimension> dims = olapMetaExplorer.getAllDimensions(cubes.get(0));

    assertNotNull(dims);
    assertEquals(4, dims.size());
  }
Ejemplo n.º 7
0
  @Test
  public final void testGetAllMembers() throws SaikuOlapException {
    List<SimpleCubeElement> members =
        olapMetaExplorer.getAllMembers(
            olapMetaExplorer.getAllCubes().get(0), "Department", "Department Description");

    assertNotNull(members);

    assertEquals(12, members.size());
  }
Ejemplo n.º 8
0
  @Test
  public final void testGetAllHierarchies() throws SaikuOlapException {

    List<SaikuHierarchy> hier =
        olapMetaExplorer.getAllHierarchies(olapMetaExplorer.getAllCubes().get(0));

    assertNotNull(hier);

    assertEquals(21, hier.size());
  }
Ejemplo n.º 9
0
  @Test
  public final void testGetMemberChildren() throws SaikuOlapException {

    List<SaikuMember> members =
        olapMetaExplorer.getMemberChildren(
            olapMetaExplorer.getAllCubes().get(0), "[Department].[All Departments]");

    assertNotNull(members);

    assertEquals(12, members.size());
  }
Ejemplo n.º 10
0
  @Test
  public final void testGetAllLevelsUniqueNameHierarchy() throws SaikuOlapException {

    List<SaikuLevel> levels =
        olapMetaExplorer.getAllLevels(
            olapMetaExplorer.getAllCubes().get(0), "Department", "[Department].[Department]");

    assertNotNull(levels);

    assertEquals(2, levels.size());
  }
Ejemplo n.º 11
0
  /**
   * Test to make sure you can get a single dimension in a cube.
   *
   * @throws SaikuOlapException
   */
  @Test
  public final void testGetDimension() throws SaikuOlapException {

    List<SaikuCube> cubes = olapMetaExplorer.getAllCubes();

    SaikuDimension dim = olapMetaExplorer.getDimension(cubes.get(0), "Department");

    assertNotNull(dim);

    assertEquals("Department", dim.getName());
  }
Ejemplo n.º 12
0
  @Test
  public final void testGetAllMembersUniqueNameLevel() throws SaikuOlapException {
    List<SimpleCubeElement> members =
        olapMetaExplorer.getAllMembers(
            olapMetaExplorer.getAllCubes().get(0),
            "Department",
            "[Department].[Department].[(All)]");

    assertNotNull(members);

    assertEquals(1, members.size());
  }
Ejemplo n.º 13
0
  /** Test to make sure that the cubes are returned in the same order. */
  @Test
  public final void testCubeReturnOrder() throws SaikuOlapException {
    List<SaikuCube> output = olapMetaExplorer.getAllCubes();

    assertNotNull(output);

    List<String> names =
        Arrays.asList("HR", "Sales", "Sales 2", "Store", "Warehouse", "Warehouse and Sales");

    List<String> actual = new ArrayList<>();
    for (SaikuCube cube : output) {
      actual.add(cube.getName());
    }
    assertEquals(names, actual);
  }
Ejemplo n.º 14
0
  /** Test to make sure you can retrieve all the cubes from a schema. */
  @Test
  public final void testGetAllCubes() throws SaikuOlapException {
    List<SaikuCube> output = olapMetaExplorer.getAllCubes();

    assertNotNull(output);

    assertEquals(6, output.size());

    for (SaikuCube anOutput : output) {
      assertEquals("FoodMart", anOutput.getCatalog());
      anOutput.getName();
      assertEquals("test", anOutput.getConnection());
      assertEquals("FoodMart", anOutput.getSchema());
      assertThat(anOutput.getUniqueName(), startsWith("[test].[FoodMart].[FoodMart]."));
    }
  }