Skip to content

Commit 3b78025

Browse files
committed
Added missing copyrights and some javadoc
1 parent 52debdf commit 3b78025

File tree

6 files changed

+86
-1
lines changed

6 files changed

+86
-1
lines changed

integration-tests/src/test/java/oracle/kubernetes/operator/ITSessionMigration.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,8 @@ public void testHttpSessionMigr() throws Exception {
219219
/**
220220
* Get HTTP response from the web app deployed on wls
221221
*
222+
* @param webServiceURL - web server URL
223+
* @param headerOption - option to save HTTP header info or use it
222224
* @throws Exception
223225
*/
224226
private ExecResult getHTTPResponse(String webServiceURL, String headerOption) throws Exception {
@@ -244,6 +246,7 @@ private ExecResult getHTTPResponse(String webServiceURL, String headerOption) th
244246
/**
245247
* Stop the primary server
246248
*
249+
* @param primaryServerName - weblogic primary server name
247250
* @throws Exception
248251
*/
249252
private void stopPrimaryServer(String primaryServerName) throws Exception {
@@ -267,6 +270,8 @@ private void stopPrimaryServer(String primaryServerName) throws Exception {
267270
/**
268271
* Get the value of a HTTP attribute
269272
*
273+
* @param httpResponseString - HTTP response
274+
* @param attribute - attrubute name to find in the HTTP response
270275
* @throws Exception
271276
*/
272277
private String getHttpResponseAttribute(String httpResponseString, String attribute)
@@ -290,6 +295,8 @@ private String getHttpResponseAttribute(String httpResponseString, String attrib
290295
/**
291296
* Build web server url
292297
*
298+
* @param curlURLPath - URL path sent by curl
299+
* @param paramToAppend - params need to be appended to the URL path
293300
* @throws Exception
294301
*/
295302
private String buildWebServiceUrl(String curlURLPath, String paramToAppend) throws Exception {
@@ -315,6 +322,7 @@ private String buildWebServiceUrl(String curlURLPath, String paramToAppend) thro
315322
/**
316323
* Execute a given curl command and verify the results
317324
*
325+
* @param curlCmd - a curl command to execute
318326
* @throws Exception
319327
*/
320328
private ExecResult execCurlCmd(String curlCmd) throws Exception {

integration-tests/src/test/java/oracle/kubernetes/operator/utils/TestUtils.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -422,6 +422,15 @@ public static ExecResult kubectlexecNoCheck(String podName, String namespace, St
422422
return ExecCommand.exec(cmdKubectlSh.toString());
423423
}
424424

425+
/**
426+
* Copy all App files to the k8s pod
427+
*
428+
* @param appLocationOnHost - App location on the local host
429+
* @param appLocationInPod - App location on the lk8s pod
430+
* @param podName - the k8s pod name
431+
* @param namespace - namespace the k8s pod is in
432+
* @throws Exception
433+
*/
425434
public static void copyAppFilesToPod(
426435
String appLocationOnHost, String appLocationInPod, String podName, String namespace)
427436
throws Exception {

integration-tests/src/test/resources/apps/buildDeployWebAppInPod.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
#!/bin/sh
22

3+
# Copyright 2019, Oracle Corporation and/or its affiliates. All rights reserved.
4+
# Licensed under the Universal Permissive License v 1.0 as shown at
5+
# http://oss.oracle.com/licenses/upl.
6+
37
usage()
48
{
59
printf "\n"
@@ -48,4 +52,6 @@ echo "Deploy ${APP_NAME} using cmd:"
4852
echo -e "curl --noproxy '*' --silent --user ${USER}:${PASSWORD} -H X-Requested-By:MyClient -H Accept:application/json -H Content-Type:multipart/form-data -F "model={ name: '${APP_NAME}', targets: [ { identity: [ clusters, '${DEPLOY_TARGET}' ] } ] }" -F "sourcePath=@${APP_DIR_INPOD}/${WAR_FILE_NAME}" -H "Prefer:respond-async" -X POST http://${HOST}:${PORT}/management/weblogic/latest/edit/appDeployments\n"
4953
curl --noproxy '*' --silent --user ${USER}:${PASSWORD} -H X-Requested-By:MyClient -H Accept:application/json -H Content-Type:multipart/form-data -F "model={ name: '${APP_NAME}', targets: [ { identity: [ clusters, '${DEPLOY_TARGET}' ] } ] }" -F "sourcePath=@${APP_DIR_INPOD}/${WAR_FILE_NAME}" -H "Prefer:respond-async" -X POST http://${HOST}:${PORT}/management/weblogic/latest/edit/appDeployments
5054

55+
rm -rf stagedir
56+
5157
exit 0

integration-tests/src/test/resources/apps/httpsessionreptestapp/CounterServlet.java

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
// Copyright 2019, Oracle Corporation and/or its affiliates. All rights reserved.
2+
// Licensed under the Universal Permissive License v 1.0 as shown at
3+
// http://oss.oracle.com/licenses/upl.
4+
15
package apps.httpsessionreptestapp;
26

37
import java.io.*;
@@ -8,23 +12,52 @@
812
import weblogic.servlet.spi.WebServerRegistry;
913
import java.util.Enumeration;
1014

15+
/**
16+
* Simple HTTP servlet class for a client to
17+
* 1. query weblogic primary and secondary server
18+
* 2. set or get a count number
19+
*/
1120
public class CounterServlet extends HttpServlet {
1221
private String message;
1322

1423
public CounterServlet() {
1524
setServletName(this.getClass().getName());
1625
}
1726

27+
/**
28+
* Method to handle GET method request.
29+
*
30+
* @param request - HTTP request
31+
* @param response - HTTP response
32+
*
33+
* @throws IOException, ServletException
34+
*/
1835
public void doGet(HttpServletRequest request,HttpServletResponse response)
1936
throws IOException, ServletException {
2037
process(request,response);
2138
}
2239

40+
/**
41+
* Method to handle POST method request.
42+
*
43+
* @param request - HTTP request
44+
* @param response - HTTP response
45+
*
46+
* @throws IOException, ServletException
47+
*/
2348
public void doPost(HttpServletRequest request,HttpServletResponse response)
2449
throws IOException, ServletException {
2550
process(request,response);
2651
}
2752

53+
/**
54+
* Method to handle PROCESS method request.
55+
*
56+
* @param request - HTTP request
57+
* @param response - HTTP response
58+
*
59+
* @throws IOException, ServletException
60+
*/
2861
protected void process(HttpServletRequest request, HttpServletResponse response)
2962
throws IOException, ServletException {
3063

@@ -67,6 +100,13 @@ protected void process(HttpServletRequest request, HttpServletResponse response)
67100
}
68101
}
69102

103+
/**
104+
* Method to return the primary server name
105+
*
106+
* @param sessionId - HTTP session ID
107+
*
108+
* @return the weblogic primary server name
109+
*/
70110
private String getPrimaryServer(String sessionId) {
71111
MembershipControllerImpl cluster =
72112
(MembershipControllerImpl) WebServerRegistry.getInstance().getClusterProvider();
@@ -79,6 +119,13 @@ private String getPrimaryServer(String sessionId) {
79119
return rsid.getPrimary().getServerName();
80120
}
81121

122+
/**
123+
* Method to return the secondary server name
124+
*
125+
* @param sessionId - HTTP session ID
126+
*
127+
* @return the weblogic secondary server name
128+
*/
82129
private String getSecondaryServer(String sessionId) {
83130
MembershipControllerImpl cluster =
84131
(MembershipControllerImpl) WebServerRegistry.getInstance().getClusterProvider();
@@ -91,10 +138,20 @@ private String getSecondaryServer(String sessionId) {
91138
return rsid.getSecondary().getServerName();
92139
}
93140

141+
/**
142+
* Method to get the servlet name
143+
*
144+
* @return the servlet name
145+
*/
94146
public String getServletName() {
95147
return this.message;
96148
}
97149

150+
/**
151+
* Method to set servlet name
152+
*
153+
* @param sessionId - HTTP session ID
154+
*/
98155
private void setServletName(String message) {
99156
this.message=message;
100157
}

integration-tests/src/test/resources/apps/httpsessionreptestapp/WEB-INF/web.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
<?xml version="1.0" encoding="ISO-8859-1"?>
2+
<!-- Copyright 2019, Oracle Corporation and/or its affiliates. All rights reserved.
3+
Licensed under the Universal Permissive License v 1.0 as shown at
4+
http://oss.oracle.com/licenses/upl.-->
25
<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
36
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
47
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee web-app_2_4.xsd" version="2.4">

integration-tests/src/test/resources/apps/httpsessionreptestapp/WEB-INF/weblogic.xml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?xml version="1.0" encoding="ISO-8859-1"?>
2-
2+
<!-- Copyright 2019, Oracle Corporation and/or its affiliates. All rights reserved.
3+
Licensed under the Universal Permissive License v 1.0 as shown at
4+
http://oss.oracle.com/licenses/upl.-->
35
<weblogic-web-app xmlns="http://www.bea.com/ns/weblogic/90">
46
<description> weblogic.xml for memory persistence </description>
57

0 commit comments

Comments
 (0)