  @Test(priority = 2)
  public void testGetXFactTable() throws Exception {

    List<FieldSchema> factColumns = new ArrayList<>(cubeMeasures.size());
    for (CubeMeasure measure : cubeMeasures) {
      factColumns.add(measure.getColumn());
    }

    // add one dimension of the cube
    factColumns.add(new FieldSchema("zipcode", "int", "zip"));
    FieldSchema itPart = new FieldSchema("it", "string", "date part");
    FieldSchema etPart = new FieldSchema("et", "string", "date part");
    StorageTableDesc s1 = new StorageTableDesc(TextInputFormat.class, HiveIgnoreKeyTextOutputFormat.class,
        Lists.newArrayList(getDatePartition(), itPart, etPart), Lists.newArrayList(getDatePartitionKey(),
        itPart.getName(), etPart.getName()));

    Set<UpdatePeriod> c1Storage = new HashSet<UpdatePeriod>();
    c1Storage.add(HOURLY);
    Map<String, Set<UpdatePeriod>> updatePeriods = new HashMap<String, Set<UpdatePeriod>>();
    updatePeriods.put(c1, c1Storage);

    Map<String, StorageTableDesc> storageTableDescs = getHashMap("HOURLY_c1", s1);

    Map<UpdatePeriod, String> updatePeriodMap = new HashMap<>();
    updatePeriodMap.put(HOURLY, HOURLY.toString() + "_" + c1);

    Map<String, Set<String>> storageTablePartitionColumns = new HashMap<String, Set<String>>();
    storageTablePartitionColumns.put(c1, new HashSet<>());

    Map<String, Map<UpdatePeriod, String>> storageUpdatePeriodMap = new HashMap<String, Map<UpdatePeriod, String>>();

    storageUpdatePeriodMap.put(c1, updatePeriodMap);

    client.createCubeFactTable(CUBE_NAME_WITH_PROPS, X_FACT_NAME, factColumns, updatePeriods, 0.0d, new HashMap<String,
        String>(), storageTableDescs, storageUpdatePeriodMap, storageTablePartitionColumns);

    CubeFactTable cubeFact = new CubeFactTable(CUBE_NAME_WITH_PROPS, X_FACT_NAME, factColumns, updatePeriods, 0.0d,
        new HashMap<String, String>(), storageUpdatePeriodMap, new HashMap<String, Set<String>>());
    XFact xfact = client.getXFactTable(cubeFact);
    assertEquals(xfact.getCubeName(), CUBE_NAME_WITH_PROPS);
    assertEquals(xfact.getName(), X_FACT_NAME.toLowerCase());
  }