-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into QDOCS-114-Annotations-for-Quarkus-endpoints
- Loading branch information
Showing
65 changed files
with
1,581 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
...oracle/runtime/src/main/java/io/quarkus/jdbc/oracle/runtime/graal/ObjIdSubstitutions.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
package io.quarkus.jdbc.oracle.runtime.graal; | ||
|
||
import java.security.SecureRandom; | ||
|
||
import com.oracle.svm.core.annotate.Alias; | ||
import com.oracle.svm.core.annotate.InjectAccessors; | ||
import com.oracle.svm.core.annotate.TargetClass; | ||
|
||
/** | ||
* Substitutions required when `jdbc-oracle` is combined with `jdbc-db2`. | ||
*/ | ||
@TargetClass(className = "java.rmi.server.ObjID") | ||
public final class ObjIdSubstitutions { | ||
|
||
@Alias | ||
@InjectAccessors(SecureRandomAccessor.class) | ||
private static SecureRandom secureRandom; | ||
|
||
} | ||
|
||
class SecureRandomAccessor { | ||
private static volatile SecureRandom RANDOM; | ||
|
||
static SecureRandom get() { | ||
SecureRandom result = RANDOM; | ||
if (result == null) { | ||
/* Lazy initialization on first access. */ | ||
result = initializeOnce(); | ||
} | ||
return result; | ||
} | ||
|
||
private static synchronized SecureRandom initializeOnce() { | ||
SecureRandom result = RANDOM; | ||
if (result != null) { | ||
/* Double-checked locking is OK because INSTANCE is volatile. */ | ||
return result; | ||
} | ||
|
||
result = new SecureRandom(); | ||
RANDOM = result; | ||
return result; | ||
} | ||
} |
42 changes: 42 additions & 0 deletions
42
...kus/jdbc/postgresql/deployment/DevServicesPostgresqlDatasourceWithInitScriptTestCase.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
package io.quarkus.jdbc.postgresql.deployment; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertEquals; | ||
|
||
import java.sql.CallableStatement; | ||
import java.sql.Connection; | ||
import java.sql.ResultSet; | ||
|
||
import javax.inject.Inject; | ||
import javax.sql.DataSource; | ||
|
||
import org.junit.jupiter.api.DisplayName; | ||
import org.junit.jupiter.api.Test; | ||
import org.junit.jupiter.api.extension.RegisterExtension; | ||
|
||
import io.quarkus.test.QuarkusUnitTest; | ||
|
||
public class DevServicesPostgresqlDatasourceWithInitScriptTestCase { | ||
|
||
@RegisterExtension | ||
static QuarkusUnitTest test = new QuarkusUnitTest() | ||
.withApplicationRoot(javaArchive -> javaArchive.addAsResource("init-db.sql")) | ||
.overrideConfigKey("quarkus.datasource.db-kind", "postgresql") | ||
.overrideConfigKey("quarkus.datasource.devservices.init-script-path", "init-db.sql"); | ||
|
||
@Inject | ||
DataSource ds; | ||
|
||
@Test | ||
@DisplayName("Test if init-script-path executed successfully") | ||
public void testDatasource() throws Exception { | ||
int result = 0; | ||
try (Connection con = ds.getConnection(); | ||
CallableStatement cs = con.prepareCall("SELECT my_func()"); | ||
ResultSet rs = cs.executeQuery()) { | ||
if (rs.next()) { | ||
result = rs.getInt(1); | ||
} | ||
} | ||
assertEquals(100, result, "The init script should have been executed"); | ||
} | ||
} |
1 change: 1 addition & 0 deletions
1
extensions/jdbc/jdbc-postgresql/deployment/src/test/resources/init-db.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
CREATE OR REPLACE FUNCTION my_func() RETURNS integer LANGUAGE plpgsql as $func$ BEGIN return 100; END $func$; |
18 changes: 18 additions & 0 deletions
18
...java/io/quarkus/opentelemetry/deployment/OpenTelemetryDriverJdbcDataSourcesBuildItem.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package io.quarkus.opentelemetry.deployment; | ||
|
||
import java.util.List; | ||
|
||
import io.quarkus.agroal.spi.JdbcDataSourceBuildItem; | ||
import io.quarkus.builder.item.SimpleBuildItem; | ||
|
||
/** | ||
* Contains list of all {@link io.quarkus.agroal.spi.JdbcDataSourceBuildItem} using OpenTelemetryDriver. | ||
*/ | ||
public final class OpenTelemetryDriverJdbcDataSourcesBuildItem extends SimpleBuildItem { | ||
|
||
public final List<JdbcDataSourceBuildItem> jdbcDataSources; | ||
|
||
OpenTelemetryDriverJdbcDataSourcesBuildItem(List<JdbcDataSourceBuildItem> jdbcDataSources) { | ||
this.jdbcDataSources = List.copyOf(jdbcDataSources); | ||
} | ||
} |
Oops, something went wrong.