Search in sources :

Example 1 with InfinispanBeanGroupKey

use of org.wildfly.clustering.ejb.infinispan.group.InfinispanBeanGroupKey in project wildfly by wildfly.

the class KeyMapperTestCase method test.

@Test
public void test() {
    TwoWayKey2StringMapper mapper = new KeyMapper();
    Assert.assertTrue(mapper.isSupportedType(InfinispanBeanKey.class));
    Assert.assertTrue(mapper.isSupportedType(InfinispanBeanGroupKey.class));
    Set<String> formatted = new HashSet<>();
    SessionID id = new UUIDSessionID(UUID.randomUUID());
    BeanKey<SessionID> beanKey = new InfinispanBeanKey<>(id);
    String formattedBeanKey = mapper.getStringMapping(beanKey);
    Assert.assertEquals(beanKey, mapper.getKeyMapping(formattedBeanKey));
    Assert.assertTrue(formatted.add(formattedBeanKey));
    BeanGroupKey<SessionID> beanGroupKey = new InfinispanBeanGroupKey<>(id);
    String formattedBeanGroupKey = mapper.getStringMapping(beanGroupKey);
    Assert.assertEquals(beanGroupKey, mapper.getKeyMapping(formattedBeanGroupKey));
    Assert.assertTrue(formatted.add(formattedBeanGroupKey));
}
Also used : TwoWayKey2StringMapper(org.infinispan.persistence.keymappers.TwoWayKey2StringMapper) UUIDSessionID(org.jboss.ejb.client.UUIDSessionID) InfinispanBeanKey(org.wildfly.clustering.ejb.infinispan.bean.InfinispanBeanKey) InfinispanBeanGroupKey(org.wildfly.clustering.ejb.infinispan.group.InfinispanBeanGroupKey) UUIDSessionID(org.jboss.ejb.client.UUIDSessionID) SessionID(org.jboss.ejb.client.SessionID) HashSet(java.util.HashSet) Test(org.junit.Test)

Aggregations

HashSet (java.util.HashSet)1 TwoWayKey2StringMapper (org.infinispan.persistence.keymappers.TwoWayKey2StringMapper)1 SessionID (org.jboss.ejb.client.SessionID)1 UUIDSessionID (org.jboss.ejb.client.UUIDSessionID)1 Test (org.junit.Test)1 InfinispanBeanKey (org.wildfly.clustering.ejb.infinispan.bean.InfinispanBeanKey)1 InfinispanBeanGroupKey (org.wildfly.clustering.ejb.infinispan.group.InfinispanBeanGroupKey)1