Skip to content

Commit

Permalink
* Set new parent (with jdk 17).
Browse files Browse the repository at this point in the history
* Updated CI yaml files.
* Removed slf4j from dependencies.
* Cleanup poms.
  • Loading branch information
artem-v committed Oct 6, 2024
1 parent 270366f commit 825b833
Show file tree
Hide file tree
Showing 24 changed files with 557 additions and 386 deletions.
17 changes: 8 additions & 9 deletions .github/workflows/branch-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,25 +14,24 @@ jobs:
name: Branch CI
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v1
- uses: actions/checkout@v4
- uses: actions/cache@v3
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Set up JDK 1.8
uses: actions/setup-java@v1
- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: 1.8
java-version: 17
distribution: zulu
server-id: github
server-username: GITHUB_ACTOR
server-password: GITHUB_TOKEN
- name: Maven Build
run: mvn clean install -DskipTests=true -Dmaven.javadoc.skip=true -Ddockerfile.skip=true -B -V
run: mvn clean install -DskipTests=true -Dmaven.javadoc.skip=true -B -V
env:
GITHUB_TOKEN: ${{ secrets.ORGANIZATION_TOKEN }}
- name: Maven Verify
run: |
sudo echo "127.0.0.1 $(eval hostname)" | sudo tee -a /etc/hosts
mvn verify -B
run: mvn verify -B
15 changes: 8 additions & 7 deletions .github/workflows/pre-release-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,23 @@ jobs:
name: Pre-release CI
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v1
- uses: actions/checkout@v4
- uses: actions/cache@v3
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Set up Java for publishing to GitHub Packages
uses: actions/setup-java@v1
uses: actions/setup-java@v4
with:
java-version: 1.8
java-version: 17
distribution: zulu
server-id: github
server-username: GITHUB_ACTOR
server-password: GITHUB_TOKEN
- name: Deploy pre-release version to GitHub Packages
run: |
sudo echo "127.0.0.1 $(eval hostname)" | sudo tee -a /etc/hosts
pre_release_version=${{ github.event.release.tag_name }}
echo Pre-release version $pre_release_version
mvn versions:set -DnewVersion=$pre_release_version -DgenerateBackupPoms=false
Expand All @@ -34,9 +34,10 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.ORGANIZATION_TOKEN }}
- name: Set up Java for publishing to Maven Central Repository
uses: actions/setup-java@v1
uses: actions/setup-java@v4
with:
java-version: 1.8
java-version: 17
distribution: zulu
server-id: ossrh
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
Expand Down
24 changes: 12 additions & 12 deletions .github/workflows/release-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,31 +9,30 @@ jobs:
name: Release CI
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
fetch-depth: 0
- run: git checkout ${{ github.event.release.target_commitish }}
- uses: actions/cache@v1
- uses: actions/cache@v3
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Set up Java for publishing to GitHub Packages
uses: actions/setup-java@v1
uses: actions/setup-java@v4
with:
java-version: 1.8
java-version: 17
distribution: zulu
server-id: github
server-username: GITHUB_ACTOR
server-password: GITHUB_TOKEN
- name: Maven Build
run: mvn clean install -DskipTests=true -Ddockerfile.skip=true -B -V
run: mvn clean install -DskipTests=true -B -V
env:
GITHUB_TOKEN: ${{ secrets.ORGANIZATION_TOKEN }}
- name: Maven Verify
run: |
sudo echo "127.0.0.1 $(eval hostname)" | sudo tee -a /etc/hosts
mvn verify -B
run: mvn verify -B
- name: Configure git
run: |
git config --global user.email "${GITHUB_ACTOR}@users.noreply.github.com"
Expand All @@ -43,17 +42,18 @@ jobs:
run: |
mvn -B build-helper:parse-version release:prepare \
-DreleaseVersion=\${parsedVersion.majorVersion}.\${parsedVersion.minorVersion}.\${parsedVersion.incrementalVersion} \
-Darguments="-DskipTests=true -Ddockerfile.skip=true"
-Darguments="-DskipTests=true"
echo release_tag=$(git describe --tags --abbrev=0) >> $GITHUB_OUTPUT
- name: Perform release
run: mvn -B release:perform -Pdeploy2Github -Darguments="-DskipTests=true -Ddockerfile.skip=true -Pdeploy2Github"
run: mvn -B release:perform -Pdeploy2Github -Darguments="-DskipTests=true -Pdeploy2Github"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_REPOSITORY: ${{ secrets.GITHUB_REPOSITORY }}
- name: Set up Java for publishing to Maven Central Repository
uses: actions/setup-java@v1
uses: actions/setup-java@v4
with:
java-version: 1.8
java-version: 17
distribution: zulu
server-id: ossrh
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
Expand Down
14 changes: 14 additions & 0 deletions checkstyle-suppressions.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0"?>

<!DOCTYPE suppressions PUBLIC
"-//Checkstyle//DTD SuppressionFilter Configuration 1.0//EN"
"https://checkstyle.org/dtds/suppressions_1_0.dtd">


<suppressions>
<suppress checks="AbbreviationAsWordInName" files=".*"/>
<suppress checks="MissingJavadocTypeCheck" files=".*"/>
<suppress checks="MissingJavadocMethodCheck" files=".*"/>
<suppress checks="MissingSwitchDefault" files=".*"/>
<suppress checks="VariableDeclarationUsageDistance" files=".*"/>
</suppressions>
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package io.scalecube.cluster.utils;

import io.scalecube.cluster.transport.api.Message;
import java.lang.System.Logger;
import java.lang.System.Logger.Level;
import java.time.Duration;
import java.util.Arrays;
import java.util.Collection;
Expand All @@ -9,8 +11,6 @@
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ThreadLocalRandom;
import java.util.concurrent.atomic.AtomicLong;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import reactor.core.publisher.Mono;

/**
Expand All @@ -24,7 +24,7 @@
*/
public final class NetworkEmulator {

private static final Logger LOGGER = LoggerFactory.getLogger(NetworkEmulator.class);
private static final Logger LOGGER = System.getLogger(NetworkEmulator.class.getName());

private volatile OutboundSettings defaultOutboundSettings = new OutboundSettings(0, 0);
private volatile InboundSettings defaultInboundSettings = new InboundSettings(true);
Expand Down Expand Up @@ -69,7 +69,8 @@ public OutboundSettings outboundSettings(String destination) {
public void outboundSettings(String destination, int lossPercent, int meanDelay) {
OutboundSettings settings = new OutboundSettings(lossPercent, meanDelay);
outboundSettings.put(destination, settings);
LOGGER.debug("[{}] Set outbound settings {} to {}", address, settings, destination);
LOGGER.log(
Level.DEBUG, "[{0}] Set outbound settings {1} to {2}", address, settings, destination);
}

/**
Expand All @@ -80,21 +81,22 @@ public void outboundSettings(String destination, int lossPercent, int meanDelay)
*/
public void setDefaultOutboundSettings(int lossPercent, int meanDelay) {
defaultOutboundSettings = new OutboundSettings(lossPercent, meanDelay);
LOGGER.debug("[{}] Set default outbound settings {}", address, defaultOutboundSettings);
LOGGER.log(
Level.DEBUG, "[{0}] Set default outbound settings {1}", address, defaultOutboundSettings);
}

/** Blocks outbound messages to all destinations. */
public void blockAllOutbound() {
outboundSettings.clear();
setDefaultOutboundSettings(100, 0);
LOGGER.debug("[{}] Blocked outbound to all destinations", address);
LOGGER.log(Level.DEBUG, "[{0}] Blocked outbound to all destinations", address);
}

/** Unblocks outbound messages to all destinations. */
public void unblockAllOutbound() {
outboundSettings.clear();
setDefaultOutboundSettings(0, 0);
LOGGER.debug("[{}] Unblocked outbound to all destinations", address);
LOGGER.log(Level.DEBUG, "[{0}] Unblocked outbound to all destinations", address);
}

/**
Expand All @@ -115,7 +117,7 @@ public void blockOutbound(Collection<String> destinations) {
for (String destination : destinations) {
outboundSettings.put(destination, new OutboundSettings(100, 0));
}
LOGGER.debug("[{}] Blocked outbound to {}", address, destinations);
LOGGER.log(Level.DEBUG, "[{0}] Blocked outbound to {1}", address, destinations);
}

/**
Expand All @@ -134,7 +136,7 @@ public void unblockOutbound(String... destinations) {
*/
public void unblockOutbound(Collection<String> destinations) {
destinations.forEach(outboundSettings::remove);
LOGGER.debug("[{}] Unblocked outbound {}", address, destinations);
LOGGER.log(Level.DEBUG, "[{0}] Unblocked outbound {1}", address, destinations);
}

/**
Expand Down Expand Up @@ -220,7 +222,8 @@ public InboundSettings inboundSettings(String destination) {
public void inboundSettings(String destination, boolean shallPass) {
InboundSettings settings = new InboundSettings(shallPass);
inboundSettings.put(destination, settings);
LOGGER.debug("[{}] Set inbound settings {} to {}", address, settings, destination);
LOGGER.log(
Level.DEBUG, "[{0}] Set inbound settings {1} to {2}", address, settings, destination);
}

/**
Expand All @@ -230,21 +233,22 @@ public void inboundSettings(String destination, boolean shallPass) {
*/
public void setDefaultInboundSettings(boolean shallPass) {
defaultInboundSettings = new InboundSettings(shallPass);
LOGGER.debug("[{}] Set default inbound settings {}", address, defaultInboundSettings);
LOGGER.log(
Level.DEBUG, "[{0}] Set default inbound settings {1}", address, defaultInboundSettings);
}

/** Blocks inbound messages from all destinations. */
public void blockAllInbound() {
inboundSettings.clear();
setDefaultInboundSettings(false);
LOGGER.debug("[{}] Blocked inbound from all destinations", address);
LOGGER.log(Level.DEBUG, "[{0}] Blocked inbound from all destinations", address);
}

/** Unblocks inbound messages to all destinations. */
public void unblockAllInbound() {
inboundSettings.clear();
setDefaultInboundSettings(true);
LOGGER.debug("[{}] Unblocked inbound from all destinations", address);
LOGGER.log(Level.DEBUG, "[{0}] Unblocked inbound from all destinations", address);
}

/**
Expand All @@ -265,7 +269,7 @@ public void blockInbound(Collection<String> destinations) {
for (String destination : destinations) {
inboundSettings.put(destination, new InboundSettings(false));
}
LOGGER.debug("[{}] Blocked inbound from {}", address, destinations);
LOGGER.log(Level.DEBUG, "[{0}] Blocked inbound from {1}", address, destinations);
}

/**
Expand All @@ -284,7 +288,7 @@ public void unblockInbound(String... destinations) {
*/
public void unblockInbound(Collection<String> destinations) {
destinations.forEach(inboundSettings::remove);
LOGGER.debug("[{}] Unblocked inbound from {}", address, destinations);
LOGGER.log(Level.DEBUG, "[{0}] Unblocked inbound from {1}", address, destinations);
}

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
package io.scalecube.cluster.utils;

import java.lang.System.Logger;
import java.lang.System.Logger.Level;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.TestInfo;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/** Base test class. */
public class BaseTest {

protected static final Logger LOGGER = LoggerFactory.getLogger(BaseTest.class);
protected static final Logger LOGGER = System.getLogger(BaseTest.class.getName());

@BeforeEach
public final void baseSetUp(TestInfo testInfo) {
LOGGER.info("***** Test started : " + testInfo.getDisplayName() + " *****");
LOGGER.log(Level.INFO, "***** Test started : " + testInfo.getDisplayName() + " *****");
}

@AfterEach
public final void baseTearDown(TestInfo testInfo) {
LOGGER.info("***** Test finished : " + testInfo.getDisplayName() + " *****");
LOGGER.log(Level.INFO, "***** Test finished : " + testInfo.getDisplayName() + " *****");
}
}
10 changes: 0 additions & 10 deletions cluster/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,6 @@
<version>${project.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j-impl</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<scope>test</scope>
</dependency>
</dependencies>

</project>
Loading

0 comments on commit 825b833

Please sign in to comment.