Skip to content

Commit 2b86c52

Browse files
authored
Changes to test with other Coherence versions (#72)
* Changes to test with other Coherence versions
1 parent b8c05d3 commit 2b86c52

File tree

12 files changed

+492
-73
lines changed

12 files changed

+492
-73
lines changed

.github/workflows/validate.yml

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,32 @@ jobs:
1919
python-version: ["3.11.x"]
2020
poetry-version: ["1.5.0"]
2121
os: [ubuntu-latest]
22+
coherenceVersion:
23+
- 23.03.1
24+
- 22.06.5
25+
base-image:
26+
- gcr.io/distroless/java17-debian11
27+
profile:
28+
- ",-jakarta,javax"
29+
- ",jakarta,-javax"
30+
exclude:
31+
- coherenceVersion: 23.03.1
32+
profile: ",-jakarta,javax"
33+
- coherenceVersion: 22.06.5
34+
profile: ",jakarta,-javax"
35+
2236
runs-on: ${{ matrix.os }}
2337
steps:
2438
- name: Get Docker Images
2539
shell: bash
2640
run: |
27-
docker pull gcr.io/distroless/java17-debian11
41+
docker pull ${{ matrix.base-image }}
2842
uname -a
2943
3044
- name: Set up JDK
3145
uses: actions/setup-java@v3
3246
with:
33-
java-version: '11'
47+
java-version: '17'
3448
distribution: 'zulu'
3549

3650
- uses: actions/checkout@v4
@@ -62,4 +76,7 @@ jobs:
6276
- name: Run test
6377
shell: bash
6478
run: |
65-
python -m poetry run ./tests/scripts/run-tests.sh
79+
python -m poetry run ./tests/scripts/run-tests.sh \
80+
${{ matrix.coherenceVersion }} \
81+
${{ matrix.base-image }} \
82+
${{ matrix.profile }}

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,8 @@ $(BUILD_PROPS):
9595
.PHONY: build-test-images
9696
build-test-images: ## Build the Test images
9797
@echo "${MAVEN_BUILD_OPTS}"
98-
mvn -B -f tests/java/coherence-python-test clean package jib:dockerBuild -DskipTests -P member1$(PROFILES) -Djib.to.image=$(TEST_APPLICATION_IMAGE_1) -Dcoherence.test.base.image=$(COHERENCE_BASE_IMAGE) $(MAVEN_BUILD_OPTS)
99-
mvn -B -f tests/java/coherence-python-test clean package jib:dockerBuild -DskipTests -P member2$(PROFILES) -Djib.to.image=$(TEST_APPLICATION_IMAGE_2) -Dcoherence.test.base.image=$(COHERENCE_BASE_IMAGE) $(MAVEN_BUILD_OPTS)
98+
mvn -B -f tests/java clean package jib:dockerBuild -DskipTests -P member1$(PROFILES) -Djib.to.image=$(TEST_APPLICATION_IMAGE_1) -Dcoherence.test.base.image=$(COHERENCE_BASE_IMAGE) $(MAVEN_BUILD_OPTS)
99+
mvn -B -f tests/java clean package jib:dockerBuild -DskipTests -P member2$(PROFILES) -Djib.to.image=$(TEST_APPLICATION_IMAGE_2) -Dcoherence.test.base.image=$(COHERENCE_BASE_IMAGE) $(MAVEN_BUILD_OPTS)
100100
echo "CURRENT_UID=$(USER_ID)" >> $(ENV_FILE)
101101

102102

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
4+
Copyright (c) 2023, Oracle and/or its affiliates.
5+
Licensed under the Universal Permissive License v 1.0 as shown at
6+
https://oss.oracle.com/licenses/upl.
7+
8+
-->
9+
10+
<project xmlns="http://maven.apache.org/POM/4.0.0"
11+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
12+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
13+
<modelVersion>4.0.0</modelVersion>
14+
15+
<parent>
16+
<groupId>com.oracle.coherence.python</groupId>
17+
<artifactId>coherence-python-parent</artifactId>
18+
<version>1.0.0</version>
19+
<relativePath>../pom.xml</relativePath>
20+
</parent>
21+
22+
<artifactId>coherence-python-client-data-jakarta</artifactId>
23+
24+
<description>Oracle Coherence Python Client Data Jakarta</description>
25+
<name>coherence-python-client-data-jakarta</name>
26+
27+
<dependencies>
28+
<dependency>
29+
<groupId>${coherence.group.id}</groupId>
30+
<artifactId>coherence-json</artifactId>
31+
<version>${coherence.version}</version>
32+
</dependency>
33+
</dependencies>
34+
</project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
/*
2+
* Copyright (c) 2022, 2023 Oracle and/or its affiliates.
3+
* Licensed under the Universal Permissive License v 1.0 as shown at
4+
* https://oss.oracle.com/licenses/upl.
5+
*/
6+
7+
8+
package com.oracle.coherence.python.testing;
9+
10+
import java.io.Serializable;
11+
import java.util.Objects;
12+
import jakarta.json.bind.annotation.JsonbProperty;
13+
14+
/**
15+
* Class to represent an Australian address.
16+
*
17+
* @author Tim Middleton 2022-12-22
18+
*/
19+
public class Address
20+
implements Serializable {
21+
22+
@JsonbProperty("addressLine1")
23+
private String addressLine1;
24+
25+
@JsonbProperty("addressLine2")
26+
private String addressLine2;
27+
28+
@JsonbProperty("suburb")
29+
private String suburb;
30+
31+
@JsonbProperty("city")
32+
private String city;
33+
34+
@JsonbProperty("state")
35+
private String state;
36+
37+
@JsonbProperty("postcode")
38+
private int postCode;
39+
40+
public Address() {
41+
}
42+
43+
public Address(String addressLine1, String addressLine2, String suburb, String city, String state, int postCode) {
44+
this.addressLine1 = addressLine1;
45+
this.addressLine2 = addressLine2;
46+
this.suburb = suburb;
47+
this.city = city;
48+
this.state = state;
49+
this.postCode = postCode;
50+
}
51+
52+
public String getAddressLine1() {
53+
return addressLine1;
54+
}
55+
56+
public void setAddressLine1(String addressLine1) {
57+
this.addressLine1 = addressLine1;
58+
}
59+
60+
public String getAddressLine2() {
61+
return addressLine2;
62+
}
63+
64+
public void setAddressLine2(String addressLine2) {
65+
this.addressLine2 = addressLine2;
66+
}
67+
68+
public String getCity() {
69+
return city;
70+
}
71+
72+
public void setCity(String city) {
73+
this.city = city;
74+
}
75+
76+
public String getState() {
77+
return state;
78+
}
79+
80+
public void setState(String state) {
81+
this.state = state;
82+
}
83+
84+
public int getPostCode() {
85+
return postCode;
86+
}
87+
88+
public void setPostCode(int postCode) {
89+
this.postCode = postCode;
90+
}
91+
92+
public String getSuburb() {
93+
return suburb;
94+
}
95+
96+
public void setSuburb(String suburb) {
97+
this.suburb = suburb;
98+
}
99+
100+
@Override
101+
public boolean equals(Object o) {
102+
if (this == o) return true;
103+
if (o == null || getClass() != o.getClass()) return false;
104+
Address address = (Address) o;
105+
return postCode == address.postCode && Objects.equals(addressLine1, address.addressLine1) &&
106+
Objects.equals(addressLine2, address.addressLine2) && Objects.equals(suburb, address.suburb) &&
107+
Objects.equals(city, address.city) && Objects.equals(state, address.state);
108+
}
109+
110+
@Override
111+
public int hashCode() {
112+
return Objects.hash(addressLine1, addressLine2, suburb, city, state, postCode);
113+
}
114+
115+
@Override
116+
public String toString() {
117+
return "Address{" +
118+
"addressLine1='" + addressLine1 + '\'' +
119+
", addressLine2='" + addressLine2 + '\'' +
120+
", suburb='" + suburb + '\'' +
121+
", city='" + city + '\'' +
122+
", state='" + state + '\'' +
123+
", postCode=" + postCode +
124+
'}';
125+
}
126+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,143 @@
1+
/*
2+
* Copyright (c) 2022, 2023 Oracle and/or its affiliates.
3+
* Licensed under the Universal Permissive License v 1.0 as shown at
4+
* https://oss.oracle.com/licenses/upl.
5+
*/
6+
7+
8+
package com.oracle.coherence.python.testing;
9+
10+
import java.io.Serializable;
11+
import jakarta.json.bind.annotation.JsonbProperty;
12+
13+
/**
14+
* Class to represent a customer.
15+
*
16+
* @author Tim Middleton 2022-12-22
17+
*/
18+
public class Customer
19+
implements Serializable {
20+
21+
@JsonbProperty("id")
22+
private int id;
23+
24+
@JsonbProperty("customerName")
25+
private String customerName;
26+
27+
@JsonbProperty("homeAddress")
28+
private Address homeAddress;
29+
30+
@JsonbProperty("postalAddress")
31+
private Address postalAddress;
32+
33+
@JsonbProperty("customerType")
34+
private String customerType;
35+
36+
@JsonbProperty("outstandingBalance")
37+
private double outstandingBalance;
38+
39+
public static final String BRONZE = "BRONZE";
40+
public static final String SILVER = "SILVER";
41+
public static final String GOLD = "GOLD";
42+
43+
public Customer() {}
44+
45+
public Customer(int id, String customerName, Address officeAddress, Address postalAddress, String customerType, double outstandingBalance) {
46+
this.id = id;
47+
this.customerName = customerName;
48+
this.homeAddress = officeAddress;
49+
this.postalAddress = postalAddress;
50+
this.customerType = customerType;
51+
this.outstandingBalance = outstandingBalance;
52+
}
53+
54+
55+
@Override
56+
public String toString() {
57+
return "Customer{" +
58+
"id=" + id +
59+
", customerName='" + customerName + '\'' +
60+
", officeAddress=" + homeAddress +
61+
", postalAddress=" + postalAddress +
62+
", customerType='" + customerType + '\'' +
63+
", outstandingBalance=" + outstandingBalance +
64+
'}';
65+
}
66+
67+
@Override
68+
public boolean equals(Object o) {
69+
if (this == o) return true;
70+
if (o == null || getClass() != o.getClass()) return false;
71+
72+
Customer customer = (Customer) o;
73+
74+
if (id != customer.id) return false;
75+
if (Double.compare(customer.outstandingBalance, outstandingBalance) != 0) return false;
76+
if (customerName != null ? !customerName.equals(customer.customerName) : customer.customerName != null) return false;
77+
if (homeAddress != null ? !homeAddress.equals(customer.homeAddress) : customer.homeAddress != null) return false;
78+
if (postalAddress != null ? !postalAddress.equals(customer.postalAddress) : customer.postalAddress != null) return false;
79+
return customerType != null ? customerType.equals(customer.customerType) : customer.customerType == null;
80+
}
81+
82+
@Override
83+
public int hashCode() {
84+
int result;
85+
long temp;
86+
result = id;
87+
result = 31 * result + (customerName != null ? customerName.hashCode() : 0);
88+
result = 31 * result + (homeAddress != null ? homeAddress.hashCode() : 0);
89+
result = 31 * result + (postalAddress != null ? postalAddress.hashCode() : 0);
90+
result = 31 * result + (customerType != null ? customerType.hashCode() : 0);
91+
temp = Double.doubleToLongBits(outstandingBalance);
92+
result = 31 * result + (int) (temp ^ (temp >>> 32));
93+
return result;
94+
}
95+
96+
public int getId() {
97+
return id;
98+
}
99+
100+
public void setId(int id) {
101+
this.id = id;
102+
}
103+
104+
public String getCustomerName() {
105+
return customerName;
106+
}
107+
108+
public void setCustomerName(String customerName) {
109+
this.customerName = customerName;
110+
}
111+
112+
public Address getHomeAddress() {
113+
return homeAddress;
114+
}
115+
116+
public void setHomeAddress(Address homeAddress) {
117+
this.homeAddress = homeAddress;
118+
}
119+
120+
public Address getPostalAddress() {
121+
return postalAddress;
122+
}
123+
124+
public void setPostalAddress(Address postalAddress) {
125+
this.postalAddress = postalAddress;
126+
}
127+
128+
public String getCustomerType() {
129+
return customerType;
130+
}
131+
132+
public void setCustomerType(String customerType) {
133+
this.customerType = customerType;
134+
}
135+
136+
public double getOutstandingBalance() {
137+
return outstandingBalance;
138+
}
139+
140+
public void setOutstandingBalance(double outstandingBalance) {
141+
this.outstandingBalance = outstandingBalance;
142+
}
143+
}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
4+
Copyright (c) 2023, Oracle and/or its affiliates.
5+
Licensed under the Universal Permissive License v 1.0 as shown at
6+
https://oss.oracle.com/licenses/upl.
7+
8+
-->
9+
10+
<project xmlns="http://maven.apache.org/POM/4.0.0"
11+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
12+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
13+
<modelVersion>4.0.0</modelVersion>
14+
15+
<parent>
16+
<groupId>com.oracle.coherence.python</groupId>
17+
<artifactId>coherence-python-parent</artifactId>
18+
<version>1.0.0</version>
19+
<relativePath>../pom.xml</relativePath>
20+
</parent>
21+
22+
<artifactId>coherence-python-client-data-javax</artifactId>
23+
24+
<description>Oracle Coherence Python Client Data Javax</description>
25+
<name>coherence-python-client-data-javax</name>
26+
27+
<dependencies>
28+
<dependency>
29+
<groupId>${coherence.group.id}</groupId>
30+
<artifactId>coherence-json</artifactId>
31+
<version>${coherence.version}</version>
32+
</dependency>
33+
</dependencies>
34+
</project>

0 commit comments

Comments
 (0)