Author: pferraro
Date: 2009-01-21 23:11:30 -0500 (Wed, 21 Jan 2009)
New Revision: 2195
Removed:
trunk/mod_cluster/src/main/java/org/jboss/modcluster/mcmp/AddressPort.java
Modified:
trunk/mod_cluster/src/main/java/org/jboss/modcluster/DefaultJBossWebEventHandler.java
trunk/mod_cluster/src/main/java/org/jboss/modcluster/ha/ClusteredMCMPHandlerImpl.java
trunk/mod_cluster/src/main/java/org/jboss/modcluster/ha/HAModClusterService.java
trunk/mod_cluster/src/main/java/org/jboss/modcluster/ha/rpc/MCMPServerDiscoveryEvent.java
trunk/mod_cluster/src/main/java/org/jboss/modcluster/mcmp/AbstractMCMPHandler.java
trunk/mod_cluster/src/main/java/org/jboss/modcluster/mcmp/MCMPHandler.java
trunk/mod_cluster/src/main/java/org/jboss/modcluster/mcmp/MCMPUtils.java
trunk/mod_cluster/src/main/java/org/jboss/modcluster/mcmp/impl/DefaultMCMPHandler.java
trunk/mod_cluster/src/test/java/org/jboss/modcluster/DefaultJBossWebEventHandlerTestCase.java
trunk/mod_cluster/src/test/java/org/jboss/modcluster/ha/ClusteredMCMPHandlerTestCase.java
Log:
Replace AddressPort with InetSocketAddress
Modified:
trunk/mod_cluster/src/main/java/org/jboss/modcluster/DefaultJBossWebEventHandler.java
===================================================================
---
trunk/mod_cluster/src/main/java/org/jboss/modcluster/DefaultJBossWebEventHandler.java 2009-01-21
17:37:24 UTC (rev 2194)
+++
trunk/mod_cluster/src/main/java/org/jboss/modcluster/DefaultJBossWebEventHandler.java 2009-01-22
04:11:30 UTC (rev 2195)
@@ -23,6 +23,7 @@
package org.jboss.modcluster;
import java.io.IOException;
+import java.net.InetSocketAddress;
import java.util.List;
import org.apache.catalina.Container;
@@ -40,7 +41,6 @@
import org.jboss.modcluster.config.NodeConfiguration;
import org.jboss.modcluster.load.LoadBalanceFactorProvider;
import org.jboss.modcluster.load.LoadBalanceFactorProviderFactory;
-import org.jboss.modcluster.mcmp.AddressPort;
import org.jboss.modcluster.mcmp.MCMPHandler;
import org.jboss.modcluster.mcmp.MCMPRequest;
import org.jboss.modcluster.mcmp.MCMPUtils;
@@ -97,7 +97,7 @@
public synchronized void init()
{
- List<AddressPort> initialProxies =
MCMPUtils.parseProxies(this.mcmpConfig.getProxyList());
+ List<InetSocketAddress> initialProxies =
MCMPUtils.parseProxies(this.mcmpConfig.getProxyList());
this.mcmpHandler.init(initialProxies);
this.loadBalanceFactorProvider =
this.loadBalanceFactorProviderFactory.createLoadBalanceFactorProvider();
Modified:
trunk/mod_cluster/src/main/java/org/jboss/modcluster/ha/ClusteredMCMPHandlerImpl.java
===================================================================
---
trunk/mod_cluster/src/main/java/org/jboss/modcluster/ha/ClusteredMCMPHandlerImpl.java 2009-01-21
17:37:24 UTC (rev 2194)
+++
trunk/mod_cluster/src/main/java/org/jboss/modcluster/ha/ClusteredMCMPHandlerImpl.java 2009-01-22
04:11:30 UTC (rev 2195)
@@ -24,6 +24,7 @@
import java.io.IOException;
import java.net.InetAddress;
+import java.net.InetSocketAddress;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
@@ -47,7 +48,6 @@
import org.jboss.modcluster.ha.rpc.StringGroupRpcResponse;
import org.jboss.modcluster.ha.rpc.ThrowableGroupRpcResponse;
import org.jboss.modcluster.mcmp.AbstractMCMPHandler;
-import org.jboss.modcluster.mcmp.AddressPort;
import org.jboss.modcluster.mcmp.MCMPHandler;
import org.jboss.modcluster.mcmp.MCMPRequest;
import org.jboss.modcluster.mcmp.MCMPServer;
@@ -307,7 +307,7 @@
return ((StringGroupRpcResponse) response).getValue();
}
- public void init(List<AddressPort> initialProxies)
+ public void init(List<InetSocketAddress> initialProxies)
{
if (this.singleton.isMasterNode())
{
@@ -315,11 +315,11 @@
}
else
{
- this.localHandler.init(new ArrayList<AddressPort>());
+ this.localHandler.init(new ArrayList<InetSocketAddress>());
if (initialProxies != null)
{
- for (AddressPort proxy : initialProxies)
+ for (InetSocketAddress proxy : initialProxies)
{
this.sendDiscoveryEventToPartition(proxy.getAddress(), proxy.getPort(),
true);
}
@@ -426,8 +426,8 @@
private synchronized void sendDiscoveryEventToPartition(InetAddress address, int port,
boolean addition)
{
- AddressPort ap = new AddressPort(address, port);
- MCMPServerDiscoveryEvent event = new
MCMPServerDiscoveryEvent(this.serviceKeyProvider.getHAPartition().getClusterNode(), ap,
addition, this.discoveryEventIndex.incrementAndGet());
+ InetSocketAddress socketAddress = new InetSocketAddress(address, port);
+ MCMPServerDiscoveryEvent event = new
MCMPServerDiscoveryEvent(this.serviceKeyProvider.getHAPartition().getClusterNode(),
socketAddress, addition, this.discoveryEventIndex.incrementAndGet());
this.pendingDiscoveryEvents.add(event);
GroupRpcResponse response = this.rpcStub.mcmpServerDiscoveryEvent(event);
Modified:
trunk/mod_cluster/src/main/java/org/jboss/modcluster/ha/HAModClusterService.java
===================================================================
---
trunk/mod_cluster/src/main/java/org/jboss/modcluster/ha/HAModClusterService.java 2009-01-21
17:37:24 UTC (rev 2194)
+++
trunk/mod_cluster/src/main/java/org/jboss/modcluster/ha/HAModClusterService.java 2009-01-22
04:11:30 UTC (rev 2195)
@@ -23,6 +23,7 @@
package org.jboss.modcluster.ha;
import java.io.Serializable;
+import java.net.InetSocketAddress;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
@@ -72,7 +73,6 @@
import org.jboss.modcluster.ha.rpc.ThrowableGroupRpcResponse;
import org.jboss.modcluster.load.LoadBalanceFactorProvider;
import org.jboss.modcluster.load.LoadBalanceFactorProviderFactory;
-import org.jboss.modcluster.mcmp.AddressPort;
import org.jboss.modcluster.mcmp.MCMPHandler;
import org.jboss.modcluster.mcmp.MCMPRequest;
import org.jboss.modcluster.mcmp.MCMPServer;
@@ -532,15 +532,15 @@
synchronized (HAModClusterService.this.proxyChangeDigest)
{
- AddressPort ap = event.getMCMPServer();
+ InetSocketAddress socketAddress = event.getMCMPServer();
if (event.isAddition())
{
- this.coord.localHandler.addProxy(ap.getAddress(), ap.getPort());
+ this.coord.localHandler.addProxy(socketAddress.getAddress(),
socketAddress.getPort());
}
else
{
- this.coord.localHandler.removeProxy(ap.getAddress(), ap.getPort());
+ this.coord.localHandler.removeProxy(socketAddress.getAddress(),
socketAddress.getPort());
}
HAModClusterService.this.proxyChangeDigest.put(event.getSender(), event);
@@ -846,14 +846,14 @@
continue; // already processed it
}
- AddressPort ap = toCheck.getMCMPServer();
+ InetSocketAddress socketAddress = toCheck.getMCMPServer();
if (toCheck.isAddition())
{
- this.coord.localHandler.addProxy(ap.getAddress(), ap.getPort());
+ this.coord.localHandler.addProxy(socketAddress.getAddress(),
socketAddress.getPort());
}
else
{
- this.coord.localHandler.removeProxy(ap.getAddress(),
ap.getPort());
+ this.coord.localHandler.removeProxy(socketAddress.getAddress(),
socketAddress.getPort());
}
resync = true;
}
Modified:
trunk/mod_cluster/src/main/java/org/jboss/modcluster/ha/rpc/MCMPServerDiscoveryEvent.java
===================================================================
---
trunk/mod_cluster/src/main/java/org/jboss/modcluster/ha/rpc/MCMPServerDiscoveryEvent.java 2009-01-21
17:37:24 UTC (rev 2194)
+++
trunk/mod_cluster/src/main/java/org/jboss/modcluster/ha/rpc/MCMPServerDiscoveryEvent.java 2009-01-22
04:11:30 UTC (rev 2195)
@@ -23,11 +23,12 @@
package org.jboss.modcluster.ha.rpc;
import java.io.Serializable;
+import java.net.InetSocketAddress;
import net.jcip.annotations.Immutable;
import org.jboss.ha.framework.interfaces.ClusterNode;
-import org.jboss.modcluster.mcmp.AddressPort;
+import org.jboss.modcluster.mcmp.MCMPServer;
/**
* Event object indicating the discovery or requested removal of an
@@ -42,11 +43,11 @@
private static final long serialVersionUID = -4615651826967237065L;
private final ClusterNode sender;
- private final AddressPort mcmpServer;
+ private final InetSocketAddress mcmpServer;
private final boolean addition;
private final int eventIndex;
- public MCMPServerDiscoveryEvent(ClusterNode sender, AddressPort mcmpServer, boolean
addition, int eventIndex)
+ public MCMPServerDiscoveryEvent(ClusterNode sender, InetSocketAddress mcmpServer,
boolean addition, int eventIndex)
{
assert sender != null : "sender is null";
assert mcmpServer != null : "mcmpServer is null";
@@ -75,7 +76,7 @@
return this.sender;
}
- public AddressPort getMCMPServer()
+ public InetSocketAddress getMCMPServer()
{
return this.mcmpServer;
}
@@ -89,6 +90,4 @@
{
return this.eventIndex;
}
-
-
}
Modified:
trunk/mod_cluster/src/main/java/org/jboss/modcluster/mcmp/AbstractMCMPHandler.java
===================================================================
---
trunk/mod_cluster/src/main/java/org/jboss/modcluster/mcmp/AbstractMCMPHandler.java 2009-01-21
17:37:24 UTC (rev 2194)
+++
trunk/mod_cluster/src/main/java/org/jboss/modcluster/mcmp/AbstractMCMPHandler.java 2009-01-22
04:11:30 UTC (rev 2195)
@@ -22,6 +22,7 @@
package org.jboss.modcluster.mcmp;
import java.net.InetAddress;
+import java.net.InetSocketAddress;
import java.net.UnknownHostException;
/**
@@ -37,9 +38,9 @@
*/
public void addProxy(String address)
{
- AddressPort ap = MCMPUtils.parseAddressPort(address);
+ InetSocketAddress socketAddress = MCMPUtils.parseSocketAddress(address);
- this.addProxy(ap.getAddress(), ap.getPort());
+ this.addProxy(socketAddress.getAddress(), socketAddress.getPort());
}
/**
Deleted: trunk/mod_cluster/src/main/java/org/jboss/modcluster/mcmp/AddressPort.java
===================================================================
--- trunk/mod_cluster/src/main/java/org/jboss/modcluster/mcmp/AddressPort.java 2009-01-21
17:37:24 UTC (rev 2194)
+++ trunk/mod_cluster/src/main/java/org/jboss/modcluster/mcmp/AddressPort.java 2009-01-22
04:11:30 UTC (rev 2195)
@@ -1,81 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-
-package org.jboss.modcluster.mcmp;
-
-import java.io.Serializable;
-import java.net.InetAddress;
-
-/**
- * Simple data object encapsulating an InetAddress and a port.
- *
- * @author Brian Stansberry
- */
-public class AddressPort implements Serializable
-{
- /** The serialVersionUID */
- private static final long serialVersionUID = 3835532412744565879L;
-
- private final InetAddress address;
- private final int port;
-
- public AddressPort(InetAddress address, int port)
- {
- this.address = address;
- this.port = port;
- }
-
- public InetAddress getAddress()
- {
- return this.address;
- }
-
- public int getPort()
- {
- return this.port;
- }
-
- @Override
- public boolean equals(Object object)
- {
- if (!(object instanceof AddressPort)) return false;
-
- AddressPort ap = (AddressPort) object;
-
- return (this.port == ap.getPort()) && (((this.address != null) &&
(ap.address != null)) ? this.address.equals(ap.address) : (this.address == ap.address));
- }
-
- @Override
- public int hashCode()
- {
- int result = 17;
- result += 23 * (this.address == null ? 0 : this.address.hashCode());
- result += 23 * this.port;
- return result;
- }
-
- @Override
- public String toString()
- {
- return "AddressPort{" + this.address + ":" + this.port +
"}";
- }
-}
\ No newline at end of file
Modified: trunk/mod_cluster/src/main/java/org/jboss/modcluster/mcmp/MCMPHandler.java
===================================================================
--- trunk/mod_cluster/src/main/java/org/jboss/modcluster/mcmp/MCMPHandler.java 2009-01-21
17:37:24 UTC (rev 2194)
+++ trunk/mod_cluster/src/main/java/org/jboss/modcluster/mcmp/MCMPHandler.java 2009-01-22
04:11:30 UTC (rev 2195)
@@ -24,6 +24,7 @@
import java.io.IOException;
import java.net.InetAddress;
+import java.net.InetSocketAddress;
import java.util.List;
import java.util.Set;
@@ -36,7 +37,7 @@
public interface MCMPHandler
{
/** Initialize the handler with the given list of proxies */
- void init(List<AddressPort> initialProxies);
+ void init(List<InetSocketAddress> initialProxies);
/** Perform any shut down work. */
void shutdown();
Modified: trunk/mod_cluster/src/main/java/org/jboss/modcluster/mcmp/MCMPUtils.java
===================================================================
--- trunk/mod_cluster/src/main/java/org/jboss/modcluster/mcmp/MCMPUtils.java 2009-01-21
17:37:24 UTC (rev 2194)
+++ trunk/mod_cluster/src/main/java/org/jboss/modcluster/mcmp/MCMPUtils.java 2009-01-22
04:11:30 UTC (rev 2195)
@@ -23,6 +23,7 @@
package org.jboss.modcluster.mcmp;
import java.net.InetAddress;
+import java.net.InetSocketAddress;
import java.net.UnknownHostException;
import java.util.ArrayList;
import java.util.Collections;
@@ -372,11 +373,11 @@
return requests;
}
- public static AddressPort parseAddressPort(String addressPort)
+ public static InetSocketAddress parseSocketAddress(String addressPort)
{
try
{
- return parseAddressPort(addressPort, 0);
+ return parseSocketAddress(addressPort, 0);
}
catch (UnknownHostException e)
{
@@ -384,19 +385,19 @@
}
}
- public static List<AddressPort> parseProxies(String proxyList)
+ public static List<InetSocketAddress> parseProxies(String proxyList)
{
if ((proxyList == null) || (proxyList.length() == 0)) return
Collections.emptyList();
String[] tokens = proxyList.split(",");
- List<AddressPort> proxies = new ArrayList<AddressPort>(tokens.length);
+ List<InetSocketAddress> proxies = new
ArrayList<InetSocketAddress>(tokens.length);
for (String token: tokens)
{
try
{
- AddressPort addressPort = parseAddressPort(token.trim(), DEFAULT_PORT);
+ InetSocketAddress addressPort = parseSocketAddress(token.trim(),
DEFAULT_PORT);
proxies.add(addressPort);
}
@@ -409,7 +410,7 @@
return proxies;
}
- private static AddressPort parseAddressPort(String addressPort, int defaultPort)
throws UnknownHostException
+ private static InetSocketAddress parseSocketAddress(String addressPort, int
defaultPort) throws UnknownHostException
{
int pos = addressPort.indexOf(':');
boolean colonExists = (pos >= 0);
@@ -419,7 +420,7 @@
InetAddress inetAddress = (address != null) && (address.length() > 0) ?
InetAddress.getByName(address) : null;
- return new AddressPort(inetAddress, port);
+ return new InetSocketAddress(inetAddress, port);
}
/**
Modified:
trunk/mod_cluster/src/main/java/org/jboss/modcluster/mcmp/impl/DefaultMCMPHandler.java
===================================================================
---
trunk/mod_cluster/src/main/java/org/jboss/modcluster/mcmp/impl/DefaultMCMPHandler.java 2009-01-21
17:37:24 UTC (rev 2194)
+++
trunk/mod_cluster/src/main/java/org/jboss/modcluster/mcmp/impl/DefaultMCMPHandler.java 2009-01-22
04:11:30 UTC (rev 2195)
@@ -33,6 +33,7 @@
import java.io.Serializable;
import java.io.Writer;
import java.net.InetAddress;
+import java.net.InetSocketAddress;
import java.net.Socket;
import java.util.ArrayList;
import java.util.Collections;
@@ -60,7 +61,6 @@
import org.jboss.modcluster.Utils;
import org.jboss.modcluster.config.MCMPHandlerConfiguration;
import org.jboss.modcluster.mcmp.AbstractMCMPHandler;
-import org.jboss.modcluster.mcmp.AddressPort;
import org.jboss.modcluster.mcmp.MCMPHandler;
import org.jboss.modcluster.mcmp.MCMPRequest;
import org.jboss.modcluster.mcmp.MCMPServerState;
@@ -120,7 +120,7 @@
// ------------------------------------------------------------ MCMPHandler
- public void init(List<AddressPort> initialProxies)
+ public void init(List<InetSocketAddress> initialProxies)
{
Lock lock = this.proxiesLock.writeLock();
lock.lock();
@@ -129,7 +129,7 @@
{
if (initialProxies != null)
{
- for (AddressPort initialProxy: initialProxies)
+ for (InetSocketAddress initialProxy: initialProxies)
{
this.addProxyInternal(initialProxy.getAddress(), initialProxy.getPort());
}
Modified:
trunk/mod_cluster/src/test/java/org/jboss/modcluster/DefaultJBossWebEventHandlerTestCase.java
===================================================================
---
trunk/mod_cluster/src/test/java/org/jboss/modcluster/DefaultJBossWebEventHandlerTestCase.java 2009-01-21
17:37:24 UTC (rev 2194)
+++
trunk/mod_cluster/src/test/java/org/jboss/modcluster/DefaultJBossWebEventHandlerTestCase.java 2009-01-22
04:11:30 UTC (rev 2195)
@@ -23,6 +23,7 @@
import java.io.IOException;
import java.net.InetAddress;
+import java.net.InetSocketAddress;
import java.util.Collections;
import java.util.List;
import java.util.Map;
@@ -44,7 +45,6 @@
import org.jboss.modcluster.config.NodeConfiguration;
import org.jboss.modcluster.load.LoadBalanceFactorProvider;
import org.jboss.modcluster.load.LoadBalanceFactorProviderFactory;
-import org.jboss.modcluster.mcmp.AddressPort;
import org.jboss.modcluster.mcmp.MCMPHandler;
import org.jboss.modcluster.mcmp.MCMPRequest;
import org.jboss.modcluster.mcmp.MCMPRequestType;
@@ -87,7 +87,7 @@
// Test advertise = false
EasyMock.expect(this.mcmpConfig.getProxyList()).andReturn(localHostName);
- this.mcmpHandler.init(Collections.singletonList(new AddressPort(localAddress,
8000)));
+ this.mcmpHandler.init(Collections.singletonList(new InetSocketAddress(localAddress,
8000)));
EasyMock.expect(this.lbfProviderFactory.createLoadBalanceFactorProvider()).andReturn(this.lbfProvider);
@@ -104,7 +104,7 @@
// Test advertise = true
EasyMock.expect(this.mcmpConfig.getProxyList()).andReturn(localHostName);
- this.mcmpHandler.init(Collections.singletonList(new AddressPort(localAddress,
8000)));
+ this.mcmpHandler.init(Collections.singletonList(new InetSocketAddress(localAddress,
8000)));
EasyMock.expect(this.lbfProviderFactory.createLoadBalanceFactorProvider()).andReturn(this.lbfProvider);
@@ -125,7 +125,7 @@
// Test advertise = null, proxies configured
EasyMock.expect(this.mcmpConfig.getProxyList()).andReturn(localHostName);
- this.mcmpHandler.init(Collections.singletonList(new AddressPort(localAddress,
8000)));
+ this.mcmpHandler.init(Collections.singletonList(new InetSocketAddress(localAddress,
8000)));
EasyMock.expect(this.lbfProviderFactory.createLoadBalanceFactorProvider()).andReturn(this.lbfProvider);
@@ -142,7 +142,7 @@
// Test advertise = null, no proxies configured
EasyMock.expect(this.mcmpConfig.getProxyList()).andReturn(null);
- List<AddressPort> emptyList = Collections.emptyList();
+ List<InetSocketAddress> emptyList = Collections.emptyList();
this.mcmpHandler.init(emptyList);
@@ -186,7 +186,7 @@
EasyMock.expect(this.mcmpConfig.getProxyList()).andReturn(localHostName);
EasyMock.expect(this.lbfProviderFactory.createLoadBalanceFactorProvider()).andReturn(this.lbfProvider);
- this.mcmpHandler.init(Collections.singletonList(new AddressPort(localAddress,
8000)));
+ this.mcmpHandler.init(Collections.singletonList(new InetSocketAddress(localAddress,
8000)));
EasyMock.expect(this.mcmpConfig.getAdvertise()).andReturn(Boolean.TRUE);
Modified:
trunk/mod_cluster/src/test/java/org/jboss/modcluster/ha/ClusteredMCMPHandlerTestCase.java
===================================================================
---
trunk/mod_cluster/src/test/java/org/jboss/modcluster/ha/ClusteredMCMPHandlerTestCase.java 2009-01-21
17:37:24 UTC (rev 2194)
+++
trunk/mod_cluster/src/test/java/org/jboss/modcluster/ha/ClusteredMCMPHandlerTestCase.java 2009-01-22
04:11:30 UTC (rev 2195)
@@ -23,6 +23,7 @@
import java.io.IOException;
import java.net.InetAddress;
+import java.net.InetSocketAddress;
import java.net.UnknownHostException;
import java.util.ArrayList;
import java.util.Collections;
@@ -40,7 +41,6 @@
import org.jboss.modcluster.ha.rpc.GroupRpcResponseFilter;
import org.jboss.modcluster.ha.rpc.MCMPServerDiscoveryEvent;
import org.jboss.modcluster.ha.rpc.StringGroupRpcResponse;
-import org.jboss.modcluster.mcmp.AddressPort;
import org.jboss.modcluster.mcmp.MCMPHandler;
import org.jboss.modcluster.mcmp.MCMPRequest;
import org.jboss.modcluster.mcmp.MCMPRequestType;
@@ -90,7 +90,7 @@
int port = 0;
String key = "key";
- List<AddressPort> list = Collections.singletonList(new AddressPort(address,
port));
+ List<InetSocketAddress> list = Collections.singletonList(new
InetSocketAddress(address, port));
// Test master case
EasyMock.expect(this.singleton.isMasterNode()).andReturn(true);
@@ -105,7 +105,7 @@
EasyMock.reset(this.localHandler, this.singleton, this.keyProvider,
this.partition);
// Test non-master case
- Capture<List<AddressPort>> capturedList = new
Capture<List<AddressPort>>();
+ Capture<List<InetSocketAddress>> capturedList = new
Capture<List<InetSocketAddress>>();
Capture<Object[]> capturedEvents = new Capture<Object[]>();
EasyMock.expect(this.singleton.isMasterNode()).andReturn(false);