org.webpieces.webserver.test.MockServerChannel Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of http-webserver-test Show documentation
Show all versions of http-webserver-test Show documentation
The full webpieces server AS A library
package org.webpieces.webserver.test;
import java.net.InetSocketAddress;
import java.net.SocketAddress;
import java.nio.channels.ServerSocketChannel;
import java.util.concurrent.CompletableFuture;
import org.webpieces.nio.api.channels.TCPServerChannel;
import org.webpieces.nio.api.handlers.ConsumerFunc;
public class MockServerChannel implements TCPServerChannel {
private InetSocketAddress addr;
@Override
public void setReuseAddress(boolean b) {
}
@Override
public void setName(String string) {
}
@Override
public String getChannelId() {
return null;
}
@Override
public String getName() {
return null;
}
@Override
public CompletableFuture bind(SocketAddress addr) {
this.addr = (InetSocketAddress) addr;
return CompletableFuture.completedFuture(null);
}
@Override
public boolean isBlocking() {
return false;
}
@Override
public boolean isClosed() {
return false;
}
@Override
public boolean isBound() {
return false;
}
@Override
public InetSocketAddress getLocalAddress() {
return addr;
}
@Override
public void closeServerChannel() {
}
@Override
public void configure(ConsumerFunc methodToConfigure) {
}
@Override
public ServerSocketChannel getUnderlyingChannel() {
return null;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy