@Test
public void testCheckIndexNames() throws IOException {

  HColumnDescriptor desc = new HColumnDescriptor("C");
  String familyIndexAttribute = "index_a:a;index_a:a";
  
  desc.setValue(IndexMasterObserver.THEMIS_SECONDARY_INDEX_FAMILY_ATTRIBUTE_KEY, familyIndexAttribute);
  try {
    IndexMasterObserver.checkIndexNames(desc);
  } catch (IOException e) {
    Assert.assertTrue(e.getMessage().indexOf("duplicate secondary index definition") >= 0);
  }
  
  String[] familyIndexAttributes = new String[] {"index_a:", ":index_a", ":"};
  for (String indexAttribute : familyIndexAttributes) {
    desc.setValue(IndexMasterObserver.THEMIS_SECONDARY_INDEX_FAMILY_ATTRIBUTE_KEY,
      indexAttribute);
    try {
      IndexMasterObserver.checkIndexNames(desc);
    } catch (IOException e) {
      Assert.assertTrue(e.getMessage().indexOf("illegal secondary index definition") >= 0);
    }
  }
  
  familyIndexAttributes = new String[]{"index_a:a", "index_a:a;index_a:b;index_b:a"};
  for (String indexAttribute : familyIndexAttributes) {
    desc.setValue(IndexMasterObserver.THEMIS_SECONDARY_INDEX_FAMILY_ATTRIBUTE_KEY, indexAttribute);
    IndexMasterObserver.checkIndexNames(desc);
  }
}