This is an automated email from the ASF dual-hosted git repository.

rzo1 pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tomee.git


The following commit(s) were added to refs/heads/main by this push:
     new 475351efe2 TOMEE-4159 - Rework Concurrency TCK setup
475351efe2 is described below

commit 475351efe2ebd70baf03920a5887b11e22c10be2
Author: Richard Zowalla <r...@apache.org>
AuthorDate: Tue Apr 23 10:09:57 2024 +0200

    TOMEE-4159 - Rework Concurrency TCK setup
    
    TOMEE-4159 - Rework Concurrency TCK setup
---
 .../impl/ManagedScheduledExecutorServiceImpl.java  |  7 +++
 tck/concurrency-standalone/logging.properties      | 55 ---------------------
 tck/concurrency-standalone/pom.xml                 | 57 ++--------------------
 3 files changed, 11 insertions(+), 108 deletions(-)

diff --git 
a/container/openejb-core/src/main/java/org/apache/openejb/threads/impl/ManagedScheduledExecutorServiceImpl.java
 
b/container/openejb-core/src/main/java/org/apache/openejb/threads/impl/ManagedScheduledExecutorServiceImpl.java
index 6ce434df0d..cea54d8494 100644
--- 
a/container/openejb-core/src/main/java/org/apache/openejb/threads/impl/ManagedScheduledExecutorServiceImpl.java
+++ 
b/container/openejb-core/src/main/java/org/apache/openejb/threads/impl/ManagedScheduledExecutorServiceImpl.java
@@ -31,6 +31,7 @@ import java.lang.reflect.InvocationTargetException;
 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;
@@ -51,6 +52,7 @@ public class ManagedScheduledExecutorServiceImpl extends 
ManagedExecutorServiceI
 
     @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));
@@ -60,6 +62,7 @@ public class ManagedScheduledExecutorServiceImpl extends 
ManagedExecutorServiceI
 
     @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);
@@ -76,6 +79,7 @@ public class ManagedScheduledExecutorServiceImpl extends 
ManagedExecutorServiceI
 
     @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);
@@ -84,6 +88,7 @@ public class ManagedScheduledExecutorServiceImpl extends 
ManagedExecutorServiceI
 
     @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);
@@ -92,6 +97,7 @@ public class ManagedScheduledExecutorServiceImpl extends 
ManagedExecutorServiceI
 
     @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);
@@ -100,6 +106,7 @@ public class ManagedScheduledExecutorServiceImpl extends 
ManagedExecutorServiceI
 
     @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);
diff --git a/tck/concurrency-standalone/logging.properties 
b/tck/concurrency-standalone/logging.properties
deleted file mode 100644
index 05a4290cdc..0000000000
--- a/tck/concurrency-standalone/logging.properties
+++ /dev/null
@@ -1,55 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-# Ensure that both your client and sever JVMs point to this file using the 
java.util.logging property
-# -Djava.util.logging.config.file=/path/to/logging.properties
-
-#Handlers we plan to use
-handlers=java.util.logging.FileHandler,java.util.logging.ConsoleHandler
-
-#Global logger - By default only log warnings
-.level=WARNING
-
-#Concurrency logger - By default log everything for concurrency loggers
-ee.jakarta.tck.concurrent.level=ALL
-
-#Formatting for the simple formatter
-java.util.logging.SimpleFormatter.class.log=true
-java.util.logging.SimpleFormatter.class.full=false
-java.util.logging.SimpleFormatter.class.length=30
-
-java.util.logging.SimpleFormatter.level.log=true
-
-java.util.logging.SimpleFormatter.method.log=true
-java.util.logging.SimpleFormatter.method.length=30
-
-java.util.logging.SimpleFormatter.thread.log=true
-java.util.logging.SimpleFormatter.thread.length=3
-
-java.util.logging.SimpleFormatter.time.log=true
-java.util.logging.SimpleFormatter.time.format=[MM/dd/yyyy HH:mm:ss:SSS z]
-
-java.util.logging.SimpleFormatter.format=[%1$tF %1$tT] %4$.1s %3$s %5$s %n
-
-#File logging
-java.util.logging.FileHandler.pattern=ConcurrentTCK%g%u.log
-java.util.logging.FileHandler.limit = 500000
-java.util.logging.FileHandler.count = 5
-java.util.logging.FileHandler.formatter=java.util.logging.SimpleFormatter
-java.util.logging.FileHandler.level=CONFIG
-
-# Console Logging
-java.util.logging.ConsoleHandler.formatter=java.util.logging.SimpleFormatter
-java.util.logging.ConsoleHandler.level=WARNING
\ No newline at end of file
diff --git a/tck/concurrency-standalone/pom.xml 
b/tck/concurrency-standalone/pom.xml
index f7d5b7af02..1a13802c62 100644
--- a/tck/concurrency-standalone/pom.xml
+++ b/tck/concurrency-standalone/pom.xml
@@ -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>
@@ -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>
 
@@ -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>
@@ -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>
@@ -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>
@@ -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>

Reply via email to