Skip to content

Changes to test with other Coherence versions #72

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Sep 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 20 additions & 3 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,32 @@ jobs:
python-version: ["3.11.x"]
poetry-version: ["1.5.0"]
os: [ubuntu-latest]
coherenceVersion:
- 23.03.1
- 22.06.5
base-image:
- gcr.io/distroless/java17-debian11
profile:
- ",-jakarta,javax"
- ",jakarta,-javax"
exclude:
- coherenceVersion: 23.03.1
profile: ",-jakarta,javax"
- coherenceVersion: 22.06.5
profile: ",jakarta,-javax"

runs-on: ${{ matrix.os }}
steps:
- name: Get Docker Images
shell: bash
run: |
docker pull gcr.io/distroless/java17-debian11
docker pull ${{ matrix.base-image }}
uname -a

- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version: '11'
java-version: '17'
distribution: 'zulu'

- uses: actions/checkout@v4
Expand Down Expand Up @@ -62,4 +76,7 @@ jobs:
- name: Run test
shell: bash
run: |
python -m poetry run ./tests/scripts/run-tests.sh
python -m poetry run ./tests/scripts/run-tests.sh \
${{ matrix.coherenceVersion }} \
${{ matrix.base-image }} \
${{ matrix.profile }}
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@ $(BUILD_PROPS):
.PHONY: build-test-images
build-test-images: ## Build the Test images
@echo "${MAVEN_BUILD_OPTS}"
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)
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)
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)
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)
echo "CURRENT_UID=$(USER_ID)" >> $(ENV_FILE)


Expand Down
34 changes: 34 additions & 0 deletions tests/java/coherence-python-client-data-jakarta/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--

Copyright (c) 2023, Oracle and/or its affiliates.
Licensed under the Universal Permissive License v 1.0 as shown at
https://oss.oracle.com/licenses/upl.

-->

<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>com.oracle.coherence.python</groupId>
<artifactId>coherence-python-parent</artifactId>
<version>1.0.0</version>
<relativePath>../pom.xml</relativePath>
</parent>

<artifactId>coherence-python-client-data-jakarta</artifactId>

<description>Oracle Coherence Python Client Data Jakarta</description>
<name>coherence-python-client-data-jakarta</name>

<dependencies>
<dependency>
<groupId>${coherence.group.id}</groupId>
<artifactId>coherence-json</artifactId>
<version>${coherence.version}</version>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
/*
* Copyright (c) 2022, 2023 Oracle and/or its affiliates.
* Licensed under the Universal Permissive License v 1.0 as shown at
* https://oss.oracle.com/licenses/upl.
*/


package com.oracle.coherence.python.testing;

import java.io.Serializable;
import java.util.Objects;
import jakarta.json.bind.annotation.JsonbProperty;

/**
* Class to represent an Australian address.
*
* @author Tim Middleton 2022-12-22
*/
public class Address
implements Serializable {

@JsonbProperty("addressLine1")
private String addressLine1;

@JsonbProperty("addressLine2")
private String addressLine2;

@JsonbProperty("suburb")
private String suburb;

@JsonbProperty("city")
private String city;

@JsonbProperty("state")
private String state;

@JsonbProperty("postcode")
private int postCode;

public Address() {
}

public Address(String addressLine1, String addressLine2, String suburb, String city, String state, int postCode) {
this.addressLine1 = addressLine1;
this.addressLine2 = addressLine2;
this.suburb = suburb;
this.city = city;
this.state = state;
this.postCode = postCode;
}

public String getAddressLine1() {
return addressLine1;
}

public void setAddressLine1(String addressLine1) {
this.addressLine1 = addressLine1;
}

public String getAddressLine2() {
return addressLine2;
}

public void setAddressLine2(String addressLine2) {
this.addressLine2 = addressLine2;
}

public String getCity() {
return city;
}

public void setCity(String city) {
this.city = city;
}

public String getState() {
return state;
}

public void setState(String state) {
this.state = state;
}

public int getPostCode() {
return postCode;
}

public void setPostCode(int postCode) {
this.postCode = postCode;
}

public String getSuburb() {
return suburb;
}

public void setSuburb(String suburb) {
this.suburb = suburb;
}

@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Address address = (Address) o;
return postCode == address.postCode && Objects.equals(addressLine1, address.addressLine1) &&
Objects.equals(addressLine2, address.addressLine2) && Objects.equals(suburb, address.suburb) &&
Objects.equals(city, address.city) && Objects.equals(state, address.state);
}

@Override
public int hashCode() {
return Objects.hash(addressLine1, addressLine2, suburb, city, state, postCode);
}

@Override
public String toString() {
return "Address{" +
"addressLine1='" + addressLine1 + '\'' +
", addressLine2='" + addressLine2 + '\'' +
", suburb='" + suburb + '\'' +
", city='" + city + '\'' +
", state='" + state + '\'' +
", postCode=" + postCode +
'}';
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
/*
* Copyright (c) 2022, 2023 Oracle and/or its affiliates.
* Licensed under the Universal Permissive License v 1.0 as shown at
* https://oss.oracle.com/licenses/upl.
*/


package com.oracle.coherence.python.testing;

import java.io.Serializable;
import jakarta.json.bind.annotation.JsonbProperty;

/**
* Class to represent a customer.
*
* @author Tim Middleton 2022-12-22
*/
public class Customer
implements Serializable {

@JsonbProperty("id")
private int id;

@JsonbProperty("customerName")
private String customerName;

@JsonbProperty("homeAddress")
private Address homeAddress;

@JsonbProperty("postalAddress")
private Address postalAddress;

@JsonbProperty("customerType")
private String customerType;

@JsonbProperty("outstandingBalance")
private double outstandingBalance;

public static final String BRONZE = "BRONZE";
public static final String SILVER = "SILVER";
public static final String GOLD = "GOLD";

public Customer() {}

public Customer(int id, String customerName, Address officeAddress, Address postalAddress, String customerType, double outstandingBalance) {
this.id = id;
this.customerName = customerName;
this.homeAddress = officeAddress;
this.postalAddress = postalAddress;
this.customerType = customerType;
this.outstandingBalance = outstandingBalance;
}


@Override
public String toString() {
return "Customer{" +
"id=" + id +
", customerName='" + customerName + '\'' +
", officeAddress=" + homeAddress +
", postalAddress=" + postalAddress +
", customerType='" + customerType + '\'' +
", outstandingBalance=" + outstandingBalance +
'}';
}

@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;

Customer customer = (Customer) o;

if (id != customer.id) return false;
if (Double.compare(customer.outstandingBalance, outstandingBalance) != 0) return false;
if (customerName != null ? !customerName.equals(customer.customerName) : customer.customerName != null) return false;
if (homeAddress != null ? !homeAddress.equals(customer.homeAddress) : customer.homeAddress != null) return false;
if (postalAddress != null ? !postalAddress.equals(customer.postalAddress) : customer.postalAddress != null) return false;
return customerType != null ? customerType.equals(customer.customerType) : customer.customerType == null;
}

@Override
public int hashCode() {
int result;
long temp;
result = id;
result = 31 * result + (customerName != null ? customerName.hashCode() : 0);
result = 31 * result + (homeAddress != null ? homeAddress.hashCode() : 0);
result = 31 * result + (postalAddress != null ? postalAddress.hashCode() : 0);
result = 31 * result + (customerType != null ? customerType.hashCode() : 0);
temp = Double.doubleToLongBits(outstandingBalance);
result = 31 * result + (int) (temp ^ (temp >>> 32));
return result;
}

public int getId() {
return id;
}

public void setId(int id) {
this.id = id;
}

public String getCustomerName() {
return customerName;
}

public void setCustomerName(String customerName) {
this.customerName = customerName;
}

public Address getHomeAddress() {
return homeAddress;
}

public void setHomeAddress(Address homeAddress) {
this.homeAddress = homeAddress;
}

public Address getPostalAddress() {
return postalAddress;
}

public void setPostalAddress(Address postalAddress) {
this.postalAddress = postalAddress;
}

public String getCustomerType() {
return customerType;
}

public void setCustomerType(String customerType) {
this.customerType = customerType;
}

public double getOutstandingBalance() {
return outstandingBalance;
}

public void setOutstandingBalance(double outstandingBalance) {
this.outstandingBalance = outstandingBalance;
}
}
34 changes: 34 additions & 0 deletions tests/java/coherence-python-client-data-javax/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--

Copyright (c) 2023, Oracle and/or its affiliates.
Licensed under the Universal Permissive License v 1.0 as shown at
https://oss.oracle.com/licenses/upl.

-->

<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>com.oracle.coherence.python</groupId>
<artifactId>coherence-python-parent</artifactId>
<version>1.0.0</version>
<relativePath>../pom.xml</relativePath>
</parent>

<artifactId>coherence-python-client-data-javax</artifactId>

<description>Oracle Coherence Python Client Data Javax</description>
<name>coherence-python-client-data-javax</name>

<dependencies>
<dependency>
<groupId>${coherence.group.id}</groupId>
<artifactId>coherence-json</artifactId>
<version>${coherence.version}</version>
</dependency>
</dependencies>
</project>
Loading