Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into mp-metrics-micrometer
Browse files Browse the repository at this point in the history
  • Loading branch information
rzo1 committed Apr 24, 2024
2 parents 1706146 + 7fb3a40 commit 065938e
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 110 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import java.lang.reflect.Method;
import java.lang.reflect.Proxy;
import java.util.Date;
import java.util.Objects;
import java.util.concurrent.Callable;
import java.util.concurrent.Future;
import java.util.concurrent.ScheduledExecutorService;
Expand All @@ -51,6 +52,7 @@ public ManagedScheduledExecutorServiceImpl(final ScheduledExecutorService delega

@Override
public ScheduledFuture<?> schedule(final Runnable runnable, final Trigger trigger) {
Objects.requireNonNull(runnable);
final Date taskScheduledTime = new Date();
final AtomicReference<Future<?>> futureHandle = new AtomicReference<>();
final TriggerRunnable wrapper = new TriggerRunnable(this, contextService, runnable, new CURunnable(runnable), trigger, taskScheduledTime, getTaskId(runnable), AtomicReference.class.cast(futureHandle));
Expand All @@ -60,6 +62,7 @@ public ScheduledFuture<?> schedule(final Runnable runnable, final Trigger trigge

@Override
public <V> ScheduledFuture<V> schedule(final Callable<V> vCallable, final Trigger trigger) {
Objects.requireNonNull(vCallable);
final Date taskScheduledTime = new Date();
final AtomicReference<Future<V>> futureHandle = new AtomicReference<>();
final TriggerCallable<V> wrapper = new TriggerCallable<>(this, this.contextService, vCallable, new CUCallable<>(vCallable), trigger, taskScheduledTime, getTaskId(vCallable), futureHandle);
Expand All @@ -76,6 +79,7 @@ private <V> ScheduledFuture<V> initTriggerScheduledFuture(final Object original,

@Override
public ScheduledFuture<?> schedule(final Runnable command, final long delay, final TimeUnit unit) {
Objects.requireNonNull(command);
final CURunnable wrapper = new CURunnable(command);
final ScheduledFuture<?> future = delegate.schedule(wrapper, delay, unit);
wrapper.taskSubmitted(future, this, command);
Expand All @@ -84,6 +88,7 @@ public ScheduledFuture<?> schedule(final Runnable command, final long delay, fin

@Override
public <V> ScheduledFuture<V> schedule(final Callable<V> callable, final long delay, final TimeUnit unit) {
Objects.requireNonNull(callable);
final CUCallable<V> wrapper = new CUCallable<>(callable);
final ScheduledFuture<V> future = delegate.schedule(wrapper, delay, unit);
wrapper.taskSubmitted(future, this, callable);
Expand All @@ -92,6 +97,7 @@ public <V> ScheduledFuture<V> schedule(final Callable<V> callable, final long de

@Override
public ScheduledFuture<?> scheduleAtFixedRate(final Runnable command, final long initialDelay, final long period, final TimeUnit unit) {
Objects.requireNonNull(command);
final CURunnable wrapper = new CURunnable(command);
final ScheduledFuture<?> future = delegate.scheduleAtFixedRate(wrapper, initialDelay, period, unit);
wrapper.taskSubmitted(future, this, command);
Expand All @@ -100,6 +106,7 @@ public ScheduledFuture<?> scheduleAtFixedRate(final Runnable command, final long

@Override
public ScheduledFuture<?> scheduleWithFixedDelay(final Runnable command, final long initialDelay, final long delay, final TimeUnit unit) {
Objects.requireNonNull(command);
final CURunnable wrapper = new CURunnable(command);
final ScheduledFuture<?> future = delegate.scheduleWithFixedDelay(wrapper, initialDelay, delay, unit);
wrapper.taskSubmitted(future, this, command);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import org.jboss.shrinkwrap.api.spec.WebArchive;
import org.junit.After;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;

Expand Down Expand Up @@ -68,6 +69,7 @@ public void after() {
}

@Test
@Ignore
public void testCountedMetric() {
WebTarget webTarget = this.client.target(this.base.toExternalForm());
final String message = webTarget.path("/weather/day/status")
Expand Down Expand Up @@ -106,6 +108,7 @@ private void assertJsonFormat(final String metricPath) {
}

@Test
@Ignore
public void testCountedMetricMetadata() {
WebTarget webTarget = this.client.target(this.base.toExternalForm());
final Response response = webTarget
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import org.jboss.shrinkwrap.api.spec.WebArchive;
import org.junit.After;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;

Expand Down Expand Up @@ -68,6 +69,7 @@ public void after() {
}

@Test
@Ignore
public void testGaugeMetric() {
WebTarget webTarget = this.client.target(this.base.toExternalForm());
final Integer temperature = webTarget
Expand Down Expand Up @@ -109,6 +111,7 @@ private void assertJsonFormat(final String metricPath) {
}

@Test
@Ignore
public void testGaugeMetricMetadata() {
WebTarget webTarget = this.client.target(this.base.toExternalForm());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

import org.junit.After;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;

Expand Down Expand Up @@ -76,6 +77,7 @@ public void after() {
}

@Test
@Ignore
public void testHistogramMetric() {
WebTarget webTarget = this.client.target(this.base.toExternalForm());
final String message = webTarget.path("/weather/histogram").request().get(String.class);
Expand Down Expand Up @@ -246,6 +248,7 @@ private List<JsonItem> convertToMap(String s) {
}

@Test
@Ignore
public void testHistogramMetricMetadata() {
WebTarget webTarget = this.client.target(this.base.toExternalForm());
final Response response =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@

<packages>
<package name="org.hibernate.beanvalidation.tck.tests.*">
<!-- FIXME: This tests seem to be broken on Java 17+ (also in BVAL itself) - exclude for now -->
<!-- FIXME: TOMEE-4327 This tests seem to be broken on Java 17+ (also in BVAL itself) - exclude for now -->
<exclude name="org.hibernate.beanvalidation.tck.tests.constraints.groups.groupconversion.*"/>
</package>
</packages>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@

<packages>
<package name="org.hibernate.beanvalidation.tck.tests.*">
<!-- FIXME: This tests seem to be broken on Java 17+ (also in BVAL itself) - exclude for now -->
<!-- FIXME: TOMEE-4327 This tests seem to be broken on Java 17+ (also in BVAL itself) - exclude for now -->
<exclude name="org.hibernate.beanvalidation.tck.tests.constraints.groups.groupconversion.*"/>
</package>
</packages>
Expand Down
55 changes: 0 additions & 55 deletions tck/concurrency-standalone/logging.properties

This file was deleted.

57 changes: 4 additions & 53 deletions tck/concurrency-standalone/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
<properties>
<!-- General properties -->
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>

<!-- Dependency and Plugin Versions -->
<jakarta.concurrent.version>3.0.3</jakarta.concurrent.version>
Expand All @@ -41,19 +41,8 @@
<maven.comp.plugin.version>3.10.1</maven.comp.plugin.version>
<maven.surefire.plugin.version>2.22.2</maven.surefire.plugin.version>

<!-- Location to put test application dependencies -->
<!-- <application.server.lib>[path/to/appserver/lib]</application.server.lib>-->
<suiteXmlFile>suite-web.xml</suiteXmlFile>

<!-- Pointer to suite.xml file that has the TestNG configuration.
Use suite.xml to test the full profile
Use suite-web.xml to test the web profile
-->
<suiteXmlFile>suite.xml</suiteXmlFile>

<!-- Pointer to logging.properties file that has the java.util.logging configuration -->
<logging.config>logging.properties</logging.config>

<!-- Output directory -->
<targetDirectory>${project.basedir}/target</targetDirectory>
</properties>

Expand Down Expand Up @@ -121,12 +110,6 @@
<artifactId>testng</artifactId>
<version>${testng.version}</version>
</dependency>
<!-- Signature Test Plugin -->
<dependency>
<groupId>org.netbeans.tools</groupId>
<artifactId>sigtest-maven-plugin</artifactId>
<version>${sigtest.version}</version>
</dependency>
<!-- To ensure its available for the TomEE lib directory -->
<dependency>
<groupId>org.apache.derby</groupId>
Expand All @@ -151,8 +134,6 @@
<directory>${targetDirectory}</directory>
<defaultGoal>clean test</defaultGoal>
<plugins>
<!-- tag::testServerDep[] -->
<!-- Test Server Dependencies -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
Expand All @@ -167,19 +148,11 @@
<artifactItem>
<groupId>org.apache.derby</groupId>
<artifactId>derby</artifactId>
<version>${derby.version}</version>
</artifactItem>
<artifactItem>
<groupId>org.netbeans.tools</groupId>
<artifactId>sigtest-maven-plugin</artifactId>
<version>${sigtest.version}</version>
<version>${version.derby}</version>
</artifactItem>
</artifactItems>
<!-- <outputDirectory>${application.server.lib}</outputDirectory>-->
</configuration>
</plugin>
<!-- end::testServerDep[] -->
<!-- Compile plugin for any supplemental class files -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
Expand All @@ -189,43 +162,21 @@
<target>${maven.compiler.target}</target>
</configuration>
</plugin>
<!-- tag::configTestNG[] -->
<!-- Surefire plugin - Entrypoint for TestNG -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>${maven.surefire.plugin.version}</version>
<configuration>
<!-- tag::logging[] -->
<systemProperties>
<property>
<name>java.util.logging.config.file</name>
<value>${logging.config}</value>
</property>
</systemProperties>
<!-- end::logging[] -->
<!-- tag::ignore[] -->
<systemPropertyVariables>
<!-- Properties shared with Arquillian -->
<!-- <tck_server>[TODO]</tck_server>-->
<!-- <tck_hostname>[TODO]</tck_hostname>-->
<!-- <tck_username>[TODO]</tck_username>-->
<!-- <tck_password>[TODO]</tck_password>-->
<!-- <tck_port>[TODO]</tck_port>-->
<!-- <tck_port>[TODO]</tck_port>-->
</systemPropertyVariables>
<!-- end::ignore[] -->
<suiteXmlFiles>
<suiteXmlFile>${suiteXmlFile}</suiteXmlFile>
</suiteXmlFiles>
<!-- Ensure surfire plugin looks under src/main/java instead of src/test/java -->
<testSourceDirectory>
${basedir}${file.separarator}src${file.separarator}main${file.separarator}java${file.separarator}
</testSourceDirectory>
</configuration>
</plugin>
<!-- end::configTestNG[] -->
<!-- TODO: you can include a plugin to start your application server here -->
</plugins>
</build>
</profile>
Expand Down

0 comments on commit 065938e

Please sign in to comment.