diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fb9ad601e..57ed219ec 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,6 +17,7 @@ jobs: Test: runs-on: ubuntu-latest + timeout-minutes: 15 steps: - uses: actions/checkout@v3 - name: Set up JDK 17 diff --git a/CHANGELOG.md b/CHANGELOG.md index 6a2ace063..c0befabb8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,50 @@ # Change log +############################################################################### +## Version Release 1.5.7 (2024/07/08) + +#### Breaking Changes + +* [PR 1399](https://github.com/TooTallNate/Java-WebSocket/pull/1399) - Have connectBlocking clean up after a timeout + +#### Bugs Fixed + +* [PR 1419](https://github.com/TooTallNate/Java-WebSocket/pull/1419) - Fix issue #1418: WebSocketServer sometimes misses GET request after SSL handshake + +#### New Features + +* [PR 1407](https://github.com/TooTallNate/Java-WebSocket/pull/1407) - Allow setting custom TCP receive buffer size +* [PR 1399](https://github.com/TooTallNate/Java-WebSocket/pull/1399) - Have connectBlocking clean up after a timeout + +In this release 0 issues and 4 pull requests were closed. + +############################################################################### +## Version Release 1.5.6 (2024/02/06) + +#### Bugs Fixed + +* [Issue 1382](https://github.com/TooTallNate/Java-WebSocket/issues/1382) - WebSocketClient.upgradeSocketToSSL is enforcing TLS 1.2 ([PR 1387](https://github.com/TooTallNate/Java-WebSocket/pull/1387)) +* [PR 1387](https://github.com/TooTallNate/Java-WebSocket/pull/1387) - Retrieve default SSL socket factory + +#### New Features + +* [Issue 1390](https://github.com/TooTallNate/Java-WebSocket/issues/1390) - Thread created by NamedThreadFactory should be a daemon ([PR 1391](https://github.com/TooTallNate/Java-WebSocket/pull/1391)) +* [PR 1391](https://github.com/TooTallNate/Java-WebSocket/pull/1391) - Provide way to start the client/server as daemons + +In this release 2 issues and 2 pull requests were closed. + +############################################################################### + +## Version Release 1.5.5 (2023/12/18) + +#### Bugs Fixed + +* [Issue 1365](https://github.com/TooTallNate/Java-WebSocket/issues/1365) - Hang on reconnectBlocking +* [Issue 1364](https://github.com/TooTallNate/Java-WebSocket/issues/1364) - NPE during reconnect ([PR 1367](https://github.com/TooTallNate/Java-WebSocket/pull/1367)) +* [PR 1367](https://github.com/TooTallNate/Java-WebSocket/pull/1367) - Fix multiple issues related to reconnect + +In this release 2 issues and 1 pull request were closed. + ############################################################################### ## Version Release 1.5.4 (2023/07/20) diff --git a/README.markdown b/README.markdown index 152facd1f..3376ebc4c 100644 --- a/README.markdown +++ b/README.markdown @@ -30,7 +30,7 @@ To use maven add this dependency to your pom.xml: org.java-websocket Java-WebSocket - 1.5.4 + 1.5.7 ``` @@ -41,11 +41,11 @@ mavenCentral() ``` Then you can just add the latest version to your build. ```xml -compile "org.java-websocket:Java-WebSocket:1.5.4" +compile "org.java-websocket:Java-WebSocket:1.5.7" ``` Or this option if you use gradle 7.0 and above. ```xml -implementation 'org.java-websocket:Java-WebSocket:1.5.4' +implementation 'org.java-websocket:Java-WebSocket:1.5.7' ``` #### Logging @@ -114,7 +114,7 @@ Minimum Required JDK `Java-WebSocket` is known to work with: - * Java 1.7 and higher + * Java 8 and higher Other JRE implementations may work as well, but haven't been tested. diff --git a/build.gradle b/build.gradle index c0eb210aa..29dcc51b0 100644 --- a/build.gradle +++ b/build.gradle @@ -10,9 +10,9 @@ repositories { } group = 'org.java-websocket' -version = '1.5.4-SNAPSHOT' -sourceCompatibility = 1.7 -targetCompatibility = 1.7 +version = '1.6.0-SNAPSHOT' +sourceCompatibility = 1.8 +targetCompatibility = 1.8 compileJava { options.compilerArgs += ['-encoding', 'UTF-8'] @@ -35,8 +35,7 @@ publishing { } dependencies { - implementation group: 'org.slf4j', name: 'slf4j-api', version: '2.0.6' - testImplementation group: 'org.slf4j', name: 'slf4j-simple', version: '2.0.6' - testImplementation group: 'junit', name: 'junit', version: '4.12' - testImplementation group: 'org.json', name: 'json', version: '20180813' + implementation group: 'org.slf4j', name: 'slf4j-api', version: '2.0.13' + testImplementation group: 'org.slf4j', name: 'slf4j-simple', version: '2.0.13' + testImplementation group: 'junit', name: 'junit', version: '4.13.1' } diff --git a/pom.xml b/pom.xml index f5dd46c16..73c093ae9 100644 --- a/pom.xml +++ b/pom.xml @@ -5,17 +5,16 @@ org.java-websocket Java-WebSocket jar - 1.5.5-SNAPSHOT + 1.6.0-SNAPSHOT Java-WebSocket A barebones WebSocket client and server implementation written 100% in Java https://github.com/TooTallNate/Java-WebSocket UTF-8 - 2.0.6 + 2.0.13 - 4.12 - 20180813 + 4.13.1 6.4.0 @@ -63,12 +62,6 @@ ${junit.version} test - - org.json - json - ${org.json.version} - test - @@ -299,11 +292,6 @@ junit test - - org.json - json - test - diff --git a/src/main/java/org/java_websocket/AbstractWebSocket.java b/src/main/java/org/java_websocket/AbstractWebSocket.java index c3e77a089..bbb1dc8f0 100644 --- a/src/main/java/org/java_websocket/AbstractWebSocket.java +++ b/src/main/java/org/java_websocket/AbstractWebSocket.java @@ -90,11 +90,30 @@ public abstract class AbstractWebSocket extends WebSocketAdapter { */ private boolean websocketRunning = false; + /** + * Attribute to start internal threads as daemon + * + * @since 1.5.6 + */ + private boolean daemon = false; + /** * Attribute to sync on */ private final Object syncConnectionLost = new Object(); + /** + * TCP receive buffer size that will be used for sockets (zero means use system default) + * + * @since 1.5.7 + */ + private int receiveBufferSize = 0; + + /** + * Used for internal buffer allocations when the socket buffer size is not specified. + */ + protected static int DEFAULT_READ_BUFFER_SIZE = 65536; + /** * Get the interval checking for lost connections Default is 60 seconds * @@ -182,7 +201,7 @@ protected void startConnectionLostTimer() { private void restartConnectionLostTimer() { cancelConnectionLostTimer(); connectionLostCheckerService = Executors - .newSingleThreadScheduledExecutor(new NamedThreadFactory("connectionLostChecker")); + .newSingleThreadScheduledExecutor(new NamedThreadFactory("connectionLostChecker", daemon)); Runnable connectionLostChecker = new Runnable() { /** @@ -308,4 +327,50 @@ public void setReuseAddr(boolean reuseAddr) { this.reuseAddr = reuseAddr; } + + /** + * Getter for daemon + * + * @return whether internal threads are spawned in daemon mode + * @since 1.5.6 + */ + public boolean isDaemon() { + return daemon; + } + + /** + * Setter for daemon + *

+ * Controls whether or not internal threads are spawned in daemon mode + * + * @since 1.5.6 + */ + public void setDaemon(boolean daemon) { + this.daemon = daemon; + } + + /** + * Returns the TCP receive buffer size that will be used for sockets (or zero, if not explicitly set). + * @see java.net.Socket#setReceiveBufferSize(int) + * + * @since 1.5.7 + */ + public int getReceiveBufferSize() { + return receiveBufferSize; + } + + /** + * Sets the TCP receive buffer size that will be used for sockets. + * If this is not explicitly set (or set to zero), the system default is used. + * @see java.net.Socket#setReceiveBufferSize(int) + * + * @since 1.5.7 + */ + public void setReceiveBufferSize(int receiveBufferSize) { + if (receiveBufferSize < 0) { + throw new IllegalArgumentException("buffer size < 0"); + } + this.receiveBufferSize = receiveBufferSize; + } + } diff --git a/src/main/java/org/java_websocket/SSLSocketChannel2.java b/src/main/java/org/java_websocket/SSLSocketChannel2.java index c0ea28e3f..23c4f8af1 100644 --- a/src/main/java/org/java_websocket/SSLSocketChannel2.java +++ b/src/main/java/org/java_websocket/SSLSocketChannel2.java @@ -126,7 +126,7 @@ public SSLSocketChannel2(SocketChannel channel, SSLEngine sslEngine, ExecutorSer createBuffers(sslEngine.getSession()); // kick off handshake socketChannel.write(wrap(emptybuffer));// initializes res - processHandshake(); + processHandshake(false); } private void consumeFutureUninterruptible(Future f) { @@ -148,7 +148,7 @@ private void consumeFutureUninterruptible(Future f) { * This method will do whatever necessary to process the sslEngine handshake. Thats why it's * called both from the {@link #read(ByteBuffer)} and {@link #write(ByteBuffer)} **/ - private synchronized void processHandshake() throws IOException { + private synchronized void processHandshake(boolean isReading) throws IOException { if (sslEngine.getHandshakeStatus() == HandshakeStatus.NOT_HANDSHAKING) { return; // since this may be called either from a reading or a writing thread and because this method is synchronized it is necessary to double check if we are still handshaking. } @@ -167,7 +167,7 @@ private synchronized void processHandshake() throws IOException { } } - if (sslEngine.getHandshakeStatus() == SSLEngineResult.HandshakeStatus.NEED_UNWRAP) { + if (isReading && sslEngine.getHandshakeStatus() == SSLEngineResult.HandshakeStatus.NEED_UNWRAP) { if (!isBlocking() || readEngineResult.getStatus() == Status.BUFFER_UNDERFLOW) { inCrypt.compact(); int read = socketChannel.read(inCrypt); @@ -273,7 +273,7 @@ protected void createBuffers(SSLSession session) { public int write(ByteBuffer src) throws IOException { if (!isHandShakeComplete()) { - processHandshake(); + processHandshake(false); return 0; } // assert(bufferallocations > 1); // see #190 @@ -303,10 +303,10 @@ public int read(ByteBuffer dst) throws IOException { if (!isHandShakeComplete()) { if (isBlocking()) { while (!isHandShakeComplete()) { - processHandshake(); + processHandshake(true); } } else { - processHandshake(); + processHandshake(true); if (!isHandShakeComplete()) { return 0; } diff --git a/src/main/java/org/java_websocket/WebSocketAdapter.java b/src/main/java/org/java_websocket/WebSocketAdapter.java index e60215f8c..d06ca6f91 100644 --- a/src/main/java/org/java_websocket/WebSocketAdapter.java +++ b/src/main/java/org/java_websocket/WebSocketAdapter.java @@ -99,7 +99,7 @@ public void onWebsocketPong(WebSocket conn, Framedata f) { * Default implementation for onPreparePing, returns a (cached) PingFrame that has no application * data. * - * @param conn The WebSocket connection from which the ping frame will be sent. + * @param conn The WebSocket connection from which the ping frame will be sent. * @return PingFrame to be sent. * @see org.java_websocket.WebSocketListener#onPreparePing(WebSocket) */ diff --git a/src/main/java/org/java_websocket/WebSocketImpl.java b/src/main/java/org/java_websocket/WebSocketImpl.java index c2cd223b9..3289aefcf 100644 --- a/src/main/java/org/java_websocket/WebSocketImpl.java +++ b/src/main/java/org/java_websocket/WebSocketImpl.java @@ -85,11 +85,6 @@ public class WebSocketImpl implements WebSocket { */ public static final int DEFAULT_WSS_PORT = 443; - /** - * Initial buffer size - */ - public static final int RCVBUF = 16384; - /** * Logger instance * diff --git a/src/main/java/org/java_websocket/WebSocketListener.java b/src/main/java/org/java_websocket/WebSocketListener.java index 6d2bfdd92..f0b21d526 100644 --- a/src/main/java/org/java_websocket/WebSocketListener.java +++ b/src/main/java/org/java_websocket/WebSocketListener.java @@ -38,8 +38,8 @@ import org.java_websocket.handshake.ServerHandshakeBuilder; /** - * Implemented by WebSocketClient and WebSocketServer. The methods within are - * called by WebSocket. Almost every method takes a first parameter conn which represents + * Implemented by WebSocketClient and WebSocketServer. The methods within are + * called by WebSocket. Almost every method takes a first parameter conn which represents * the source of the respective event. */ public interface WebSocketListener { @@ -86,7 +86,7 @@ void onWebsocketHandshakeSentAsClient(WebSocket conn, ClientHandshake request) /** * Called when an entire text frame has been received. Do whatever you want here... * - * @param conn The WebSocket instance this event is occurring on. + * @param conn The WebSocket instance this event is occurring on. * @param message The UTF-8 decoded message that was received. */ void onWebsocketMessage(WebSocket conn, String message); @@ -94,7 +94,7 @@ void onWebsocketHandshakeSentAsClient(WebSocket conn, ClientHandshake request) /** * Called when an entire binary frame has been received. Do whatever you want here... * - * @param conn The WebSocket instance this event is occurring on. + * @param conn The WebSocket instance this event is occurring on. * @param blob The binary message that was received. */ void onWebsocketMessage(WebSocket conn, ByteBuffer blob); @@ -103,16 +103,16 @@ void onWebsocketHandshakeSentAsClient(WebSocket conn, ClientHandshake request) * Called after onHandshakeReceived returns true. Indicates that a complete * WebSocket connection has been established, and we are ready to send/receive data. * - * @param conn The WebSocket instance this event is occurring on. + * @param conn The WebSocket instance this event is occurring on. * @param d The handshake of the websocket instance */ void onWebsocketOpen(WebSocket conn, Handshakedata d); /** - * Called after WebSocket#close is explicity called, or when the other end of the + * Called after WebSocket#close is explicity called, or when the other end of the * WebSocket connection is closed. * - * @param ws The WebSocket instance this event is occurring on. + * @param ws The WebSocket instance this event is occurring on. * @param code The codes can be looked up here: {@link CloseFrame} * @param reason Additional information string * @param remote Returns whether or not the closing of the connection was initiated by the remote @@ -123,7 +123,7 @@ void onWebsocketHandshakeSentAsClient(WebSocket conn, ClientHandshake request) /** * Called as soon as no further frames are accepted * - * @param ws The WebSocket instance this event is occurring on. + * @param ws The WebSocket instance this event is occurring on. * @param code The codes can be looked up here: {@link CloseFrame} * @param reason Additional information string * @param remote Returns whether or not the closing of the connection was initiated by the remote @@ -134,7 +134,7 @@ void onWebsocketHandshakeSentAsClient(WebSocket conn, ClientHandshake request) /** * send when this peer sends a close handshake * - * @param ws The WebSocket instance this event is occurring on. + * @param ws The WebSocket instance this event is occurring on. * @param code The codes can be looked up here: {@link CloseFrame} * @param reason Additional information string */ @@ -144,7 +144,7 @@ void onWebsocketHandshakeSentAsClient(WebSocket conn, ClientHandshake request) * Called if an exception worth noting occurred. If an error causes the connection to fail onClose * will be called additionally afterwards. * - * @param conn The WebSocket instance this event is occurring on. + * @param conn The WebSocket instance this event is occurring on. * @param ex The exception that occurred.
Might be null if the exception is not related to * any specific connection. For example if the server port could not be bound. */ @@ -153,7 +153,7 @@ void onWebsocketHandshakeSentAsClient(WebSocket conn, ClientHandshake request) /** * Called a ping frame has been received. This method must send a corresponding pong by itself. * - * @param conn The WebSocket instance this event is occurring on. + * @param conn The WebSocket instance this event is occurring on. * @param f The ping frame. Control frames may contain payload. */ void onWebsocketPing(WebSocket conn, Framedata f); @@ -162,7 +162,7 @@ void onWebsocketHandshakeSentAsClient(WebSocket conn, ClientHandshake request) * Called just before a ping frame is sent, in order to allow users to customize their ping frame * data. * - * @param conn The WebSocket connection from which the ping frame will be sent. + * @param conn The WebSocket connection from which the ping frame will be sent. * @return PingFrame to be sent. */ PingFrame onPreparePing(WebSocket conn); @@ -170,7 +170,7 @@ void onWebsocketHandshakeSentAsClient(WebSocket conn, ClientHandshake request) /** * Called when a pong frame is received. * - * @param conn The WebSocket instance this event is occurring on. + * @param conn The WebSocket instance this event is occurring on. * @param f The pong frame. Control frames may contain payload. **/ void onWebsocketPong(WebSocket conn, Framedata f); @@ -179,19 +179,19 @@ void onWebsocketHandshakeSentAsClient(WebSocket conn, ClientHandshake request) * This method is used to inform the selector thread that there is data queued to be written to * the socket. * - * @param conn The WebSocket instance this event is occurring on. + * @param conn The WebSocket instance this event is occurring on. */ void onWriteDemand(WebSocket conn); /** - * @param conn The WebSocket instance this event is occurring on. + * @param conn The WebSocket instance this event is occurring on. * @return Returns the address of the endpoint this socket is bound to. * @see WebSocket#getLocalSocketAddress() */ InetSocketAddress getLocalSocketAddress(WebSocket conn); /** - * @param conn The WebSocket instance this event is occurring on. + * @param conn The WebSocket instance this event is occurring on. * @return Returns the address of the endpoint this socket is connected to, or{@code null} if it * is unconnected. * @see WebSocket#getRemoteSocketAddress() diff --git a/src/main/java/org/java_websocket/client/WebSocketClient.java b/src/main/java/org/java_websocket/client/WebSocketClient.java index 4277c2209..1ac2df071 100644 --- a/src/main/java/org/java_websocket/client/WebSocketClient.java +++ b/src/main/java/org/java_websocket/client/WebSocketClient.java @@ -45,7 +45,6 @@ import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; import javax.net.SocketFactory; -import javax.net.ssl.SSLContext; import javax.net.ssl.SSLException; import javax.net.ssl.SSLParameters; import javax.net.ssl.SSLSession; @@ -340,13 +339,21 @@ private void reset() { "You cannot initialize a reconnect out of the websocket thread. Use reconnect in another thread to ensure a successful cleanup."); } try { + // This socket null check ensures we can reconnect a socket that failed to connect. It's an uncommon edge case, but we want to make sure we support it + if (engine.getReadyState() == ReadyState.NOT_YET_CONNECTED && socket != null) { + // Closing the socket when we have not connected prevents the writeThread from hanging on a write indefinitely during connection teardown + socket.close(); + } closeBlocking(); + if (writeThread != null) { this.writeThread.interrupt(); + this.writeThread.join(); this.writeThread = null; } if (connectReadThread != null) { this.connectReadThread.interrupt(); + this.connectReadThread.join(); this.connectReadThread = null; } this.draft.reset(); @@ -372,6 +379,7 @@ public void connect() { throw new IllegalStateException("WebSocketClient objects are not reuseable"); } connectReadThread = new Thread(this); + connectReadThread.setDaemon(isDaemon()); connectReadThread.setName("WebSocketConnectReadThread-" + connectReadThread.getId()); connectReadThread.start(); } @@ -399,7 +407,13 @@ public boolean connectBlocking() throws InterruptedException { */ public boolean connectBlocking(long timeout, TimeUnit timeUnit) throws InterruptedException { connect(); - return connectLatch.await(timeout, timeUnit) && engine.isOpen(); + + boolean connected = connectLatch.await(timeout, timeUnit); + if (!connected) { + reset(); + } + + return connected && engine.isOpen(); } /** @@ -467,6 +481,10 @@ public void run() { socket.setTcpNoDelay(isTcpNoDelay()); socket.setReuseAddress(isReuseAddr()); + int receiveBufferSize = getReceiveBufferSize(); + if (receiveBufferSize > 0) { + socket.setReceiveBufferSize(receiveBufferSize); + } if (!socket.isConnected()) { InetSocketAddress addr = dnsResolver == null ? InetSocketAddress.createUnresolved(uri.getHost(), getPort()) : new InetSocketAddress(dnsResolver.resolve(uri), this.getPort()); @@ -505,10 +523,20 @@ public void run() { throw e; } + if (writeThread != null) { + writeThread.interrupt(); + try { + writeThread.join(); + } catch (InterruptedException e) { + /* ignore */ + } + } writeThread = new Thread(new WebsocketWriteThread(this)); + writeThread.setDaemon(isDaemon()); writeThread.start(); - byte[] rawbuffer = new byte[WebSocketImpl.RCVBUF]; + int receiveBufferSize = getReceiveBufferSize(); + byte[] rawbuffer = new byte[receiveBufferSize > 0 ? receiveBufferSize : DEFAULT_READ_BUFFER_SIZE]; int readBytes; try { @@ -523,7 +551,6 @@ public void run() { onError(e); engine.closeConnection(CloseFrame.ABNORMAL_CLOSE, e.getMessage()); } - connectReadThread = null; } private void upgradeSocketToSSL() @@ -534,9 +561,7 @@ private void upgradeSocketToSSL() if (socketFactory instanceof SSLSocketFactory) { factory = (SSLSocketFactory) socketFactory; } else { - SSLContext sslContext = SSLContext.getInstance("TLSv1.2"); - sslContext.init(null, null, null); - factory = sslContext.getSocketFactory(); + factory = (SSLSocketFactory) SSLSocketFactory.getDefault(); } socket = factory.createSocket(socket, uri.getHost(), getPort(), true); } @@ -801,7 +826,6 @@ public void run() { handleIOException(e); } finally { closeSocket(); - writeThread = null; } } diff --git a/src/main/java/org/java_websocket/server/WebSocketServer.java b/src/main/java/org/java_websocket/server/WebSocketServer.java index bb8178c25..e4f8790ee 100644 --- a/src/main/java/org/java_websocket/server/WebSocketServer.java +++ b/src/main/java/org/java_websocket/server/WebSocketServer.java @@ -71,7 +71,7 @@ import org.slf4j.LoggerFactory; /** - * WebSocketServer is an abstract class that only takes care of the + * WebSocketServer is an abstract class that only takes care of the * HTTP handshake portion of WebSockets. It's up to a subclass to add functionality/purpose to the * server. */ @@ -183,7 +183,7 @@ public WebSocketServer(InetSocketAddress address, int decodercount, List /** * Creates a WebSocketServer that will attempt to bind/listen on the given address, and - * comply with Draft version draft. + * comply with Draft version draft. * * @param address The address (host:port) this server should listen on. * @param decodercount The number of {@link WebSocketWorker}s that will be used to process @@ -245,7 +245,9 @@ public void start() { if (selectorthread != null) { throw new IllegalStateException(getClass().getName() + " can only be started once."); } - new Thread(this).start(); + Thread t = new Thread(this); + t.setDaemon(isDaemon()); + t.start(); } public void stop(int timeout) throws InterruptedException { @@ -326,6 +328,20 @@ public int getPort() { return port; } + @Override + public void setDaemon(boolean daemon) { + // pass it to the AbstractWebSocket too, to use it on the connectionLostChecker thread factory + super.setDaemon(daemon); + // we need to apply this to the decoders as well since they were created during the constructor + for (WebSocketWorker w : decoders) { + if (w.isAlive()) { + throw new IllegalStateException("Cannot call setDaemon after server is already started!"); + } else { + w.setDaemon(daemon); + } + } + } + /** * Get the list of active drafts * @@ -562,7 +578,10 @@ private boolean doSetupSelectorAndServerThread() { server = ServerSocketChannel.open(); server.configureBlocking(false); ServerSocket socket = server.socket(); - socket.setReceiveBufferSize(WebSocketImpl.RCVBUF); + int receiveBufferSize = getReceiveBufferSize(); + if (receiveBufferSize > 0) { + socket.setReceiveBufferSize(receiveBufferSize); + } socket.setReuseAddress(isReuseAddr()); socket.bind(address, getMaxPendingConnections()); selector = Selector.open(); @@ -639,7 +658,8 @@ protected void releaseBuffers(WebSocket c) throws InterruptedException { } public ByteBuffer createBuffer() { - return ByteBuffer.allocate(WebSocketImpl.RCVBUF); + int receiveBufferSize = getReceiveBufferSize(); + return ByteBuffer.allocate(receiveBufferSize > 0 ? receiveBufferSize : DEFAULT_READ_BUFFER_SIZE); } protected void queue(WebSocketImpl ws) throws InterruptedException { @@ -872,7 +892,7 @@ public InetSocketAddress getRemoteSocketAddress(WebSocket conn) { * Called after an opening handshake has been performed and the given websocket is ready to be * written on. * - * @param conn The WebSocket instance this event is occurring on. + * @param conn The WebSocket instance this event is occurring on. * @param handshake The handshake of the websocket instance */ public abstract void onOpen(WebSocket conn, ClientHandshake handshake); @@ -880,7 +900,7 @@ public InetSocketAddress getRemoteSocketAddress(WebSocket conn) { /** * Called after the websocket connection has been closed. * - * @param conn The WebSocket instance this event is occurring on. + * @param conn The WebSocket instance this event is occurring on. * @param code The codes can be looked up here: {@link CloseFrame} * @param reason Additional information string * @param remote Returns whether or not the closing of the connection was initiated by the remote @@ -891,7 +911,7 @@ public InetSocketAddress getRemoteSocketAddress(WebSocket conn) { /** * Callback for string messages received from the remote host * - * @param conn The WebSocket instance this event is occurring on. + * @param conn The WebSocket instance this event is occurring on. * @param message The UTF-8 decoded message that was received. * @see #onMessage(WebSocket, ByteBuffer) **/ @@ -919,7 +939,7 @@ public InetSocketAddress getRemoteSocketAddress(WebSocket conn) { /** * Callback for binary messages received from the remote host * - * @param conn The WebSocket instance this event is occurring on. + * @param conn The WebSocket instance this event is occurring on. * @param message The binary message that was received. * @see #onMessage(WebSocket, ByteBuffer) **/ diff --git a/src/main/java/org/java_websocket/util/Base64.java b/src/main/java/org/java_websocket/util/Base64.java index e9ff7b87a..067a027e1 100644 --- a/src/main/java/org/java_websocket/util/Base64.java +++ b/src/main/java/org/java_websocket/util/Base64.java @@ -35,7 +35,7 @@ *
* byte[] myByteArray = Base64.decode( encoded ); * - *

The options parameter, which appears in a few places, is used to pass + *

The options parameter, which appears in a few places, is used to pass * several pieces of information to the encoder. In the "higher level" methods such as encodeBytes( * bytes, options ) the options parameter can be used to indicate such things as first gzipping the * bytes before encoding them, not inserting linefeeds, and encoding using the URL-safe and Ordered @@ -140,9 +140,9 @@ * when data that's being decoded is gzip-compressed and will decompress it * automatically. Generally things are cleaner. You'll probably have to * change some method calls that you were making to support the new - * options format (ints that you "OR" together). + * options format (ints that you "OR" together). *

  • v1.5.1 - Fixed bug when decompressing and decoding to a - * byte[] using decode( String s, boolean gzipCompressed ). + * byte[] using decode( String s, boolean gzipCompressed ). * Added the ability to "suspend" encoding in the Output Stream so * you can turn on and off the encoding if you need to embed base64 * data in an otherwise "normal" stream (like an XML file).
  • @@ -873,7 +873,7 @@ else if (source[srcOffset + 3] == EQUALS_SIGN) { /** * A {@link Base64.OutputStream} will write data to another - * java.io.OutputStream, given in the constructor, + * java.io.OutputStream, given in the constructor, * and encode/decode to/from Base64 notation on the fly. * * @see Base64 @@ -895,7 +895,7 @@ public static class OutputStream extends java.io.FilterOutputStream { /** * Constructs a {@link Base64.OutputStream} in ENCODE mode. * - * @param out the java.io.OutputStream to which data will be written. + * @param out the java.io.OutputStream to which data will be written. * @since 1.3 */ public OutputStream(java.io.OutputStream out) { @@ -914,7 +914,7 @@ public OutputStream(java.io.OutputStream out) { *

    * Example: new Base64.OutputStream( out, Base64.ENCODE ) * - * @param out the java.io.OutputStream to which data will be written. + * @param out the java.io.OutputStream to which data will be written. * @param options Specified options. * @see Base64#ENCODE * @see Base64#DO_BREAK_LINES diff --git a/src/main/java/org/java_websocket/util/NamedThreadFactory.java b/src/main/java/org/java_websocket/util/NamedThreadFactory.java index 2a424fe1a..19091c01c 100644 --- a/src/main/java/org/java_websocket/util/NamedThreadFactory.java +++ b/src/main/java/org/java_websocket/util/NamedThreadFactory.java @@ -34,14 +34,22 @@ public class NamedThreadFactory implements ThreadFactory { private final ThreadFactory defaultThreadFactory = Executors.defaultThreadFactory(); private final AtomicInteger threadNumber = new AtomicInteger(1); private final String threadPrefix; + private final boolean daemon; public NamedThreadFactory(String threadPrefix) { this.threadPrefix = threadPrefix; + this.daemon = false; + } + + public NamedThreadFactory(String threadPrefix, boolean daemon) { + this.threadPrefix = threadPrefix; + this.daemon = daemon; } @Override public Thread newThread(Runnable runnable) { Thread thread = defaultThreadFactory.newThread(runnable); + thread.setDaemon(daemon); thread.setName(threadPrefix + "-" + threadNumber); return thread; } diff --git a/src/test/java/org/java_websocket/autobahn/AutobahnServerResultsTest.java b/src/test/java/org/java_websocket/autobahn/AutobahnServerResultsTest.java deleted file mode 100644 index 807714049..000000000 --- a/src/test/java/org/java_websocket/autobahn/AutobahnServerResultsTest.java +++ /dev/null @@ -1,2772 +0,0 @@ -/* - * Copyright (c) 2010-2020 Nathan Rajlich - * - * Permission is hereby granted, free of charge, to any person - * obtaining a copy of this software and associated documentation - * files (the "Software"), to deal in the Software without - * restriction, including without limitation the rights to use, - * copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following - * conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES - * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT - * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR - * OTHER DEALINGS IN THE SOFTWARE. - */ - -package org.java_websocket.autobahn; - -import static org.junit.Assert.assertEquals; - -import java.io.File; -import java.io.FileNotFoundException; -import java.util.Scanner; -import org.json.JSONObject; -import org.junit.Assume; -import org.junit.BeforeClass; -import org.junit.Test; - -public class AutobahnServerResultsTest { - - static JSONObject jsonObject = null; - - @BeforeClass - public static void getJSONObject() throws FileNotFoundException { - File file = new File("reports/servers/index.json"); - //File file = new File( "C:\\Python27\\Scripts\\reports\\servers\\index.json" ); - if (file.exists()) { - String content = new Scanner(file).useDelimiter("\\Z").next(); - jsonObject = new JSONObject(content); - jsonObject = jsonObject.getJSONObject("TooTallNate Java-WebSocket"); - } - Assume.assumeTrue(jsonObject != null); - } - - @Test - public void test1_1_1() { - JSONObject testResult = jsonObject.getJSONObject("1.1.1"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test1_1_2() { - JSONObject testResult = jsonObject.getJSONObject("1.1.2"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test1_1_3() { - JSONObject testResult = jsonObject.getJSONObject("1.1.3"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test1_1_4() { - JSONObject testResult = jsonObject.getJSONObject("1.1.4"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test1_1_5() { - JSONObject testResult = jsonObject.getJSONObject("1.1.5"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test1_1_6() { - JSONObject testResult = jsonObject.getJSONObject("1.1.6"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 30); - } - - @Test - public void test1_1_7() { - JSONObject testResult = jsonObject.getJSONObject("1.1.7"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 20); - } - - @Test - public void test1_1_8() { - JSONObject testResult = jsonObject.getJSONObject("1.1.8"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 30); - } - - @Test - public void test1_2_1() { - JSONObject testResult = jsonObject.getJSONObject("1.2.1"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test1_2_2() { - JSONObject testResult = jsonObject.getJSONObject("1.2.2"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test1_2_3() { - JSONObject testResult = jsonObject.getJSONObject("1.2.3"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test1_2_4() { - JSONObject testResult = jsonObject.getJSONObject("1.2.4"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 20); - } - - @Test - public void test1_2_5() { - JSONObject testResult = jsonObject.getJSONObject("1.2.5"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test1_2_6() { - JSONObject testResult = jsonObject.getJSONObject("1.2.6"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 70); - } - - @Test - public void test1_2_7() { - JSONObject testResult = jsonObject.getJSONObject("1.2.7"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 70); - } - - @Test - public void test1_2_8() { - JSONObject testResult = jsonObject.getJSONObject("1.2.8"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 60); - } - - @Test - public void test2_1() { - JSONObject testResult = jsonObject.getJSONObject("2.1"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test2_2() { - JSONObject testResult = jsonObject.getJSONObject("2.2"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test2_3() { - JSONObject testResult = jsonObject.getJSONObject("2.3"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test2_4() { - JSONObject testResult = jsonObject.getJSONObject("2.4"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test2_5() { - JSONObject testResult = jsonObject.getJSONObject("2.5"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test2_6() { - JSONObject testResult = jsonObject.getJSONObject("2.6"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 30); - } - - @Test - public void test2_7() { - JSONObject testResult = jsonObject.getJSONObject("2.7"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test2_8() { - JSONObject testResult = jsonObject.getJSONObject("2.8"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test2_9() { - JSONObject testResult = jsonObject.getJSONObject("2.9"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test2_10() { - JSONObject testResult = jsonObject.getJSONObject("2.10"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 60); - } - - @Test - public void test2_11() { - JSONObject testResult = jsonObject.getJSONObject("2.11"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 50); - } - - @Test - public void test3_1() { - JSONObject testResult = jsonObject.getJSONObject("3.1"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test3_2() { - JSONObject testResult = jsonObject.getJSONObject("3.2"); - assertEquals("NON-STRICT", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test3_3() { - JSONObject testResult = jsonObject.getJSONObject("3.3"); - assertEquals("NON-STRICT", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test3_4() { - JSONObject testResult = jsonObject.getJSONObject("3.4"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 20); - } - - @Test - public void test3_5() { - JSONObject testResult = jsonObject.getJSONObject("3.5"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test3_6() { - JSONObject testResult = jsonObject.getJSONObject("3.6"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test3_7() { - JSONObject testResult = jsonObject.getJSONObject("3.7"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test4_1_1() { - JSONObject testResult = jsonObject.getJSONObject("4.1.1"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test4_1_2() { - JSONObject testResult = jsonObject.getJSONObject("4.1.2"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test4_1_3() { - JSONObject testResult = jsonObject.getJSONObject("4.1.3"); - assertEquals("NON-STRICT", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test4_1_4() { - JSONObject testResult = jsonObject.getJSONObject("4.1.4"); - assertEquals("NON-STRICT", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test4_1_5() { - JSONObject testResult = jsonObject.getJSONObject("4.1.5"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test4_2_1() { - JSONObject testResult = jsonObject.getJSONObject("4.2.1"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test4_2_2() { - JSONObject testResult = jsonObject.getJSONObject("4.2.2"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test4_2_3() { - JSONObject testResult = jsonObject.getJSONObject("4.2.3"); - assertEquals("NON-STRICT", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test4_2_4() { - JSONObject testResult = jsonObject.getJSONObject("4.2.4"); - assertEquals("NON-STRICT", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test4_2_5() { - JSONObject testResult = jsonObject.getJSONObject("4.2.5"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 15); - } - - @Test - public void test5_1() { - JSONObject testResult = jsonObject.getJSONObject("5.1"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test5_2() { - JSONObject testResult = jsonObject.getJSONObject("5.2"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test5_3() { - JSONObject testResult = jsonObject.getJSONObject("5.3"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test5_4() { - JSONObject testResult = jsonObject.getJSONObject("5.4"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test5_5() { - JSONObject testResult = jsonObject.getJSONObject("5.5"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 20); - } - - @Test - public void test5_6() { - JSONObject testResult = jsonObject.getJSONObject("5.6"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 60); - } - - @Test - public void test5_7() { - JSONObject testResult = jsonObject.getJSONObject("5.7"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 60); - } - - @Test - public void test5_8() { - JSONObject testResult = jsonObject.getJSONObject("5.8"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 20); - } - - @Test - public void test5_9() { - JSONObject testResult = jsonObject.getJSONObject("5.9"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test5_10() { - JSONObject testResult = jsonObject.getJSONObject("5.10"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test5_11() { - JSONObject testResult = jsonObject.getJSONObject("5.11"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 20); - } - - @Test - public void test5_12() { - JSONObject testResult = jsonObject.getJSONObject("5.12"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test5_13() { - JSONObject testResult = jsonObject.getJSONObject("5.13"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test5_14() { - JSONObject testResult = jsonObject.getJSONObject("5.14"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test5_15() { - JSONObject testResult = jsonObject.getJSONObject("5.15"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test5_16() { - JSONObject testResult = jsonObject.getJSONObject("5.16"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test5_17() { - JSONObject testResult = jsonObject.getJSONObject("5.17"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test5_18() { - JSONObject testResult = jsonObject.getJSONObject("5.18"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test5_19() { - JSONObject testResult = jsonObject.getJSONObject("5.19"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 1100); - } - - @Test - public void test5_20() { - JSONObject testResult = jsonObject.getJSONObject("5.20"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 1100); - } - - @Test - public void test6_1_1() { - JSONObject testResult = jsonObject.getJSONObject("6.1.1"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test6_1_2() { - JSONObject testResult = jsonObject.getJSONObject("6.1.2"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test6_1_3() { - JSONObject testResult = jsonObject.getJSONObject("6.1.3"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test6_2_1() { - JSONObject testResult = jsonObject.getJSONObject("6.2.1"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test6_2_2() { - JSONObject testResult = jsonObject.getJSONObject("6.2.2"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test6_2_3() { - JSONObject testResult = jsonObject.getJSONObject("6.2.3"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test6_2_4() { - JSONObject testResult = jsonObject.getJSONObject("6.2.4"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test6_3_1() { - JSONObject testResult = jsonObject.getJSONObject("6.3.1"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test6_3_2() { - JSONObject testResult = jsonObject.getJSONObject("6.3.2"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test6_4_1() { - JSONObject testResult = jsonObject.getJSONObject("6.4.1"); - assertEquals("NON-STRICT", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 2100); - } - - @Test - public void test6_4_2() { - JSONObject testResult = jsonObject.getJSONObject("6.4.2"); - assertEquals("NON-STRICT", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 2100); - } - - @Test - public void test6_4_3() { - JSONObject testResult = jsonObject.getJSONObject("6.4.3"); - assertEquals("NON-STRICT", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 2100); - } - - @Test - public void test6_4_4() { - JSONObject testResult = jsonObject.getJSONObject("6.4.4"); - assertEquals("NON-STRICT", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 2100); - } - - @Test - public void test6_5_1() { - JSONObject testResult = jsonObject.getJSONObject("6.5.1"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test6_5_2() { - JSONObject testResult = jsonObject.getJSONObject("6.5.2"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test6_5_3() { - JSONObject testResult = jsonObject.getJSONObject("6.5.3"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test6_5_4() { - JSONObject testResult = jsonObject.getJSONObject("6.5.4"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test6_5_5() { - JSONObject testResult = jsonObject.getJSONObject("6.5.5"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test6_6_1() { - JSONObject testResult = jsonObject.getJSONObject("6.6.1"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test6_6_2() { - JSONObject testResult = jsonObject.getJSONObject("6.6.2"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test6_6_3() { - JSONObject testResult = jsonObject.getJSONObject("6.6.3"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test6_6_4() { - JSONObject testResult = jsonObject.getJSONObject("6.6.4"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test6_6_5() { - JSONObject testResult = jsonObject.getJSONObject("6.6.5"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test6_6_6() { - JSONObject testResult = jsonObject.getJSONObject("6.6.6"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test6_6_7() { - JSONObject testResult = jsonObject.getJSONObject("6.6.7"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test6_6_8() { - JSONObject testResult = jsonObject.getJSONObject("6.6.8"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test6_6_9() { - JSONObject testResult = jsonObject.getJSONObject("6.6.9"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test6_6_10() { - JSONObject testResult = jsonObject.getJSONObject("6.6.10"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test6_6_11() { - JSONObject testResult = jsonObject.getJSONObject("6.6.11"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test6_7_1() { - JSONObject testResult = jsonObject.getJSONObject("6.7.1"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test6_7_2() { - JSONObject testResult = jsonObject.getJSONObject("6.7.2"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test6_7_3() { - JSONObject testResult = jsonObject.getJSONObject("6.7.3"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test6_7_4() { - JSONObject testResult = jsonObject.getJSONObject("6.7.4"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test6_8_1() { - JSONObject testResult = jsonObject.getJSONObject("6.8.1"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test6_8_2() { - JSONObject testResult = jsonObject.getJSONObject("6.8.2"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test6_9_1() { - JSONObject testResult = jsonObject.getJSONObject("6.9.1"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test6_9_2() { - JSONObject testResult = jsonObject.getJSONObject("6.9.2"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test6_9_3() { - JSONObject testResult = jsonObject.getJSONObject("6.9.3"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test6_9_4() { - JSONObject testResult = jsonObject.getJSONObject("6.9.4"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test6_10_1() { - JSONObject testResult = jsonObject.getJSONObject("6.10.1"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test6_10_2() { - JSONObject testResult = jsonObject.getJSONObject("6.10.2"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test6_10_3() { - JSONObject testResult = jsonObject.getJSONObject("6.10.3"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test6_11_1() { - JSONObject testResult = jsonObject.getJSONObject("6.11.1"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test6_11_2() { - JSONObject testResult = jsonObject.getJSONObject("6.11.2"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test6_11_3() { - JSONObject testResult = jsonObject.getJSONObject("6.11.3"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test6_11_4() { - JSONObject testResult = jsonObject.getJSONObject("6.11.4"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test6_11_5() { - JSONObject testResult = jsonObject.getJSONObject("6.11.5"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test6_12_1() { - JSONObject testResult = jsonObject.getJSONObject("6.12.1"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test6_12_2() { - JSONObject testResult = jsonObject.getJSONObject("6.12.2"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test6_12_3() { - JSONObject testResult = jsonObject.getJSONObject("6.12.3"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test6_12_4() { - JSONObject testResult = jsonObject.getJSONObject("6.12.4"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test6_12_5() { - JSONObject testResult = jsonObject.getJSONObject("6.12.5"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test6_12_6() { - JSONObject testResult = jsonObject.getJSONObject("6.12.6"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test6_12_7() { - JSONObject testResult = jsonObject.getJSONObject("6.12.7"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test6_12_8() { - JSONObject testResult = jsonObject.getJSONObject("6.12.8"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test6_13_1() { - JSONObject testResult = jsonObject.getJSONObject("6.13.1"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test6_13_2() { - JSONObject testResult = jsonObject.getJSONObject("6.13.2"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test6_13_3() { - JSONObject testResult = jsonObject.getJSONObject("6.13.3"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test6_13_4() { - JSONObject testResult = jsonObject.getJSONObject("6.13.4"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test6_13_5() { - JSONObject testResult = jsonObject.getJSONObject("6.13.5"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test6_14_1() { - JSONObject testResult = jsonObject.getJSONObject("6.14.1"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test6_14_2() { - JSONObject testResult = jsonObject.getJSONObject("6.14.2"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test6_14_3() { - JSONObject testResult = jsonObject.getJSONObject("6.14.3"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test6_14_4() { - JSONObject testResult = jsonObject.getJSONObject("6.14.4"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test6_14_5() { - JSONObject testResult = jsonObject.getJSONObject("6.14.5"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test6_14_6() { - JSONObject testResult = jsonObject.getJSONObject("6.14.6"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test6_14_7() { - JSONObject testResult = jsonObject.getJSONObject("6.14.7"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test6_14_8() { - JSONObject testResult = jsonObject.getJSONObject("6.14.8"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test6_14_9() { - JSONObject testResult = jsonObject.getJSONObject("6.14.9"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test6_14_10() { - JSONObject testResult = jsonObject.getJSONObject("6.14.10"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test6_15_1() { - JSONObject testResult = jsonObject.getJSONObject("6.15.1"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test6_16_1() { - JSONObject testResult = jsonObject.getJSONObject("6.16.1"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test6_16_2() { - JSONObject testResult = jsonObject.getJSONObject("6.16.2"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test6_16_3() { - JSONObject testResult = jsonObject.getJSONObject("6.16.3"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test6_17_1() { - JSONObject testResult = jsonObject.getJSONObject("6.17.1"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test6_17_2() { - JSONObject testResult = jsonObject.getJSONObject("6.17.2"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test6_17_3() { - JSONObject testResult = jsonObject.getJSONObject("6.17.3"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test6_17_4() { - JSONObject testResult = jsonObject.getJSONObject("6.17.4"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test6_17_5() { - JSONObject testResult = jsonObject.getJSONObject("6.17.5"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test6_18_1() { - JSONObject testResult = jsonObject.getJSONObject("6.18.1"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test6_18_2() { - JSONObject testResult = jsonObject.getJSONObject("6.18.2"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test6_18_3() { - JSONObject testResult = jsonObject.getJSONObject("6.18.3"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test6_18_4() { - JSONObject testResult = jsonObject.getJSONObject("6.18.4"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test6_18_5() { - JSONObject testResult = jsonObject.getJSONObject("6.18.5"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test6_19_1() { - JSONObject testResult = jsonObject.getJSONObject("6.19.1"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test6_19_2() { - JSONObject testResult = jsonObject.getJSONObject("6.19.2"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test6_19_3() { - JSONObject testResult = jsonObject.getJSONObject("6.19.3"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test6_19_4() { - JSONObject testResult = jsonObject.getJSONObject("6.19.4"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test6_19_5() { - JSONObject testResult = jsonObject.getJSONObject("6.19.5"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test6_20_1() { - JSONObject testResult = jsonObject.getJSONObject("6.20.1"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test6_20_2() { - JSONObject testResult = jsonObject.getJSONObject("6.20.2"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test6_20_3() { - JSONObject testResult = jsonObject.getJSONObject("6.20.3"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test6_20_4() { - JSONObject testResult = jsonObject.getJSONObject("6.20.4"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test6_20_5() { - JSONObject testResult = jsonObject.getJSONObject("6.20.5"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test6_20_6() { - JSONObject testResult = jsonObject.getJSONObject("6.20.6"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test6_20_7() { - JSONObject testResult = jsonObject.getJSONObject("6.20.7"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test6_21_1() { - JSONObject testResult = jsonObject.getJSONObject("6.21.1"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test6_21_2() { - JSONObject testResult = jsonObject.getJSONObject("6.21.2"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test6_21_3() { - JSONObject testResult = jsonObject.getJSONObject("6.21.3"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test6_21_4() { - JSONObject testResult = jsonObject.getJSONObject("6.21.4"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test6_21_5() { - JSONObject testResult = jsonObject.getJSONObject("6.21.5"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test6_21_6() { - JSONObject testResult = jsonObject.getJSONObject("6.21.6"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test6_21_7() { - JSONObject testResult = jsonObject.getJSONObject("6.21.7"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test6_21_8() { - JSONObject testResult = jsonObject.getJSONObject("6.21.8"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test6_22_1() { - JSONObject testResult = jsonObject.getJSONObject("6.22.1"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test6_22_2() { - JSONObject testResult = jsonObject.getJSONObject("6.22.2"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test6_22_3() { - JSONObject testResult = jsonObject.getJSONObject("6.22.3"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test6_22_4() { - JSONObject testResult = jsonObject.getJSONObject("6.22.4"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test6_22_5() { - JSONObject testResult = jsonObject.getJSONObject("6.22.5"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test6_22_6() { - JSONObject testResult = jsonObject.getJSONObject("6.22.6"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test6_22_7() { - JSONObject testResult = jsonObject.getJSONObject("6.22.7"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test6_22_8() { - JSONObject testResult = jsonObject.getJSONObject("6.22.8"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test6_22_9() { - JSONObject testResult = jsonObject.getJSONObject("6.22.9"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test6_22_10() { - JSONObject testResult = jsonObject.getJSONObject("6.22.10"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test6_22_11() { - JSONObject testResult = jsonObject.getJSONObject("6.22.11"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test6_22_12() { - JSONObject testResult = jsonObject.getJSONObject("6.22.12"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test6_22_13() { - JSONObject testResult = jsonObject.getJSONObject("6.22.13"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test6_22_14() { - JSONObject testResult = jsonObject.getJSONObject("6.22.14"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test6_22_15() { - JSONObject testResult = jsonObject.getJSONObject("6.22.15"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test6_22_16() { - JSONObject testResult = jsonObject.getJSONObject("6.22.16"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test6_22_17() { - JSONObject testResult = jsonObject.getJSONObject("6.22.17"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test6_22_18() { - JSONObject testResult = jsonObject.getJSONObject("6.22.18"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test6_22_19() { - JSONObject testResult = jsonObject.getJSONObject("6.22.19"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test6_22_20() { - JSONObject testResult = jsonObject.getJSONObject("6.22.20"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test6_22_21() { - JSONObject testResult = jsonObject.getJSONObject("6.22.21"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test6_22_22() { - JSONObject testResult = jsonObject.getJSONObject("6.22.22"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test6_22_23() { - JSONObject testResult = jsonObject.getJSONObject("6.22.23"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test6_22_24() { - JSONObject testResult = jsonObject.getJSONObject("6.22.24"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test6_22_25() { - JSONObject testResult = jsonObject.getJSONObject("6.22.25"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test6_22_26() { - JSONObject testResult = jsonObject.getJSONObject("6.22.26"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test6_22_27() { - JSONObject testResult = jsonObject.getJSONObject("6.22.27"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test6_22_28() { - JSONObject testResult = jsonObject.getJSONObject("6.22.28"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test6_22_29() { - JSONObject testResult = jsonObject.getJSONObject("6.22.29"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test6_22_30() { - JSONObject testResult = jsonObject.getJSONObject("6.22.30"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test6_22_31() { - JSONObject testResult = jsonObject.getJSONObject("6.22.31"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test6_22_32() { - JSONObject testResult = jsonObject.getJSONObject("6.22.32"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test6_22_33() { - JSONObject testResult = jsonObject.getJSONObject("6.22.33"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test6_22_34() { - JSONObject testResult = jsonObject.getJSONObject("6.22.34"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test6_23_1() { - JSONObject testResult = jsonObject.getJSONObject("6.23.1"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test6_23_2() { - JSONObject testResult = jsonObject.getJSONObject("6.23.2"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test6_23_3() { - JSONObject testResult = jsonObject.getJSONObject("6.23.3"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test6_23_4() { - JSONObject testResult = jsonObject.getJSONObject("6.23.4"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test6_23_5() { - JSONObject testResult = jsonObject.getJSONObject("6.23.5"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test6_23_6() { - JSONObject testResult = jsonObject.getJSONObject("6.23.6"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test6_23_7() { - JSONObject testResult = jsonObject.getJSONObject("6.23.7"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test7_1_1() { - JSONObject testResult = jsonObject.getJSONObject("7.1.1"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test7_1_2() { - JSONObject testResult = jsonObject.getJSONObject("7.1.2"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test7_1_3() { - JSONObject testResult = jsonObject.getJSONObject("7.1.3"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test7_1_4() { - JSONObject testResult = jsonObject.getJSONObject("7.1.4"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test7_1_5() { - JSONObject testResult = jsonObject.getJSONObject("7.1.5"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test7_1_6() { - JSONObject testResult = jsonObject.getJSONObject("7.1.6"); - assertEquals("INFORMATIONAL", testResult.get("behavior")); - assertEquals("INFORMATIONAL", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 50); - } - - @Test - public void test7_3_1() { - JSONObject testResult = jsonObject.getJSONObject("7.3.1"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test7_3_2() { - JSONObject testResult = jsonObject.getJSONObject("7.3.2"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test7_3_3() { - JSONObject testResult = jsonObject.getJSONObject("7.3.3"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test7_3_4() { - JSONObject testResult = jsonObject.getJSONObject("7.3.4"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test7_3_5() { - JSONObject testResult = jsonObject.getJSONObject("7.3.5"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test7_3_6() { - JSONObject testResult = jsonObject.getJSONObject("7.3.6"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test7_5_1() { - JSONObject testResult = jsonObject.getJSONObject("7.5.1"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test7_7_1() { - JSONObject testResult = jsonObject.getJSONObject("7.7.1"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test7_7_2() { - JSONObject testResult = jsonObject.getJSONObject("7.7.2"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test7_7_3() { - JSONObject testResult = jsonObject.getJSONObject("7.7.3"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test7_7_4() { - JSONObject testResult = jsonObject.getJSONObject("7.7.4"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test7_7_5() { - JSONObject testResult = jsonObject.getJSONObject("7.7.5"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test7_7_6() { - JSONObject testResult = jsonObject.getJSONObject("7.7.6"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test7_7_7() { - JSONObject testResult = jsonObject.getJSONObject("7.7.7"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test7_7_8() { - JSONObject testResult = jsonObject.getJSONObject("7.7.8"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test7_7_9() { - JSONObject testResult = jsonObject.getJSONObject("7.7.9"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test7_7_10() { - JSONObject testResult = jsonObject.getJSONObject("7.7.10"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test7_7_11() { - JSONObject testResult = jsonObject.getJSONObject("7.7.11"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test7_7_12() { - JSONObject testResult = jsonObject.getJSONObject("7.7.12"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test7_7_13() { - JSONObject testResult = jsonObject.getJSONObject("7.7.13"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test7_9_1() { - JSONObject testResult = jsonObject.getJSONObject("7.9.1"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test7_9_2() { - JSONObject testResult = jsonObject.getJSONObject("7.9.2"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test7_9_3() { - JSONObject testResult = jsonObject.getJSONObject("7.9.3"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test7_9_4() { - JSONObject testResult = jsonObject.getJSONObject("7.9.4"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test7_9_5() { - JSONObject testResult = jsonObject.getJSONObject("7.9.5"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test7_9_7() { - JSONObject testResult = jsonObject.getJSONObject("7.9.7"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test7_9_8() { - JSONObject testResult = jsonObject.getJSONObject("7.9.8"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test7_9_9() { - JSONObject testResult = jsonObject.getJSONObject("7.9.9"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test7_9_10() { - JSONObject testResult = jsonObject.getJSONObject("7.9.10"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test7_9_11() { - JSONObject testResult = jsonObject.getJSONObject("7.9.11"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test7_13_1() { - JSONObject testResult = jsonObject.getJSONObject("7.13.1"); - assertEquals("INFORMATIONAL", testResult.get("behavior")); - assertEquals("INFORMATIONAL", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test7_13_2() { - JSONObject testResult = jsonObject.getJSONObject("7.13.2"); - assertEquals("INFORMATIONAL", testResult.get("behavior")); - assertEquals("INFORMATIONAL", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test9_1_1() { - JSONObject testResult = jsonObject.getJSONObject("9.1.1"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test9_1_2() { - JSONObject testResult = jsonObject.getJSONObject("9.1.2"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 20); - } - - @Test - public void test9_1_3() { - JSONObject testResult = jsonObject.getJSONObject("9.1.3"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 70); - } - - @Test - public void test9_1_4() { - JSONObject testResult = jsonObject.getJSONObject("9.1.4"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 375); - } - - @Test - public void test9_1_5() { - JSONObject testResult = jsonObject.getJSONObject("9.1.5"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 750); - } - - @Test - public void test9_1_6() { - JSONObject testResult = jsonObject.getJSONObject("9.1.6"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 1000); - } - - @Test - public void test9_2_1() { - JSONObject testResult = jsonObject.getJSONObject("9.2.1"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } - - @Test - public void test9_2_2() { - JSONObject testResult = jsonObject.getJSONObject("9.2.2"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 20); - } - - @Test - public void test9_2_3() { - JSONObject testResult = jsonObject.getJSONObject("9.2.3"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 70); - } - - @Test - public void test9_2_4() { - JSONObject testResult = jsonObject.getJSONObject("9.2.4"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 250); - } - - @Test - public void test9_2_5() { - JSONObject testResult = jsonObject.getJSONObject("9.2.5"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 350); - } - - @Test - public void test9_2_6() { - JSONObject testResult = jsonObject.getJSONObject("9.2.6"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 800); - } - - @Test - public void test9_3_1() { - JSONObject testResult = jsonObject.getJSONObject("9.3.1"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 2000); - } - - @Test - public void test9_3_2() { - JSONObject testResult = jsonObject.getJSONObject("9.3.2"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 600); - } - - @Test - public void test9_3_3() { - JSONObject testResult = jsonObject.getJSONObject("9.3.3"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 300); - } - - @Test - public void test9_3_4() { - JSONObject testResult = jsonObject.getJSONObject("9.3.4"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 250); - } - - @Test - public void test9_3_5() { - JSONObject testResult = jsonObject.getJSONObject("9.3.5"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 200); - } - - @Test - public void test9_3_6() { - JSONObject testResult = jsonObject.getJSONObject("9.3.6"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 175); - } - - @Test - public void test9_3_7() { - JSONObject testResult = jsonObject.getJSONObject("9.3.7"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 175); - } - - - @Test - public void test9_3_8() { - JSONObject testResult = jsonObject.getJSONObject("9.3.8"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 160); - } - - @Test - public void test9_3_9() { - JSONObject testResult = jsonObject.getJSONObject("9.3.9"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 160); - } - - @Test - public void test9_4_1() { - JSONObject testResult = jsonObject.getJSONObject("9.4.1"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 2300); - } - - @Test - public void test9_4_2() { - JSONObject testResult = jsonObject.getJSONObject("9.4.2"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 700); - } - - @Test - public void test9_4_3() { - JSONObject testResult = jsonObject.getJSONObject("9.4.3"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 350); - } - - @Test - public void test9_4_4() { - JSONObject testResult = jsonObject.getJSONObject("9.4.4"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 175); - } - - @Test - public void test9_4_5() { - JSONObject testResult = jsonObject.getJSONObject("9.4.5"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 150); - } - - @Test - public void test9_4_6() { - JSONObject testResult = jsonObject.getJSONObject("9.4.6"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 100); - } - - @Test - public void test9_4_7() { - JSONObject testResult = jsonObject.getJSONObject("9.4.7"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 125); - } - - @Test - public void test9_4_8() { - JSONObject testResult = jsonObject.getJSONObject("9.4.8"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 125); - } - - @Test - public void test9_4_9() { - JSONObject testResult = jsonObject.getJSONObject("9.4.9"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 125); - } - - @Test - public void test9_5_1() { - JSONObject testResult = jsonObject.getJSONObject("9.5.1"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 3200); - } - - @Test - public void test9_5_2() { - JSONObject testResult = jsonObject.getJSONObject("9.5.2"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 1300); - } - - @Test - public void test9_5_3() { - JSONObject testResult = jsonObject.getJSONObject("9.5.3"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 700); - } - - @Test - public void test9_5_4() { - JSONObject testResult = jsonObject.getJSONObject("9.5.4"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 450); - } - - @Test - public void test9_5_5() { - JSONObject testResult = jsonObject.getJSONObject("9.5.5"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 250); - } - - @Test - public void test9_5_6() { - JSONObject testResult = jsonObject.getJSONObject("9.5.6"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 150); - } - - @Test - public void test9_6_1() { - JSONObject testResult = jsonObject.getJSONObject("9.6.1"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 3000); - } - - @Test - public void test9_6_2() { - JSONObject testResult = jsonObject.getJSONObject("9.6.2"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 1500); - } - - @Test - public void test9_6_3() { - JSONObject testResult = jsonObject.getJSONObject("9.6.3"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 750); - } - - @Test - public void test9_6_4() { - JSONObject testResult = jsonObject.getJSONObject("9.6.4"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 450); - } - - @Test - public void test9_6_5() { - JSONObject testResult = jsonObject.getJSONObject("9.6.5"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 250); - } - - @Test - public void test9_6_6() { - JSONObject testResult = jsonObject.getJSONObject("9.6.6"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 200); - } - - @Test - public void test9_7_1() { - JSONObject testResult = jsonObject.getJSONObject("9.7.1"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 500); - } - - @Test - public void test9_7_2() { - JSONObject testResult = jsonObject.getJSONObject("9.7.2"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 400); - } - - @Test - public void test9_7_3() { - JSONObject testResult = jsonObject.getJSONObject("9.7.3"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 400); - } - - @Test - public void test9_7_4() { - JSONObject testResult = jsonObject.getJSONObject("9.7.4"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 400); - } - - @Test - public void test9_7_5() { - JSONObject testResult = jsonObject.getJSONObject("9.7.5"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 550); - } - - @Test - public void test9_7_6() { - JSONObject testResult = jsonObject.getJSONObject("9.7.6"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 850); - } - - @Test - public void test9_8_1() { - JSONObject testResult = jsonObject.getJSONObject("9.8.1"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 300); - } - - @Test - public void test9_8_2() { - JSONObject testResult = jsonObject.getJSONObject("9.8.2"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 320); - } - - @Test - public void test9_8_3() { - JSONObject testResult = jsonObject.getJSONObject("9.8.3"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 400); - } - - @Test - public void test9_8_4() { - JSONObject testResult = jsonObject.getJSONObject("9.8.4"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 400); - } - - @Test - public void test9_8_5() { - JSONObject testResult = jsonObject.getJSONObject("9.8.5"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 470); - } - - @Test - public void test9_8_6() { - JSONObject testResult = jsonObject.getJSONObject("9.8.6"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 770); - } - - @Test - public void test10_1_1() { - JSONObject testResult = jsonObject.getJSONObject("10.1.1"); - assertEquals("OK", testResult.get("behavior")); - assertEquals("OK", testResult.get("behaviorClose")); - Assume.assumeTrue("Duration: " + testResult.getInt("duration"), - testResult.getInt("duration") < 10); - } -} diff --git a/src/test/java/org/java_websocket/client/ConnectBlockingTest.java b/src/test/java/org/java_websocket/client/ConnectBlockingTest.java new file mode 100644 index 000000000..fa7797cd8 --- /dev/null +++ b/src/test/java/org/java_websocket/client/ConnectBlockingTest.java @@ -0,0 +1,68 @@ +package org.java_websocket.client; + +import java.io.IOException; +import java.net.*; +import java.util.Set; +import java.util.concurrent.*; +import org.java_websocket.WebSocket; +import org.java_websocket.handshake.*; +import org.java_websocket.client.*; +import org.java_websocket.server.WebSocketServer; +import org.java_websocket.util.SocketUtil; +import org.java_websocket.enums.ReadyState; +import org.junit.Test; +import static org.junit.Assert.*; + +public class ConnectBlockingTest { + + @Test(timeout = 1000) + public void test_ConnectBlockingCleanup() throws Throwable { + + Set threadSet1 = Thread.getAllStackTraces().keySet(); + final CountDownLatch ready = new CountDownLatch(1); + final CountDownLatch accepted = new CountDownLatch(1); + + final int port = SocketUtil.getAvailablePort(); + + /* TCP server which listens to a port, but does not answer handshake */ + Thread server = new Thread(new Runnable() { + @Override + public void run() { + try { + ServerSocket serverSocket = new ServerSocket(port); + ready.countDown(); + Socket clientSocket = serverSocket.accept(); + accepted.countDown(); + } catch (Throwable t) { + assertTrue(t instanceof InterruptedException); + } + } + }); + server.start(); + ready.await(); + + WebSocketClient client = new WebSocketClient(URI.create("ws://localhost:" + port)) { + @Override + public void onOpen(ServerHandshake handshake) { + } + @Override + public void onClose(int code, String reason, boolean remote) {} + @Override + public void onMessage(String message) {} + @Override + public void onError(Exception ex) { + ex.printStackTrace(); + } + }; + boolean connected = client.connectBlocking(100, TimeUnit.MILLISECONDS); + assertEquals("TCP socket should have been accepted", 0, accepted.getCount()); + assertFalse("WebSocket should not be connected (as server didn't send handshake)", connected); + + server.interrupt(); + server.join(); + + Set threadSet2 = Thread.getAllStackTraces().keySet(); + assertEquals("no threads left over", threadSet1, threadSet2); + assertTrue("WebSocket is in closed state", client.getReadyState() == ReadyState.CLOSED || client.getReadyState() == ReadyState.NOT_YET_CONNECTED); + } +} diff --git a/src/test/java/org/java_websocket/server/DaemonThreadTest.java b/src/test/java/org/java_websocket/server/DaemonThreadTest.java new file mode 100644 index 000000000..f1b25c6f0 --- /dev/null +++ b/src/test/java/org/java_websocket/server/DaemonThreadTest.java @@ -0,0 +1,75 @@ +package org.java_websocket.server; + +import java.io.IOException; +import java.net.*; +import java.util.Set; +import java.util.concurrent.CountDownLatch; +import org.java_websocket.WebSocket; +import org.java_websocket.handshake.*; +import org.java_websocket.client.*; +import org.java_websocket.server.WebSocketServer; +import org.java_websocket.util.SocketUtil; +import org.junit.Test; +import static org.junit.Assert.assertTrue; + +public class DaemonThreadTest { + + @Test(timeout = 1000) + public void test_AllCreatedThreadsAreDaemon() throws Throwable { + + Set threadSet1 = Thread.getAllStackTraces().keySet(); + final CountDownLatch ready = new CountDownLatch(1); + + WebSocketServer server = new WebSocketServer(new InetSocketAddress(SocketUtil.getAvailablePort())) { + @Override + public void onOpen(WebSocket conn, ClientHandshake handshake) {} + @Override + public void onClose(WebSocket conn, int code, String reason, boolean remote) {} + @Override + public void onMessage(WebSocket conn, String message) {} + @Override + public void onError(WebSocket conn, Exception ex) {} + @Override + public void onStart() {} + }; + server.setDaemon(true); + server.setDaemon(false); + server.setDaemon(true); + server.start(); + + WebSocketClient client = new WebSocketClient(URI.create("ws://localhost:" + server.getPort())) { + @Override + public void onOpen(ServerHandshake handshake) { + ready.countDown(); + } + @Override + public void onClose(int code, String reason, boolean remote) {} + @Override + public void onMessage(String message) {} + @Override + public void onError(Exception ex) {} + }; + client.setDaemon(false); + client.setDaemon(true); + client.connect(); + + ready.await(); + Set threadSet2 = Thread.getAllStackTraces().keySet(); + threadSet2.removeAll(threadSet1); + + assertTrue("new threads created (no new threads indicates issue in test)", !threadSet2.isEmpty()); + + for (Thread t : threadSet2) + assertTrue(t.getName(), t.isDaemon()); + + boolean exception = false; + try { + server.setDaemon(false); + } catch(IllegalStateException e) { + exception = true; + } + assertTrue("exception was thrown when calling setDaemon on a running server", exception); + + server.stop(); + } +}