Skip to content

Commit

Permalink
Fix a few test failures which happened after testng upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
tristantarrant authored and galderz committed Mar 21, 2012
1 parent 5d64ebe commit 154433a
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,13 @@
import org.infinispan.commands.VisitableCommand;
import org.infinispan.context.InvocationContext;
import org.infinispan.interceptors.base.CommandInterceptor;
import org.infinispan.manager.EmbeddedCacheManager;
import org.infinispan.server.hotrod.HotRodServer;
import org.infinispan.test.MultipleCacheManagersTest;
import org.infinispan.test.TestingUtil;
import org.infinispan.test.fwk.TestCacheManagerFactory;
import org.infinispan.util.logging.Log;
import org.infinispan.util.logging.LogFactory;
import org.testng.annotations.AfterTest;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.Test;

import java.net.InetSocketAddress;
Expand All @@ -50,7 +49,7 @@
* @author Mircea.Markus@jboss.com
* @since 4.1
*/
@Test(testName = "client.hotrod.ClientConnectionPoolingTest")
@Test(testName = "client.hotrod.ClientConnectionPoolingTest", groups="functional")
public class ClientConnectionPoolingTest extends MultipleCacheManagersTest {

private static final Log log = LogFactory.getLog(ClientConnectionPoolingTest.class);
Expand Down Expand Up @@ -89,8 +88,8 @@ protected void createCacheManagers() throws Throwable {
c2 = TestCacheManagerFactory.createLocalCacheManager(false).getCache();
registerCacheManager(c1.getCacheManager(), c2.getCacheManager());

hotRodServer1 = TestHelper.startHotRodServer((EmbeddedCacheManager) c1.getCacheManager());
hotRodServer2 = TestHelper.startHotRodServer((EmbeddedCacheManager) c2.getCacheManager());
hotRodServer1 = TestHelper.startHotRodServer(c1.getCacheManager());
hotRodServer2 = TestHelper.startHotRodServer(c2.getCacheManager());

String servers = TestHelper.getServersString(hotRodServer1, hotRodServer2);
Properties hotrodClientConf = new Properties();
Expand Down Expand Up @@ -124,7 +123,7 @@ protected void createCacheManagers() throws Throwable {
hrServ2Addr = new InetSocketAddress("localhost", hotRodServer2.getPort());
}

@AfterTest(alwaysRun = true)
@AfterMethod(alwaysRun = true)
public void tearDown() throws ExecutionException, InterruptedException {
hotRodServer1.stop();
hotRodServer2.stop();
Expand All @@ -146,6 +145,7 @@ public void tearDown() throws ExecutionException, InterruptedException {
remoteCacheManager.stop();
}

@Test
public void testPropsCorrectlySet() {
assertEquals(2, connectionPool.getMaxActive());
assertEquals(8, connectionPool.getMaxTotal());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public class HeavyLoadConnectionPoolingTest extends SingleCacheManagerTest {
private RemoteCache<Object, Object> remoteCache;
private GenericKeyedObjectPool connectionPool;

@AfterMethod
@AfterMethod(alwaysRun=true)
@Override
protected void clearContent() {
}
Expand Down Expand Up @@ -84,14 +84,15 @@ protected EmbeddedCacheManager createCacheManager() throws Exception {
return cacheManager;
}

@AfterClass
@AfterClass(alwaysRun=true)
@Override
protected void destroyAfterClass() {
super.destroyAfterClass();
remoteCacheManager.stop();
hotRodServer.stop();
}

@Test(enabled=false)
public void testHeavyLoad() throws InterruptedException, ExecutionException {
List<WorkerThread> workers = new ArrayList<WorkerThread>();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ public abstract class HitsAwareCacheManagersTest extends MultipleCacheManagersTe
protected Map<InetSocketAddress, CacheContainer> hrServ2CacheManager = new HashMap<InetSocketAddress, CacheContainer>();
protected Map<InetSocketAddress, HotRodServer> addr2hrServer = new HashMap<InetSocketAddress, HotRodServer>();

@BeforeMethod
@Override
@BeforeMethod(alwaysRun=true)
public void createBeforeMethod() throws Throwable {
if (cleanupAfterMethod()) {
hrServ2CacheManager.clear();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
* @author Mircea.Markus@jboss.com
* @since 4.1
*/
@Test(testName = "client.hotrod.RoundRobinBalancingIntegrationTest")
@Test(testName = "client.hotrod.RoundRobinBalancingIntegrationTest", groups="functional")
public class RoundRobinBalancingIntegrationTest extends MultipleCacheManagersTest {

private static final Log log = LogFactory.getLog(RoundRobinBalancingIntegrationTest.class);
Expand Down Expand Up @@ -76,9 +76,9 @@ protected void createCacheManagers() throws Throwable {
c3 = TestCacheManagerFactory.createLocalCacheManager(false).getCache();
registerCacheManager(c1.getCacheManager(), c2.getCacheManager(), c3.getCacheManager());

hotRodServer1 = TestHelper.startHotRodServer((EmbeddedCacheManager) c1.getCacheManager());
hotRodServer2 = TestHelper.startHotRodServer((EmbeddedCacheManager) c2.getCacheManager());
hotRodServer3 = TestHelper.startHotRodServer((EmbeddedCacheManager) c3.getCacheManager());
hotRodServer1 = TestHelper.startHotRodServer(c1.getCacheManager());
hotRodServer2 = TestHelper.startHotRodServer(c2.getCacheManager());
hotRodServer3 = TestHelper.startHotRodServer(c3.getCacheManager());

log.trace("Server 1 port: " + hotRodServer1.getPort());
log.trace("Server 2 port: " + hotRodServer2.getPort());
Expand Down

0 comments on commit 154433a

Please sign in to comment.