private static DbSetId ecbRoot() { return DbSetId.root( "FREQ", "AME_REF_AREA", "AME_TRANSFORMATION", "AME_AGG_METHOD", "AME_UNIT", "AME_REFERENCE", "AME_ITEM"); }
@Test public void testGetKey() throws Exception { DataStructure dfs = nbb.AsConnection().getDataStructure(new FlowRef("NBB", "TEST_DATASET", null)); Map<String, Dimension> dimensionById = DotStatAccessor.dimensionById(dfs); // default ordering of dimensions DbSetId r1 = DbSetId.root("SUBJECT", "LOCATION", "FREQUENCY"); assertEquals( Key.parse("LOCSTL04.AUS.M"), getKey(dimensionById, r1.child("LOCSTL04", "AUS", "M"))); assertEquals(Key.parse("LOCSTL04.AUS."), getKey(dimensionById, r1.child("LOCSTL04", "AUS"))); assertEquals(Key.parse("LOCSTL04.."), getKey(dimensionById, r1.child("LOCSTL04"))); assertEquals(Key.ALL, getKey(dimensionById, r1)); // custom ordering of dimensions DbSetId r2 = DbSetId.root("FREQUENCY", "LOCATION", "SUBJECT"); assertEquals( Key.parse("LOCSTL04.AUS.M"), getKey(dimensionById, r2.child("M", "AUS", "LOCSTL04"))); assertEquals(Key.parse(".AUS.M"), getKey(dimensionById, r2.child("M", "AUS"))); assertEquals(Key.parse("..M"), getKey(dimensionById, r2.child("M"))); assertEquals(Key.ALL, getKey(dimensionById, r2)); }
private static DbSetId nbbRoot() { return DbSetId.root("SUBJECT", "LOCATION", "FREQUENCY"); }