Fix compile error when compiling on OS X
This commit is contained in:
parent
a7a32509c7
commit
f12dcc72d9
@ -12,7 +12,13 @@ public class ThrottleTest
|
|||||||
public void testThrottle() throws InterruptedException, UnknownHostException
|
public void testThrottle() throws InterruptedException, UnknownHostException
|
||||||
{
|
{
|
||||||
ConnectionThrottle throttle = new ConnectionThrottle( 5 );
|
ConnectionThrottle throttle = new ConnectionThrottle( 5 );
|
||||||
InetAddress address = InetAddress.getLocalHost();
|
InetAddress address;
|
||||||
|
|
||||||
|
try {
|
||||||
|
address = InetAddress.getLocalHost();
|
||||||
|
} catch (UnknownHostException ex) {
|
||||||
|
address = InetAddress.getByName( null );
|
||||||
|
}
|
||||||
|
|
||||||
Assert.assertFalse( "Address should not be throttled", throttle.throttle( address ) );
|
Assert.assertFalse( "Address should not be throttled", throttle.throttle( address ) );
|
||||||
Assert.assertTrue( "Address should be throttled", throttle.throttle( address ) );
|
Assert.assertTrue( "Address should be throttled", throttle.throttle( address ) );
|
||||||
|
Loading…
Reference in New Issue
Block a user