Skip to content

Commit

Permalink
1.1.1 (#2)
Browse files Browse the repository at this point in the history
* Minor config updates

* Kora Java GraalVM CRUD example added

* Kora Java GraalVM CRUD example added

* Kora Java GraalVM CRUD example added

* Dependencies updated

* Kora Java GraalVM CRUD JDBC example added

* Kora Java GraalVM CRUD R2DBC example added

* Kora Java GraalVM CRUD Cassandra example added

* Kora Java GraalVM CRUD Vertx example added

* Dependencies updated

* GraalVM examples updated and stabilized

* Minor improvements

* Kafka GraalVM example added

* Kafka GraalVM YAMl config support added
Dependencies updated
  • Loading branch information
GoodforGod authored May 25, 2024
1 parent 44a1a20 commit b2625fe
Show file tree
Hide file tree
Showing 305 changed files with 6,977 additions and 570 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test-master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ jobs:
run: "./gradlew testClasses"

- name: Test
run: "./gradlew test"
run: "./gradlew test jacocoTestReport --no-parallel"
2 changes: 1 addition & 1 deletion .github/workflows/test-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
run: "./gradlew testClasses"

- name: Test
run: "./gradlew test jacocoTestReport"
run: "./gradlew test jacocoTestReport --no-parallel"

- name: Test Report
if: matrix.java == '17'
Expand Down
5 changes: 4 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
plugins {
id "com.diffplug.spotless" version "6.19.0"
id "org.graalvm.buildtools.native" version "0.10.1" // or dependsOn fails in graalvm examples
id "com.asarkar.gradle.build-time-tracker" version "4.3.0"
}

Expand All @@ -9,6 +10,7 @@ version = koraVersion
repositories {
mavenLocal()
mavenCentral()
maven { url "https://oss.sonatype.org/content/repositories/snapshots" }
}

subprojects {
Expand All @@ -22,6 +24,7 @@ subprojects {
repositories {
mavenLocal()
mavenCentral()
maven { url "https://oss.sonatype.org/content/repositories/snapshots" }
}

spotless {
Expand All @@ -35,7 +38,7 @@ subprojects {
}

configurations {
all {
configureEach {
resolutionStrategy {
cacheChangingModulesFor 0, "seconds" // check for updates every build
}
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
groupId=ru.tinkoff.kora
koraVersion=1.0.9
koraVersion=1.1.1


##### GRADLE #####
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 2 additions & 0 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
29 changes: 17 additions & 12 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,8 @@ done
# This is normally unused
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit

# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
Expand Down Expand Up @@ -133,26 +131,29 @@ location of your Java installation."
fi
else
JAVACMD=java
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
if ! command -v java >/dev/null 2>&1
then
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
fi

# Increase the maximum file descriptors if we can.
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
# shellcheck disable=SC2039,SC3045
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
case $MAX_FD in #(
'' | soft) :;; #(
*)
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
# shellcheck disable=SC2039,SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
Expand Down Expand Up @@ -197,11 +198,15 @@ if "$cygwin" || "$msys" ; then
done
fi

# Collect all arguments for the java command;
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
# shell script including quotes and variable substitutions, so put them in
# double quotes to make sure that they get re-expanded; and
# * put everything else in single quotes, so that it's not re-expanded.

# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'

# Collect all arguments for the java command:
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
# and any embedded shellness will be escaped.
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
# treated as '${Hostname}' itself on the command line.

set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \
Expand Down
20 changes: 10 additions & 10 deletions gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if %ERRORLEVEL% equ 0 goto execute

echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
echo. 1>&2
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2

goto fail

Expand All @@ -57,11 +57,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe

if exist "%JAVA_EXE%" goto execute

echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
echo. 1>&2
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2

goto fail

Expand Down
3 changes: 1 addition & 2 deletions kora-java-cache-caffeine/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,12 @@ test {
}
}

jar.enabled = true
jar.enabled = false
shadowJar {
mergeServiceFiles()
manifest {
attributes "Main-Class": mainClassName
attributes "Implementation-Version": koraVersion
attributes "Build-Time": java.time.OffsetDateTime.now()
}
}

Expand Down
4 changes: 2 additions & 2 deletions kora-java-cache-caffeine/src/main/resources/application.conf
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ my-cache {

logging.level {
"root": "WARN"
"ru.tinkoff.kora": "DEBUG"
"ru.tinkoff.kora.example": "DEBUG"
"ru.tinkoff.kora": "INFO"
"ru.tinkoff.kora.example": "INFO"
}
2 changes: 2 additions & 0 deletions kora-java-cache-caffeine/src/main/resources/logback.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,6 @@
<root level="WARN">
<appender-ref ref="ASYNC"/>
</root>

<logger level="INFO" name="ru.tinkoff.kora"/>
</configuration>
5 changes: 2 additions & 3 deletions kora-java-cache-caffeine/src/test/resources/logback-test.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,9 @@
<appender-ref ref="ASYNC"/>
</root>

<logger level="DEBUG" name="ru.tinkoff.kora.example"/>

<logger level="INFO" name="ru.tinkoff.kora"/>
<logger level="DEBUG" name="ru.tinkoff.kora.example"/>

<logger level="DEBUG" name="org.testcontainers.containers"/>
<logger level="DEBUG" name="io.goodforgod.testcontainers"/>
<logger level="DEBUG" name="io.goodforgod.testcontainers.extensions"/>
</configuration>
5 changes: 2 additions & 3 deletions kora-java-cache-redis/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ dependencies {
implementation "ru.tinkoff.kora:config-hocon"

testImplementation "ru.tinkoff.kora:test-junit5"
testImplementation "io.goodforgod:testcontainers-extensions-redis:0.9.6"
testImplementation "io.goodforgod:testcontainers-extensions-redis:0.11.0"
testImplementation "redis.clients:jedis:4.4.3"
}

Expand Down Expand Up @@ -70,13 +70,12 @@ test {
}
}

jar.enabled = true
jar.enabled = false
shadowJar {
mergeServiceFiles()
manifest {
attributes "Main-Class": mainClassName
attributes "Implementation-Version": koraVersion
attributes "Build-Time": java.time.OffsetDateTime.now()
}
}

Expand Down
4 changes: 2 additions & 2 deletions kora-java-cache-redis/src/main/resources/application.conf
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ lettuce {

logging.level {
"root": "WARN"
"ru.tinkoff.kora": "DEBUG"
"ru.tinkoff.kora.example": "DEBUG"
"ru.tinkoff.kora": "INFO"
"ru.tinkoff.kora.example": "INFO"
}
2 changes: 2 additions & 0 deletions kora-java-cache-redis/src/main/resources/logback.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,6 @@
<root level="WARN">
<appender-ref ref="ASYNC"/>
</root>

<logger level="INFO" name="ru.tinkoff.kora"/>
</configuration>
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
import static org.junit.jupiter.api.Assertions.assertNotEquals;

import io.goodforgod.testcontainers.extensions.ContainerMode;
import io.goodforgod.testcontainers.extensions.redis.*;
import io.goodforgod.testcontainers.extensions.redis.ConnectionRedis;
import io.goodforgod.testcontainers.extensions.redis.RedisConnection;
import io.goodforgod.testcontainers.extensions.redis.TestcontainersRedis;
import java.math.BigDecimal;
import java.time.Duration;
import org.jetbrains.annotations.NotNull;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.testcontainers.utility.DockerImageName;
import ru.tinkoff.kora.test.extension.junit5.KoraAppTest;
import ru.tinkoff.kora.test.extension.junit5.KoraAppTestConfigModifier;
import ru.tinkoff.kora.test.extension.junit5.KoraConfigModification;
Expand All @@ -20,11 +20,7 @@
@KoraAppTest(Application.class)
class RedisCachedServiceTests implements KoraAppTestConfigModifier {

@ContainerRedis
private static final RedisContainer<?> CONTAINER = new RedisContainer<>(DockerImageName.parse("redis:7.2-alpine"))
.waitAfterStart(Duration.ofSeconds(1));

@ContainerRedisConnection
@ConnectionRedis
private RedisConnection connection;

@TestComponent
Expand All @@ -42,7 +38,8 @@ public KoraConfigModification config() {
}

@BeforeEach
void cleanup() {
void cleanup() throws Exception {
Thread.sleep(150);
cache.invalidateAll();
}

Expand Down
5 changes: 2 additions & 3 deletions kora-java-cache-redis/src/test/resources/logback-test.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,9 @@
<appender-ref ref="ASYNC"/>
</root>

<logger level="DEBUG" name="ru.tinkoff.kora.example"/>

<logger level="INFO" name="ru.tinkoff.kora"/>
<logger level="DEBUG" name="ru.tinkoff.kora.example"/>

<logger level="DEBUG" name="org.testcontainers.containers"/>
<logger level="DEBUG" name="io.goodforgod.testcontainers"/>
<logger level="DEBUG" name="io.goodforgod.testcontainers.extensions"/>
</configuration>
3 changes: 1 addition & 2 deletions kora-java-config-hocon/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,12 @@ test {
}
}

jar.enabled = true
jar.enabled = false
shadowJar {
mergeServiceFiles()
manifest {
attributes "Main-Class": mainClassName
attributes "Implementation-Version": koraVersion
attributes "Build-Time": java.time.OffsetDateTime.now()
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package ru.tinkoff.kora.example.config.hocon;

import jakarta.annotation.Nullable;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.time.*;
import java.util.*;
import java.util.regex.Pattern;
Expand Down Expand Up @@ -46,13 +48,11 @@ public interface FooConfig {

long valueLong();

// TODO 1.0.5
// BigInteger valueBigInt();
BigInteger valueBigInt();

double valueDouble();

// TODO 1.0.5
// BigDecimal valueBigDecimal();
BigDecimal valueBigDecimal();

boolean valueBoolean();

Expand Down
6 changes: 2 additions & 4 deletions kora-java-config-hocon/src/main/resources/application.conf
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,9 @@ foo {
valueDuration = "250s"
valueInt = 1
valueLong = 2
//TODO 1.0.5
// valueBigInt = 3
valueBigInt = 3
valueDouble = 4.1
//TODO 1.0.5
// valueBigDecimal = 5.1
valueBigDecimal = 5.1
valueBoolean = true
valueListAsString = "v1,v2"
valueListAsArray = ["v1", "v2"]
Expand Down
2 changes: 2 additions & 0 deletions kora-java-config-hocon/src/main/resources/logback.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,6 @@
<root level="WARN">
<appender-ref ref="ASYNC"/>
</root>

<logger level="INFO" name="ru.tinkoff.kora"/>
</configuration>
5 changes: 2 additions & 3 deletions kora-java-config-hocon/src/test/resources/logback-test.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,9 @@
<appender-ref ref="ASYNC"/>
</root>

<logger level="DEBUG" name="ru.tinkoff.kora.example"/>

<logger level="INFO" name="ru.tinkoff.kora"/>
<logger level="DEBUG" name="ru.tinkoff.kora.example"/>

<logger level="DEBUG" name="org.testcontainers.containers"/>
<logger level="DEBUG" name="io.goodforgod.testcontainers"/>
<logger level="DEBUG" name="io.goodforgod.testcontainers.extensions"/>
</configuration>
3 changes: 1 addition & 2 deletions kora-java-config-yaml/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,12 @@ test {
}
}

jar.enabled = true
jar.enabled = false
shadowJar {
mergeServiceFiles()
manifest {
attributes "Main-Class": mainClassName
attributes "Implementation-Version": koraVersion
attributes "Build-Time": java.time.OffsetDateTime.now()
}
}

Expand Down
Loading

0 comments on commit b2625fe

Please sign in to comment.