Skip to content

Commit bd4a9dd

Browse files
committed
Added more javadocs and copyright texts
1 parent 8a945f6 commit bd4a9dd

File tree

5 files changed

+65
-39
lines changed

5 files changed

+65
-39
lines changed

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
// Copyright 2018, Oracle Corporation and/or its affiliates. All rights reserved.
1+
// Copyright 2018, 2019, Oracle Corporation and/or its affiliates. All rights reserved.
22
// Licensed under the Universal Permissive License v 1.0 as shown at
33
// http://oss.oracle.com/licenses/upl.
4-
54
package oracle.kubernetes.operator;
65

76
import java.nio.file.Files;

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

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,14 @@ public void testCustomSitConfigOverridesForWldf() throws Exception {
234234
logger.log(Level.INFO, "SUCCESS - {0}", testMethod);
235235
}
236236

237+
/**
238+
* Create Domain using the custom domain script create-domain-auto-custom-sit-config20.py
239+
* Customizes the following attributes of the domain map configOverrides, configOverridesFile
240+
* domain uid , admin node port and t3 channel port.
241+
*
242+
* @return - created domain
243+
* @throws Exception - if it cannot create the domain
244+
*/
237245
private static Domain createSitConfigDomain() throws Exception {
238246
String createDomainScript = TESTSCRIPTDIR + "/domain-home-on-pv/create-domain.py";
239247
// load input yaml to map and add configOverrides
@@ -254,12 +262,23 @@ private static Domain createSitConfigDomain() throws Exception {
254262
return domain;
255263
}
256264

265+
/**
266+
* Destroys the domain
267+
*
268+
* @throws Exception
269+
*/
257270
private static void destroySitConfigDomain() throws Exception {
258271
if (domain != null) {
259272
domain.destroy();
260273
}
261274
}
262275

276+
/**
277+
* copy the configuration override files to a staging area after replacing the JDBC_URL token in
278+
* jdbc-JdbcTestDataSource-0.xml
279+
*
280+
* @throws IOException
281+
*/
263282
private static void copySitConfigFiles() throws IOException {
264283
String src_dir = TESTSCRIPTDIR + "/sitconfig/configoverrides";
265284
String dst_dir = sitconfigDir;
@@ -282,6 +301,11 @@ private static void copySitConfigFiles() throws IOException {
282301
}
283302
}
284303

304+
/**
305+
* Verifies the test run result doesn't contain any errors and exit status is 0
306+
*
307+
* @param result - ExecResult object containing result of the test run
308+
*/
285309
private void assertResult(ExecResult result) {
286310
logger.log(Level.INFO, result.stdout().trim());
287311
Assert.assertFalse(result.stdout().toLowerCase().contains("error"));

integration-tests/src/test/resources/sitconfig/java/SitConfigTests.java

Lines changed: 35 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,7 @@
3838
import weblogic.management.configuration.WLDFSystemResourceMBean;
3939
import weblogic.management.jmx.MBeanServerInvocationHandler;
4040
import weblogic.management.mbeanservers.domainruntime.DomainRuntimeServiceMBean;
41-
import weblogic.management.mbeanservers.edit.ConfigurationManagerMBean;
42-
import weblogic.management.mbeanservers.edit.EditServiceMBean;
4341
import weblogic.management.mbeanservers.runtime.RuntimeServiceMBean;
44-
import weblogic.management.runtime.DomainRuntimeMBean;
4542
import weblogic.management.runtime.ServerRuntimeMBean;
4643

4744
/**
@@ -64,17 +61,11 @@
6461
*/
6562
public class SitConfigTests {
6663

67-
private MBeanServerConnection domainRuntimeMbs, editMbs, runtimeMbs;
64+
private MBeanServerConnection runtimeMbs;
6865
private JMXConnector jmxConnector;
6966
private static ObjectName service;
70-
private DomainRuntimeMBean domainRuntimeMBean;
71-
private DomainRuntimeServiceMBean domainServiceMBean;
7267
private RuntimeServiceMBean runtimeServiceMBean;
7368
private ServerRuntimeMBean serverRuntime;
74-
private EditServiceMBean editServiceMBean;
75-
76-
private DomainMBean editdomain, editTree;
77-
private ConfigurationManagerMBean cfgMgr;
7869
private static final String JNDI = "/jndi/";
7970

8071
private final String adminHost;
@@ -129,12 +120,12 @@ public static void main(String args[]) throws Exception {
129120
}
130121

131122
/**
132-
* Constructor
123+
* Create connections to the MBean servers when the class is instantiated.
133124
*
134-
* @param adminHost
135-
* @param adminPort
136-
* @param adminUser
137-
* @param adminPassword
125+
* @param adminHost - administration server t3 public address
126+
* @param adminPort - administration server t3 public port
127+
* @param adminUser - administration server user name
128+
* @param adminPassword - - administration server password
138129
* @throws Exception
139130
*/
140131
public SitConfigTests(String adminHost, String adminPort, String adminUser, String adminPassword)
@@ -146,6 +137,12 @@ public SitConfigTests(String adminHost, String adminPort, String adminUser, Stri
146137
createConnections();
147138
}
148139

140+
/**
141+
* This method creates connection to the RuntimeMBean server Looks up the RuntimeService,
142+
* DomainRuntimeService and EditService MBeans needed by the tests.
143+
*
144+
* @throws Exception
145+
*/
149146
private void createConnections() throws Exception {
150147
runtimeMbs =
151148
lookupMBeanServerConnection(
@@ -154,40 +151,31 @@ private void createConnections() throws Exception {
154151
adminUser,
155152
adminPassword,
156153
RuntimeServiceMBean.MBEANSERVER_JNDI_NAME);
157-
domainRuntimeMbs =
158-
lookupMBeanServerConnection(
159-
adminHost,
160-
adminPort,
161-
adminUser,
162-
adminPassword,
163-
DomainRuntimeServiceMBean.MBEANSERVER_JNDI_NAME);
164-
editMbs =
165-
lookupMBeanServerConnection(
166-
adminHost, adminPort, adminUser, adminPassword, EditServiceMBean.MBEANSERVER_JNDI_NAME);
167-
168154
ObjectName runtimeserviceObjectName = new ObjectName(RuntimeServiceMBean.OBJECT_NAME);
169155
runtimeServiceMBean =
170156
(RuntimeServiceMBean)
171157
MBeanServerInvocationHandler.newProxyInstance(runtimeMbs, runtimeserviceObjectName);
172-
173158
ObjectName domainServiceObjectName = new ObjectName(DomainRuntimeServiceMBean.OBJECT_NAME);
174-
domainServiceMBean =
175-
(DomainRuntimeServiceMBean)
176-
MBeanServerInvocationHandler.newProxyInstance(
177-
domainRuntimeMbs, domainServiceObjectName);
178-
179-
ObjectName editserviceObjectName = new ObjectName(EditServiceMBean.OBJECT_NAME);
180-
editServiceMBean =
181-
(EditServiceMBean)
182-
MBeanServerInvocationHandler.newProxyInstance(editMbs, editserviceObjectName);
183159
}
184160

161+
/**
162+
* Method for creating a connection to a specific Mbean Server Accepts the following parameters
163+
*
164+
* @param host - Administration server hostname
165+
* @param adminPort - Administration server T3 channel port
166+
* @param user - - Administration server user name
167+
* @param adminPassword - - Administration server password
168+
* @param jndiName - jndi name of the MBean server
169+
* @return MBeanServerConnection - MBean server connection created
170+
* @throws MalformedURLException - throws MalformedURLException when URL is wrong
171+
* @throws IOException - throws IOException when it cannot connect the MBean server
172+
* @throws Exception - throws Exceptioni when created MBeanserver connection is null.
173+
*/
185174
private MBeanServerConnection lookupMBeanServerConnection(
186175
String host, String adminPort, String user, String adminPassword, String jndiName)
187176
throws MalformedURLException, IOException, Exception {
188177
JMXServiceURL serviceURL;
189178
MBeanServerConnection mBeanServerConnection;
190-
191179
println(
192180
"Host: "
193181
+ adminHost
@@ -331,6 +319,11 @@ protected void verifyT3ChannelMaxMessageSize(int expectedValue) {
331319
}
332320
}
333321

322+
/**
323+
* Looks up the ServerMBean from RuntimeServiceMBean
324+
*
325+
* @return
326+
*/
334327
private ServerMBean getServerMBean() {
335328
ServerMBean serverMBean = runtimeServiceMBean.getServerConfiguration();
336329
println("ServerMBean: " + serverMBean);
@@ -555,6 +548,11 @@ protected WLDFSystemResourceMBean getWLDFSystemModule(String resourceName) {
555548
return wldfResource;
556549
}
557550

551+
/**
552+
* prints messages
553+
*
554+
* @param msg - message to print
555+
*/
558556
protected static void println(String msg) {
559557
System.out.println("> " + msg);
560558
}

integration-tests/src/test/resources/sitconfig/mysql/mysql-dbservices.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
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 http://oss.oracle.com/licenses/upl.
3+
14
apiVersion: v1
25
kind: Namespace
36
metadata:

integration-tests/src/test/resources/sitconfig/scripts/runSitConfigTests.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
#!/bin/bash
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 http://oss.oracle.com/licenses/upl.
24

35
## The script is copied to the administration server weblogic server
46
## pod along with the SitConfigTests.java source file by the JUnit test

0 commit comments

Comments
 (0)