@Override
  protected void createCacheManagers() throws Throwable {
    // todo [anistor] initializing the server-side context in this way is a hack. normally this
    // should use the protobuf metadata registry
    MarshallerRegistration.registerMarshallers(
        SerializationContextHolder.getSerializationContext());

    // initialize client-side serialization context
    MarshallerRegistration.registerMarshallers(ProtoStreamMarshaller.getSerializationContext());

    ConfigurationBuilder builder =
        hotRodCacheConfiguration(getDefaultClusteredCacheConfig(CacheMode.REPL_SYNC, false));
    builder
        .transaction()
        .indexing()
        .enable()
        .indexLocalOnly(false)
        .addProperty(
            "default.directory_provider", "ram") // todo test with  "infinispan" provider too
        .addProperty("lucene_version", "LUCENE_CURRENT");

    builder.dataContainer().valueEquivalence(AnyEquivalence.getInstance()); // TODO [anistor] hacks!

    createHotRodServers(2, builder);
  }
  @Override
  protected EmbeddedCacheManager createCacheManager() throws Exception {
    org.infinispan.configuration.cache.ConfigurationBuilder builder =
        new org.infinispan.configuration.cache.ConfigurationBuilder();
    builder
        .dataContainer()
        .keyEquivalence(ByteArrayEquivalence.INSTANCE)
        .valueEquivalence(ByteArrayEquivalence.INSTANCE)
        .indexing()
        .index(Index.ALL)
        .addProperty("default.directory_provider", "ram")
        .addProperty("lucene_version", "LUCENE_CURRENT");

    return TestCacheManagerFactory.createCacheManager(builder);
  }
  @BeforeClass
  public static void beforeclass() {
    GlobalConfigurationBuilder globalConfigurationBuilder =
        new GlobalConfigurationBuilder().nonClusteredDefault();
    globalConfigurationBuilder.globalJmxStatistics().jmxDomain("infinispan-" + UUID.randomUUID());

    ConfigurationBuilder cacheConfiguration = new ConfigurationBuilder();
    cacheConfiguration.dataContainer().keyEquivalence(new AnyServerEquivalence());

    serverCache = new DefaultCacheManager(globalConfigurationBuilder.build());
    serverCache.defineConfiguration("sessions", cacheConfiguration.build());

    HotRodServerConfigurationBuilder hotRodServerConfigurationBuilder =
        new HotRodServerConfigurationBuilder();
    hotRodServerConfigurationBuilder.port(RemoteConfiguration.SERVER_PORT);

    server = new HotRodServer();
    server.start(hotRodServerConfigurationBuilder.build(), serverCache);
  }