Skip to content

Commit

Permalink
ISPN-3297 RemoteCaches cannot be assigned to BasicCaches anymore in t…
Browse files Browse the repository at this point in the history
…he CDI module
  • Loading branch information
tristantarrant authored and Mircea Markus committed Jul 5, 2013
1 parent dc194bc commit 87d3709
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 31 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package org.infinispan.cdi.test.cache.remote;

import org.infinispan.api.BasicCache;
import org.infinispan.cdi.Remote;
import org.infinispan.client.hotrod.RemoteCache;
import org.infinispan.client.hotrod.RemoteCacheManager;
Expand Down Expand Up @@ -46,7 +45,7 @@ public static Archive<?> deployment() {

@Inject
@Remote
private BasicCache<String, String> cache;
private RemoteCache<String, String> cache;

@Inject
private RemoteCache<String, String> remoteCache;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package org.infinispan.cdi.test.cache.remote;

import org.infinispan.api.BasicCache;
import org.infinispan.cdi.Remote;
import org.infinispan.client.hotrod.RemoteCache;
import org.infinispan.client.hotrod.RemoteCacheManager;
Expand Down Expand Up @@ -45,19 +44,11 @@ public static Archive<?> deployment() {

@Inject
@Remote("small")
private BasicCache<String, String> cache;

@Inject
@Remote("small")
private RemoteCache<String, String> remoteCache;

@Inject
@Small
private BasicCache<String, String> cacheWithQualifier;
private RemoteCache<String, String> cache;

@Inject
@Small
private RemoteCache<String, String> remoteCacheWithQualifier;
private RemoteCache<String, String> cacheWithQualifier;

@BeforeTest
public void beforeMethod() {
Expand All @@ -82,20 +73,12 @@ public void testNamedCache() {
assertEquals(cache.get("pete"), "British");
assertEquals(cache.get("manik"), "Sri Lankan");

assertEquals(remoteCache.getName(), "small");
assertEquals(remoteCache.get("pete"), "British");
assertEquals(remoteCache.get("manik"), "Sri Lankan");

// here we check that the cache injection with the @Small qualifier works
// like the injection with the @Remote qualifier

assertEquals(cacheWithQualifier.getName(), "small");
assertEquals(cacheWithQualifier.get("pete"), "British");
assertEquals(cacheWithQualifier.get("manik"), "Sri Lankan");

assertEquals(remoteCacheWithQualifier.getName(), "small");
assertEquals(remoteCacheWithQualifier.get("pete"), "British");
assertEquals(remoteCacheWithQualifier.get("manik"), "Sri Lankan");
}

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package org.infinispan.cdi.test.cache.remote;

import org.infinispan.api.BasicCache;
import org.infinispan.client.hotrod.RemoteCache;
import org.infinispan.client.hotrod.RemoteCacheManager;
import org.infinispan.manager.EmbeddedCacheManager;
Expand Down Expand Up @@ -44,11 +43,7 @@ public static Archive<?> deployment() {

@Inject
@Small
private BasicCache<String, String> cache;

@Inject
@Small
private RemoteCache<String, String> remoteCache;
private RemoteCache<String, String> cache;

@BeforeTest
public void beforeMethod() {
Expand All @@ -72,10 +67,6 @@ public void testSpecificCacheManager() {
assertEquals(cache.getName(), "small");
assertEquals(cache.get("pete"), "British");
assertEquals(cache.get("manik"), "Sri Lankan");

assertEquals(remoteCache.getName(), "small");
assertEquals(remoteCache.get("pete"), "British");
assertEquals(remoteCache.get("manik"), "Sri Lankan");
}

/**
Expand Down

0 comments on commit 87d3709

Please sign in to comment.