You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by se...@apache.org on 2014/06/29 18:01:07 UTC
svn commit: r1606530 -
/commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/remote/server/BasicRemoteCacheClientServerUnitTest.java
Author: sebb
Date: Sun Jun 29 16:01:06 2014
New Revision: 1606530
URL: http://svn.apache.org/r1606530
Log:
Add missing try/catch
Modified:
commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/remote/server/BasicRemoteCacheClientServerUnitTest.java
Modified: commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/remote/server/BasicRemoteCacheClientServerUnitTest.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/remote/server/BasicRemoteCacheClientServerUnitTest.java?rev=1606530&r1=1606529&r2=1606530&view=diff
==============================================================================
--- commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/remote/server/BasicRemoteCacheClientServerUnitTest.java (original)
+++ commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/remote/server/BasicRemoteCacheClientServerUnitTest.java Sun Jun 29 16:01:06 2014
@@ -71,24 +71,28 @@ public class BasicRemoteCacheClientServe
String configFile = "TestRemoteCacheClientServer.ccf";
server = RemoteCacheServerStartupUtil.startServerUsingProperties(configFile);
remotePort = server.remoteCacheServerAttributes.getRemotePort();
- // Add some debug to try and find out why test fails on Continuum
- InetAddress ina=InetAddress.getLocalHost();
- System.out.println("InetAddress.getLocalHost()="+ina);
- // Iterate all NICs (network interface cards)...
- for ( Enumeration<NetworkInterface> ifaces = NetworkInterface.getNetworkInterfaces(); ifaces.hasMoreElements(); )
- {
- NetworkInterface iface = ifaces.nextElement();
- // Iterate all IP addresses assigned to each card...
- for ( Enumeration<InetAddress> inetAddrs = iface.getInetAddresses(); inetAddrs.hasMoreElements(); )
+ try {
+ // Add some debug to try and find out why test fails on Continuum
+ InetAddress ina=InetAddress.getLocalHost();
+ System.out.println("InetAddress.getLocalHost()="+ina);
+ // Iterate all NICs (network interface cards)...
+ for ( Enumeration<NetworkInterface> ifaces = NetworkInterface.getNetworkInterfaces(); ifaces.hasMoreElements(); )
{
- InetAddress inetAddr = inetAddrs.nextElement();
- boolean loopbackAddress = inetAddr.isLoopbackAddress();
- boolean siteLocalAddress = inetAddr.isSiteLocalAddress();
- System.out.println("Found: "+ inetAddr +
- " isLoopback: " + loopbackAddress +
- " isSiteLocal: " + siteLocalAddress +
- ((!loopbackAddress && siteLocalAddress) ? " *" : ""));
+ NetworkInterface iface = ifaces.nextElement();
+ // Iterate all IP addresses assigned to each card...
+ for ( Enumeration<InetAddress> inetAddrs = iface.getInetAddresses(); inetAddrs.hasMoreElements(); )
+ {
+ InetAddress inetAddr = inetAddrs.nextElement();
+ boolean loopbackAddress = inetAddr.isLoopbackAddress();
+ boolean siteLocalAddress = inetAddr.isSiteLocalAddress();
+ System.out.println("Found: "+ inetAddr +
+ " isLoopback: " + loopbackAddress +
+ " isSiteLocal: " + siteLocalAddress +
+ ((!loopbackAddress && siteLocalAddress) ? " *" : ""));
+ }
}
+ } catch (Exception e) {
+ e.printStackTrace();
}
}
@@ -114,7 +118,7 @@ public class BasicRemoteCacheClientServe
@Test
public void test1SinglePut()
throws Exception
- {
+ {
// SETUP
MockCompositeCacheManager compositeCacheManager = new MockCompositeCacheManager();
@@ -151,7 +155,7 @@ public class BasicRemoteCacheClientServe
// VERIFY
assertEquals("Wrong element.", element.getVal(), result.getVal());
- }
+ }
/**
* Verify that we can remove an item via the remote server.
@@ -162,7 +166,7 @@ public class BasicRemoteCacheClientServe
@Test
public void test2PutRemove()
throws Exception
- {
+ {
// SETUP
MockCompositeCacheManager compositeCacheManager = new MockCompositeCacheManager();
@@ -209,7 +213,7 @@ public class BasicRemoteCacheClientServe
// VERIFY
assertNull("Element resultAfterRemote should be null.", resultAfterRemote);
- }
+ }
/**
* Register a listener with the server. Send an update. Verify that the listener received it.
@@ -219,7 +223,7 @@ public class BasicRemoteCacheClientServe
@Test
public void test3PutAndListen()
throws Exception
- {
+ {
// SETUP
MockCompositeCacheManager compositeCacheManager = new MockCompositeCacheManager();
@@ -259,7 +263,7 @@ public class BasicRemoteCacheClientServe
// remove from all regions.
server.removeCacheListener(listener);
}
- }
+ }
/**
* Register a listener with the server. Send an update. Verify that the listener received it.
@@ -269,7 +273,7 @@ public class BasicRemoteCacheClientServe
@Test
public void test4PutaMultipleAndListen()
throws Exception
- {
+ {
// SETUP
MockCompositeCacheManager compositeCacheManager = new MockCompositeCacheManager();
@@ -308,7 +312,7 @@ public class BasicRemoteCacheClientServe
System.out.println(server.getStats());
throw e;
}
- }
+ }
@Test
public void testLocalHost() throws Exception