Skip to content

Commit 6cc6fbc

Browse files
committed
Merge branch 'OWLS-123702' into 'release/4.2'
Add cross domain transaction tests with JMS provider in K8s and JMS client in on prem domain See merge request weblogic-cloud/weblogic-kubernetes-operator!4893
2 parents 8f96855 + 6197cf7 commit 6cc6fbc

File tree

11 files changed

+417
-125
lines changed

11 files changed

+417
-125
lines changed

Jenkinsfile.podman

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -469,6 +469,8 @@ nodes:
469469
hostPort: 2228
470470
- containerPort: 31132
471471
hostPort: 8001
472+
- containerPort: 31136
473+
hostPort: 2232
472474
extraMounts:
473475
- hostPath: ${pv_root}
474476
containerPath: ${pv_root}

integration-tests/src/test/java/oracle/weblogic/kubernetes/ItOnPremCrossDomainTransaction.java

Lines changed: 334 additions & 121 deletions
Large diffs are not rendered by default.

integration-tests/src/test/java/oracle/weblogic/kubernetes/TestConstants.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -571,5 +571,7 @@ public interface TestConstants {
571571

572572
public static final int IT_ONPREMCRDOMAINTX_INGRESS_HTTP_NODEPORT = 31132;
573573
public static final int IT_ONPREMCRDOMAINTX_INGRESS_HTTP_HOSTPORT = 8001;
574+
public static final int IT_ONPREMCRDOMAINTX_CLUSTER_NODEPORT = 31136;
575+
public static final int IT_ONPREMCRDOMAINTX_CLUSTER_HOSTPORT = 2232;
574576

575577
}

integration-tests/src/test/java/oracle/weblogic/kubernetes/actions/impl/AppBuilder.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,7 @@ public boolean archiveApp() {
244244
List<String> srcFiles = params.srcDirList();
245245
String srcFile = srcFiles.get(0);
246246
String appName = srcFile.substring(srcFile.lastIndexOf("/") + 1, srcFile.lastIndexOf("."));
247+
params.appName(appName);
247248
String archiveSrcDir = params.appArchiveDir() + "/wlsdeploy/applications";
248249

249250
try {

integration-tests/src/test/java/oracle/weblogic/kubernetes/utils/FileUtils.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -496,8 +496,8 @@ public static void replaceStringInFile(String filePath, String regex, String rep
496496
Path src = Paths.get(filePath);
497497
logger.info("Replacing {0} in {1} with {2}", regex, src.toString(), replacement);
498498
String content = new String(Files.readAllBytes(src), StandardCharsets.UTF_8);
499-
if (!content.contains(regex)) {
500-
logger.info("search string {0} not found to replace with {1}", regex, replacement);
499+
if (!content.matches(regex)) {
500+
logger.warning("search string {0} not found to replace with {1}", regex, replacement);
501501
}
502502
long oldModified = src.toFile().lastModified();
503503
Files.write(src, content.replaceAll(regex, replacement).getBytes(StandardCharsets.UTF_8));

integration-tests/src/test/resources/apps/mdbtopic/src/application/MdbTopic.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,9 @@ public void onMessage (Message msg) {
7979

8080
ConnectionFactory
8181
cf=(ConnectionFactory)cxt.lookup("weblogic.jms.ConnectionFactory");
82+
System.out.println("<TMDB> weblogic.jms.ConnectionFactory lookup successful in local domain");
8283
Destination rq=(Destination)cxt.lookup("jms.testAccountingQueue");
84+
System.out.println("<TMDB> jms.testAccountingQueue lookup successful in local domain");
8385
JMSContext context = cf.createContext();
8486
tmsg = context.createTextMessage("(On Server) " + serverRuntime.getName());
8587
context.createProducer().send(rq,tmsg);
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Copyright (c) 2024, Oracle and/or its affiliates.
2+
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
3+
4+
hostname=sys.argv[1]
5+
connect('weblogic','welcome1','t3://'+hostname+':7001')
6+
serverRuntime()
7+
cd('JMSRuntime/admin-server.jms/JMSServers/TestAdminJmsServer/Destinations/TestAdminJmsModule!testAccountingQueue')
8+
ls()
9+
count=cmo.getMessagesCurrentCount()
10+
print 'messagesgot='+str(count)
11+
disconnect()
12+
exit()
13+

integration-tests/src/test/resources/onpremcrtx/model-crossdomaintransaction-domain1.properties

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,3 @@
44
DOMAIN_NAME=domain1
55
ADMIN_USERNAME=weblogic
66
ADMIN_PASSWORD=welcome1
7-

integration-tests/src/test/resources/onpremcrtx/model-crossdomaintransaction-domain1.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ topology:
1616
ServerNamePrefix: "managed-server"
1717
DynamicClusterSize: 2
1818
MaxDynamicClusterSize: 2
19-
CalculatedListenPorts: false
19+
CalculatedListenPorts: '@@PROP:CALCULATED_LISTENPORTS@@'
2020
Server:
2121
"admin-server":
2222
ListenPort: 7001
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Copyright (c) 2024, Oracle and/or its affiliates.
2+
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
3+
4+
domainInfo:
5+
AdminUserName: '@@PROP:ADMIN_USERNAME@@'
6+
AdminPassword: '@@PROP:ADMIN_PASSWORD@@'
7+
ServerStartMode: 'prod'
8+
9+
topology:
10+
Name: '@@PROP:DOMAIN_NAME@@'
11+
AdminServerName: "admin-server"
12+
Cluster:
13+
"cluster-1":
14+
DynamicServers:
15+
ServerTemplate: "cluster-1-template"
16+
ServerNamePrefix: "managed-server"
17+
DynamicClusterSize: 2
18+
MaxDynamicClusterSize: 2
19+
CalculatedListenPorts: '@@PROP:CALCULATED_LISTENPORTS@@'
20+
Server:
21+
"admin-server":
22+
ListenPort: 7001
23+
ServerTemplate:
24+
"cluster-1-template":
25+
Cluster: "cluster-1"
26+
ListenPort : 9001
27+
NetworkAccessPoint:
28+
MyT3Channel:
29+
Protocol: 't3'
30+
ListenPort: 7999
31+
PublicPort: '@@PROP:PUBLIC_LB_PORT@@'
32+
PublicAddress: '@@PROP:PUBLIC_LB_ADDRESS@@'
33+
HttpEnabledForThisProtocol: true
34+
TunnelingEnabled: true
35+
OutboundEnabled: false
36+
Enabled: true
37+
TwoWaySSLEnabled: false
38+
ClientCertificateEnforced: false

0 commit comments

Comments
 (0)