Skip to content

Commit 4534dc7

Browse files
committed
Checkstyle errors
1 parent 6c37274 commit 4534dc7

File tree

6 files changed

+48
-49
lines changed

6 files changed

+48
-49
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
import java.util.logging.SimpleFormatter;
1515
import javax.jms.Connection;
1616
import javax.jms.ConnectionFactory;
17+
1718
import oracle.kubernetes.operator.utils.Domain;
1819
import oracle.kubernetes.operator.utils.ExecCommand;
1920
import oracle.kubernetes.operator.utils.ExecResult;

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -227,12 +227,12 @@ public void testWeblogicLogSearch() throws Exception {
227227
String testMethodName = new Object() {}.getClass().getEnclosingMethod().getName();
228228
logTestBegin(testMethodName);
229229

230-
Map<String, Object> domainMap = domain.getDomainMap();
231-
String domainUid = domain.getDomainUid();
232-
String adminServerName = (String) domainMap.get("adminServerName");
233-
String adminServerPodName = domainUid + "-" + adminServerName;
234-
String managedServerNameBase = domainMap.get("managedServerNameBase").toString();
235-
String managedServerPodName = domainUid + "-" + managedServerNameBase + "1";
230+
final Map<String, Object> domainMap = domain.getDomainMap();
231+
final String domainUid = domain.getDomainUid();
232+
final String adminServerName = (String) domainMap.get("adminServerName");
233+
final String adminServerPodName = domainUid + "-" + adminServerName;
234+
final String managedServerNameBase = domainMap.get("managedServerNameBase").toString();
235+
final String managedServerPodName = domainUid + "-" + managedServerNameBase + "1";
236236

237237
// Wait 30 seconds for WLS log to be pushed to ELK Stack
238238
logger.info("Wait 30 seconds for WLS log to be pushed to ELK Stack");

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

Lines changed: 30 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,6 @@
44

55
package oracle.kubernetes.operator;
66

7-
import static org.junit.Assert.assertFalse;
8-
import static org.junit.Assert.assertNotNull;
9-
import static org.junit.Assert.assertTrue;
10-
11-
import com.gargoylesoftware.htmlunit.FailingHttpStatusCodeException;
12-
import com.gargoylesoftware.htmlunit.WebClient;
13-
import com.gargoylesoftware.htmlunit.html.HtmlFileInput;
14-
import com.gargoylesoftware.htmlunit.html.HtmlForm;
15-
import com.gargoylesoftware.htmlunit.html.HtmlPage;
16-
import com.gargoylesoftware.htmlunit.html.HtmlRadioButtonInput;
17-
import com.gargoylesoftware.htmlunit.html.HtmlSubmitInput;
187
import java.io.File;
198
import java.io.IOException;
209
import java.nio.charset.Charset;
@@ -26,6 +15,14 @@
2615
import java.util.Map;
2716
import java.util.logging.Level;
2817
import javax.xml.bind.DatatypeConverter;
18+
19+
import com.gargoylesoftware.htmlunit.FailingHttpStatusCodeException;
20+
import com.gargoylesoftware.htmlunit.WebClient;
21+
import com.gargoylesoftware.htmlunit.html.HtmlFileInput;
22+
import com.gargoylesoftware.htmlunit.html.HtmlForm;
23+
import com.gargoylesoftware.htmlunit.html.HtmlPage;
24+
import com.gargoylesoftware.htmlunit.html.HtmlRadioButtonInput;
25+
import com.gargoylesoftware.htmlunit.html.HtmlSubmitInput;
2926
import oracle.kubernetes.operator.utils.Domain;
3027
import oracle.kubernetes.operator.utils.ExecCommand;
3128
import oracle.kubernetes.operator.utils.ExecResult;
@@ -39,6 +36,10 @@
3936
import org.junit.Test;
4037
import org.junit.runners.MethodSorters;
4138

39+
import static org.junit.Assert.assertFalse;
40+
import static org.junit.Assert.assertNotNull;
41+
import static org.junit.Assert.assertTrue;
42+
4243
/** This test is used for testing Monitoring Exporter with Operator(s) . */
4344
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
4445
public class ItMonitoringExporter extends BaseTest {
@@ -797,7 +798,7 @@ public void test18_ChangeConfigEmptyPass() throws Exception {
797798
}
798799

799800
/**
800-
* Test End to End example from MonitoringExporter github project
801+
* Test End to End example from MonitoringExporter github project.
801802
*
802803
* @throws Exception if test fails
803804
*/
@@ -814,12 +815,12 @@ public void test19_EndToEndViaChart() throws Exception {
814815
}
815816
gitCloneMonitoringExporter();
816817
try {
817-
setupPVMYSQL();
818+
setupPvMysql();
818819
} catch (Exception ex) {
819820
deletePvDir();
820821
throw new RuntimeException("FAILURE: failed to install database ");
821822
}
822-
createWLSImageAndDeploy();
823+
createWlsImageAndDeploy();
823824
installWebHookAndAlertManager();
824825
installPrometheusGrafanaViaChart();
825826
fireAlert();
@@ -860,7 +861,7 @@ private void fireAlert() throws Exception {
860861
String command = "kubectl -n webhook logs " + webhookPod;
861862
ExecResult webhookResult = TestUtils.exec(command);
862863
logger.info(" webhook log " + webhookResult.stdout());
863-
assertTrue( webhookResult.stdout().contains("Some WLS cluster has only one running server for more than 1 minutes"));
864+
assertTrue(webhookResult.stdout().contains("Some WLS cluster has only one running server for more than 1 minutes"));
864865
}
865866

866867
private static String getPodName(String app, String namespace) throws Exception {
@@ -954,11 +955,11 @@ private HtmlPage submitConfigureForm(
954955

955956
/**
956957
* Remove monitoring exporter directory if exists and clone latest from github for monitoring
957-
* exporter code
958+
* exporter code.
958959
*
959960
* @throws Exception if could not run the command successfully to install database
960961
*/
961-
private static void setupPVMYSQL() throws Exception {
962+
private static void setupPvMysql() throws Exception {
962963
String pvDir = monitoringExporterEndToEndDir + "pvDir";
963964
if (new File(pvDir).exists()) {
964965
logger.info(" PV dir already exists , cleaning ");
@@ -1044,11 +1045,11 @@ private static void setupPVMYSQL() throws Exception {
10441045
}
10451046

10461047
/**
1047-
* Install wls image tool and update wls pods
1048+
* Install wls image tool and update wls pods.
10481049
*
10491050
* @throws Exception if could not run the command successfully to create WLSImage and deploy
10501051
*/
1051-
private static void createWLSImageAndDeploy() throws Exception {
1052+
private static void createWlsImageAndDeploy() throws Exception {
10521053
operator1 = TestUtils.createOperator(OPERATOR1_YAML);
10531054

10541055
String command =
@@ -1088,7 +1089,7 @@ private static void createWLSImageAndDeploy() throws Exception {
10881089
}
10891090

10901091
/**
1091-
* Install Prometheus and Grafana using helm chart
1092+
* Install Prometheus and Grafana using helm chart.
10921093
*
10931094
* @throws Exception if could not run the command successfully to install Prometheus and Grafana
10941095
*/
@@ -1114,7 +1115,8 @@ private static void installPrometheusGrafanaViaChart() throws Exception {
11141115
crdCmd = "kubectl apply -f " + monitoringExporterEndToEndDir + "/grafana/persistence.yaml";
11151116
TestUtils.exec(crdCmd);
11161117
crdCmd =
1117-
"kubectl --namespace monitoring create secret generic grafana-secret --from-literal=username=admin --from-literal=password=12345678";
1118+
"kubectl --namespace monitoring create secret generic grafana-secret"
1119+
+ " --from-literal=username=admin --from-literal=password=12345678";
11181120
TestUtils.exec(crdCmd);
11191121
logger.info("calling helm install for grafana");
11201122
crdCmd =
@@ -1147,7 +1149,7 @@ private static void installPrometheusGrafanaViaChart() throws Exception {
11471149
}
11481150

11491151
/**
1150-
* Install Prometheus and Grafana using helm chart
1152+
* Install Prometheus and Grafana using helm chart.
11511153
*
11521154
* @throws Exception if could not run the command successfully to install webhook and alert manager
11531155
*/
@@ -1170,7 +1172,7 @@ private static void installWebHookAndAlertManager() throws Exception {
11701172
}
11711173

11721174
/**
1173-
* Uninstall Prometheus and Grafana using helm chart
1175+
* Uninstall Prometheus and Grafana using helm chart.
11741176
*
11751177
* @throws Exception if could not run the command successfully to uninstall deployments
11761178
*/
@@ -1207,7 +1209,7 @@ private static void uninstallWebHookPrometheusGrafanaViaChart() throws Exception
12071209
}
12081210

12091211
/**
1210-
* Unnstall MYSQL
1212+
* Uninstall MYSQL.
12111213
*
12121214
* @throws Exception if could not run the command successfully to uninstall MySQL
12131215
*/
@@ -1226,7 +1228,7 @@ private static void uninstallMySQL() throws Exception {
12261228
}
12271229

12281230
/**
1229-
* Delete PvDir via docker
1231+
* Delete PvDir via docker.
12301232
*
12311233
* @throws Exception if could not run the command successfully to delete PV
12321234
*/
@@ -1246,7 +1248,7 @@ private static void deletePvDir() throws Exception {
12461248
}
12471249

12481250
/**
1249-
* A utility method to sed files
1251+
* A utility method to sed files.
12501252
*
12511253
* @throws IOException when copying files from source location to staging area fails
12521254
*/
@@ -1263,7 +1265,7 @@ private static void replaceStringInFile(String filePath, String oldValue, String
12631265

12641266
/**
12651267
* A utility method to copy Cross Namespaces RBAC yaml template file replacing the DOMAIN_NS,
1266-
* OPERATOR_NS
1268+
* OPERATOR_NS.
12671269
*
12681270
* @throws IOException when copying files from source location to staging area fails
12691271
*/
@@ -1283,7 +1285,7 @@ private static void createCrossNSRBACFile(String domainNS, String operatorNS) th
12831285
}
12841286

12851287
/**
1286-
* call operator to scale to specified number of replicas
1288+
* call operator to scale to specified number of replicas.
12871289
*
12881290
* @param replicas - number of managed servers
12891291
* @throws Exception if scaling fails

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

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,13 @@
33
// http://oss.oracle.com/licenses/upl.
44
package oracle.kubernetes.operator;
55

6-
import static oracle.kubernetes.operator.BaseTest.DOMAININIMAGE_WLST_YAML;
7-
import static oracle.kubernetes.operator.BaseTest.OPERATOR1_YAML;
8-
import static oracle.kubernetes.operator.BaseTest.QUICKTEST;
9-
import static oracle.kubernetes.operator.BaseTest.logger;
10-
116
import java.nio.file.Files;
127
import java.nio.file.Paths;
138
import java.util.ArrayList;
149
import java.util.List;
1510
import java.util.Map;
1611
import java.util.logging.Level;
12+
1713
import oracle.kubernetes.operator.utils.Domain;
1814
import oracle.kubernetes.operator.utils.ExecResult;
1915
import oracle.kubernetes.operator.utils.Operator;
@@ -41,8 +37,8 @@ public class ItOperatorUpgrade extends BaseTest {
4137
private static Operator operator;
4238

4339
/**
44-
* Creates operator based on operatorRelease passed to it and then creates a Weblogic domain
45-
* controlled by that operator
40+
* Creates operator based on operatorRelease passed to it and then creates a WebLogic domain
41+
* controlled by that operator.
4642
*
4743
* @param operatorGitRelease Git branch name of the operator release version
4844
* @param operatorRelease Operator release version from the

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
import javax.jms.QueueConnectionFactory;
3030
import javax.naming.Context;
3131
import javax.naming.InitialContext;
32+
3233
import oracle.kubernetes.operator.BaseTest;
3334
import org.yaml.snakeyaml.Yaml;
3435

@@ -913,17 +914,17 @@ protected void createPv() throws Exception {
913914

914915
logger.info("pvSharing for this domain is: " + pvSharing);
915916
if (!pvSharing) {
916-
pvMap.put("domainUID", domainUid);
917+
pvMap.put("domainUID", domainUid);
917918
} else {
918-
pvMap.put("baseName", "weblogic-sharing");
919+
pvMap.put("baseName", "weblogic-sharing");
919920
}
920921
logger.info("baseName of PVPVC for this domain is: " + (String) pvMap.get("baseName"));
921922

922923
// Now there is only one pvSharing test case and we just use parameter "baseName"+"-pvc" as PVC
923924
if ((domainUid != null) && !pvSharing) {
924925
domainMap.put("persistentVolumeClaimName", domainUid + "-" + pvMap.get("baseName") + "-pvc");
925926
} else {
926-
domainMap.put("persistentVolumeClaimName", pvMap.get("baseName") + "-pvc");
927+
domainMap.put("persistentVolumeClaimName", pvMap.get("baseName") + "-pvc");
927928
}
928929

929930
if (domainMap.get("weblogicDomainStorageReclaimPolicy") != null) {

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

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ public void addObjectNodeToClusterServerPod(String clusterName, String objectNam
176176

177177
for (Map.Entry<String, String> entry : attributes.entrySet()) {
178178
Object entryValue = entry.getValue();
179-
((ObjectNode) objectNode).put(entry.getKey(), (String) entryValue);
179+
((ObjectNode) objectNode).put(entry.getKey(), (String) entryValue);
180180
}
181181
}
182182

@@ -223,7 +223,7 @@ public void addObjectNodeToMS(String managedServerName, Map<String, String> attr
223223
* - A HashMap of key value pairs
224224
*/
225225
public void addObjectNodeToServerPod(String objectName, Map<String, String> attributes) {
226-
JsonNode objectNode = getObjectNodeFromServerPod(getSpecNode() ,objectName);
226+
JsonNode objectNode = getObjectNodeFromServerPod(getSpecNode(), objectName);
227227
for (Map.Entry<String, String> entry : attributes.entrySet()) {
228228
((ObjectNode) objectNode).put(entry.getKey(), entry.getValue());
229229
}
@@ -402,9 +402,8 @@ private JsonNode getObjectNodeFromServerPod(JsonNode serverPodsParentNode, Strin
402402

403403
} else {
404404
serverPodNode = serverPodsParentNode.path("serverPod");
405-
if(serverPodNode.path(objectName).isMissingNode())
406-
{
407-
logger.info("Creating node with name "+objectName);
405+
if (serverPodNode.path(objectName).isMissingNode()) {
406+
logger.info("Creating node with name " + objectName);
408407
objectNode = objectMapper.createObjectNode();
409408
((ObjectNode) serverPodNode).set(objectName, objectNode);
410409
} else {

0 commit comments

Comments
 (0)