Skip to content

Commit

Permalink
Add workaround for WFCORE-1063
Browse files Browse the repository at this point in the history
  • Loading branch information
pferraro committed Oct 20, 2015
1 parent ab5b435 commit 36f5bd9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
Expand Up @@ -99,7 +99,8 @@ public DatagramSocket createDatagramSocket(String name) throws SocketException {

@Override
public DatagramSocket createDatagramSocket(String name, SocketAddress address) throws SocketException {
return this.manager.createDatagramSocket(name, address);
// Creating the socket using the name throws an ISE, See WFCORE-1063
return this.manager.createDatagramSocket(address);
}

@Override
Expand Down
Expand Up @@ -113,7 +113,7 @@ public void createServerSocket() throws IOException {
}

@Test
public void createDatagram() throws IOException {
public void createDatagramSocket() throws IOException {

DatagramSocket socket1 = mock(DatagramSocket.class);
DatagramSocket socket2 = mock(DatagramSocket.class);
Expand All @@ -122,10 +122,10 @@ public void createDatagram() throws IOException {
InetAddress localhost = InetAddress.getLocalHost();
SocketAddress socketAddress = new InetSocketAddress(localhost, 2);

when(this.manager.createDatagramSocket("test", new InetSocketAddress(0))).thenReturn(socket1);
when(this.manager.createDatagramSocket("test", new InetSocketAddress(1))).thenReturn(socket2);
when(this.manager.createDatagramSocket("test", socketAddress)).thenReturn(socket3);
when(this.manager.createDatagramSocket("test", new InetSocketAddress(localhost, 1))).thenReturn(socket4);
when(this.manager.createDatagramSocket(new InetSocketAddress(0))).thenReturn(socket1);
when(this.manager.createDatagramSocket(new InetSocketAddress(1))).thenReturn(socket2);
when(this.manager.createDatagramSocket(socketAddress)).thenReturn(socket3);
when(this.manager.createDatagramSocket(new InetSocketAddress(localhost, 1))).thenReturn(socket4);

DatagramSocket result1 = this.subject.createDatagramSocket("test");
DatagramSocket result2 = this.subject.createDatagramSocket("test", 1);
Expand Down

0 comments on commit 36f5bd9

Please sign in to comment.