RFR: 8291226: Create Test Cases to cover scenarios for JDK-8278067 [v9]

Ramesh Bhagavatam Gangadhar rgangadhar at openjdk.org
Tue Aug 23 04:59:26 UTC 2022


> There are total 160 scenarios written with combination of client properties (Client Scenarios) and Server Response (Server Scenarios).
> 
> In tabular format, Client and Server scenarios along with expected output are documented here:[Permalink](https://bugs.openjdk.org/browse/JDK-8291226?focusedCommentId=14519074&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-14519074)
> 
> This Program Should be run mandatorily in othervm mode itself since it has system property changes so can't be clubbed with other scenarios. so each scenario should be run in individual JVM.
> 
> For each and every scenario, ServerSocket is created and waits for clients to connect to it.
> isProxySet and serverReady are shared variables between server thread and client thread(main) and it should be set and reset to false for each and every scenario.
> 
> isProxySet and serverReady variables should be set by server thread before proceeding to client thread(main).
> 
> if isProxySet variable is set to true then client set the proxy value to url.openConnection(Proxy)
> <SNIPPET>
> if (isProxySet) { 
>          httpUrlConnection = (sun.net.www.protocol.http.HttpURLConnection) url .openConnection(new Proxy(Type.HTTP, new InetSocketAddress("localhost", SERVER_PORT))); } 
> else { 
>         httpUrlConnection = (sun.net.www.protocol.http.HttpURLConnection) url.openConnection(); 
> }
> </SNIPPET>
> 
> Program tries to fetch the Value of <Key, Value> Pairs of HashMap KeepAliveCache where Key is KeepAliveKey and Value is ClientVector KeepAliveTimeout is stored in Value ClientVector of HashMap KeepAliveCache.
> 
> if connection is cached then KeepAliveTimeout is stored in ClientVector. KeepAliveTimeout stored in Value(ClientVector) of HashMap KeepAliveCache is compared with Expected Value.
> 
> if connection is not cached then connection is terminated immediately.

Ramesh Bhagavatam Gangadhar has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains ten additional commits since the last revision:

 - Merge branch 'openjdk:master' into 8291226
 - aligned imports and removed whitespaces
 - Removed additional whitespaces
 - Renamed method names
   
   renamed method createServer name to executeServer
 - Update KeepAliveTest.java
   
   Removed White Spaces
 - Update KeepAliveTest.java
   
   Renamed Methods like startScenario, runClient, startServer, connectToServerURL
   added final to constants
   Changed clientScenarios array
   Changed serverScenarios array
   added IllegalArgumentException
   Replaced TIMEOUT with CountDownLatch
   Added Comments
 - Update and rename KeepAliveTest to KeepAliveTest.java
   
   1. Increased space from 2 to 4.
   2. skipped test scenarios from 113 to 128 && 145 to 160
 - Merge branch 'openjdk:master' into 8291226
 - Create KeepAliveTest

-------------

Changes:
  - all: https://git.openjdk.org/jdk/pull/9958/files
  - new: https://git.openjdk.org/jdk/pull/9958/files/ecc8d180..9728c035

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=9958&range=08
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=9958&range=07-08

  Stats: 1335 lines in 29 files changed: 720 ins; 554 del; 61 mod
  Patch: https://git.openjdk.org/jdk/pull/9958.diff
  Fetch: git fetch https://git.openjdk.org/jdk pull/9958/head:pull/9958

PR: https://git.openjdk.org/jdk/pull/9958


More information about the net-dev mailing list