Commit 51bbe020 authored by Ricco Førgaard's avatar Ricco Førgaard

Added level 6.

Level 6 is about slicing cubes.
parent 727d853f
package com.nesstar.tutorial;
import static org.junit.Assert.assertEquals;
import java.util.List;
import org.junit.Before;
import org.junit.Test;
import com.nesstar.api.Server;
import com.nesstar.api.cube.Cell;
import com.nesstar.api.cube.Cube;
import com.nesstar.api.cube.Slice;
/**
* Nesstar API Tutorial Level 6
* ============================
*
* This tutorial is about retrieving data from Cubes.
*
*/
public class Level06 {
private Server server;
private Cube cube;
/**
* Get the cube with ID "some id" from the server.
*/
@Before
public void connectToServerAndFetchCube() {
}
/**
* Create a slice using the Dimension Foo and the
* Measure bar.
*/
@Test
public void createSimpleSlice() {
Slice slice = null;
assertEquals(1, slice.getDimensions().length);
assertEquals(1, slice.getMeasures().length);
}
/**
* Create a slice using the dimensions Foo and Bar and
* then retrieve the value of the cell at Foo.c, Bar.z
*/
public void getCellValuesFromSlice() {
double cellValue = Double.NaN;
assertEquals(123d, cellValue, 0d);
}
/**
* Create a slice using foo and bar as dimensions and baz
* as measure. Also add the members a and b from Foo and
* the members x, y, and z from Bar.
*
* Then retrieve the value for Foo.a and Bar.y
*/
@Test
public void getSliceWithMembers() {
double value = Double.NaN;
assertEquals(123d, value, 0d);
}
/**
* Create a slice using Foo and Bar as dimensions and
* Baz as Measure. For Foo you must also limit the slice
* to the members a, b, and c.
*
* Then traverse the slice and put all cells in the list.
* Optionally, you can print the list to System.out if you like.
*/
@Test
public void getListOfCells() {
List<Cell> allCells = null;
assertEquals(20, allCells.size());
}
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment