org.fujion.test.MockServerContainer Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of fujion-test Show documentation
Show all versions of fujion-test Show documentation
Testing framework that includes mock classes for core components.
/*
* #%L
* fujion
* %%
* Copyright (C) 2008 - 2018 Regenstrief Institute, Inc.
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* #L%
*/
package org.fujion.test;
import java.io.IOException;
import java.net.URI;
import java.util.Collections;
import java.util.Set;
import javax.websocket.ClientEndpointConfig;
import javax.websocket.DeploymentException;
import javax.websocket.Endpoint;
import javax.websocket.Extension;
import javax.websocket.Session;
import javax.websocket.server.ServerContainer;
import javax.websocket.server.ServerEndpointConfig;
/**
* Mock server container.
*/
public class MockServerContainer implements ServerContainer {
private long defaultAsyncSendTimeout;
private long defaultMaxSessionIdleTimeout;
private int defaultMaxBinaryMessageBufferSize;
private int defaultMaxTextMessageBufferSize;
@Override
public long getDefaultAsyncSendTimeout() {
return defaultAsyncSendTimeout;
}
@Override
public void setAsyncSendTimeout(long timeout) {
defaultAsyncSendTimeout = timeout;
}
@Override
public Session connectToServer(Object endpoint, URI path) throws DeploymentException, IOException {
return null;
}
@Override
public Session connectToServer(Class> annotatedEndpointClass, URI path) throws DeploymentException, IOException {
return null;
}
@Override
public Session connectToServer(Endpoint endpoint, ClientEndpointConfig clientEndpointConfiguration,
URI path) throws DeploymentException, IOException {
return null;
}
@Override
public Session connectToServer(Class extends Endpoint> endpoint, ClientEndpointConfig clientEndpointConfiguration,
URI path) throws DeploymentException, IOException {
return null;
}
@Override
public long getDefaultMaxSessionIdleTimeout() {
return defaultMaxSessionIdleTimeout;
}
@Override
public void setDefaultMaxSessionIdleTimeout(long timeout) {
defaultMaxSessionIdleTimeout = timeout;
}
@Override
public int getDefaultMaxBinaryMessageBufferSize() {
return defaultMaxBinaryMessageBufferSize;
}
@Override
public void setDefaultMaxBinaryMessageBufferSize(int max) {
defaultMaxBinaryMessageBufferSize = max;
}
@Override
public int getDefaultMaxTextMessageBufferSize() {
return defaultMaxTextMessageBufferSize;
}
@Override
public void setDefaultMaxTextMessageBufferSize(int max) {
defaultMaxTextMessageBufferSize = max;
}
@Override
public Set getInstalledExtensions() {
return Collections.emptySet();
}
@Override
public void addEndpoint(Class> clazz) throws DeploymentException {
}
@Override
public void addEndpoint(ServerEndpointConfig sec) throws DeploymentException {
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy