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 3962cfa65d Drop legacy jboss-test-harness classes
3962cfa65d is described below

commit 3962cfa65d181e62722e7e4ae1bc10d16cdfb75d
Author: Richard Zowalla <[email protected]>
AuthorDate: Thu Oct 16 11:35:02 2025 +0200

    Drop legacy jboss-test-harness classes
---
 .../openejb/tck/impl/ContainersImplTomEE.java      | 170 ---------------------
 .../openejb/tck/impl/FullRestartContainer.java     | 137 -----------------
 .../openejb/tck/impl/StandaloneContainersImpl.java |  73 ---------
 3 files changed, 380 deletions(-)

diff --git 
a/tck/tck-common/src/main/java/org/apache/openejb/tck/impl/ContainersImplTomEE.java
 
b/tck/tck-common/src/main/java/org/apache/openejb/tck/impl/ContainersImplTomEE.java
deleted file mode 100644
index f382b7a25b..0000000000
--- 
a/tck/tck-common/src/main/java/org/apache/openejb/tck/impl/ContainersImplTomEE.java
+++ /dev/null
@@ -1,170 +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.
- */
-package org.apache.openejb.tck.impl;
-
-import org.apache.openejb.assembler.Deployer;
-import org.apache.openejb.assembler.classic.AppInfo;
-import org.apache.openejb.client.RemoteInitialContextFactory;
-import org.apache.openejb.config.RemoteServer;
-import org.apache.openejb.config.ValidationException;
-import org.apache.openejb.loader.Options;
-import org.apache.openejb.tck.OpenEJBTCKRuntimeException;
-import org.apache.openejb.tck.util.ServerLocal;
-import org.jboss.testharness.api.DeploymentException;
-import org.jboss.testharness.spi.Containers;
-
-import javax.naming.Context;
-import javax.naming.InitialContext;
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.Arrays;
-import java.util.Properties;
-
-/**
- * @version $Rev$ $Date$
- */
-public class ContainersImplTomEE extends AbstractContainers implements 
Containers {
-    private static int count = 0;
-    private final RemoteServer server;
-    private Deployer deployer = null;
-    private Exception exception;
-    private AppInfo appInfo;
-    private File currentFile = null;
-    private final int port = ServerLocal.getPort(8080);
-
-    private Deployer lookup() {
-        final Options options = new Options(System.getProperties());
-        final Properties props = new Properties();
-        props.put(Context.INITIAL_CONTEXT_FACTORY, 
RemoteInitialContextFactory.class.getName());
-        props.put(Context.PROVIDER_URL, options.get(Context.PROVIDER_URL, 
"http://localhost:"; + port + "/tomee/ejb"));
-
-        final String deployerJndi = 
System.getProperty("openejb.deployer.jndiname", 
"openejb/DeployerBusinessRemote");
-
-        try {
-            final InitialContext context = new InitialContext(props);
-            return (Deployer) context.lookup(deployerJndi);
-        } catch (final Exception e) {
-            throw new OpenEJBTCKRuntimeException(e);
-        }
-    }
-
-    public ContainersImplTomEE() {
-        System.out.println("ContainersImpl=" + 
ContainersImplTomEE.class.getName());
-        System.out.println("Initialized ContainersImplTomEE " + (++count) + ", 
wait port = " + port);
-        server = new RemoteServer();
-        server.setPortStartup(this.port);
-    }
-
-    @Override
-    public boolean deploy(final InputStream archive, final String name) throws 
IOException {
-        exception = null;
-        appInfo = null;
-
-        System.out.println("Deploying " + archive + " with name " + name);
-
-        currentFile = getFile(name);
-        System.out.println(currentFile);
-        writeToFile(currentFile, archive);
-        try {
-            if (deployer == null) {
-                deployer = lookup();
-            }
-            appInfo = deployer.deploy(currentFile.getAbsolutePath());
-        } catch (final Exception ex) {
-            Exception e = ex;
-            if (e.getCause() instanceof ValidationException) {
-                e = (Exception) e.getCause();
-            }
-
-            if (name.contains(".broken.")) {
-                // Tests that contain the name '.broken.' are expected to fail 
deployment
-                // This is how the TCK verifies the container is doing the 
required error checking
-                exception = (DeploymentException) new 
DeploymentException("deploy failed").initCause(e);
-            } else {
-                // This on the other hand is not good ....
-                System.out.println("FIX Deployment of " + name);
-                e.printStackTrace();
-                exception = e;
-            }
-
-            return false;
-        }
-        return true;
-    }
-
-    @Override
-    public DeploymentException getDeploymentException() {
-        try {
-            return (DeploymentException) exception;
-        } catch (final Exception e) {
-            System.out.println("BADCAST");
-            return new DeploymentException("", exception);
-        }
-    }
-
-    @Override
-    public void undeploy(final String name) throws IOException {
-        if (appInfo == null) {
-            if (!(exception instanceof DeploymentException)) {
-                System.out.println("Nothing to undeploy" + name);
-            }
-            return;
-        }
-
-        System.out.println("Undeploying " + name);
-        try {
-            deployer.undeploy(appInfo.path);
-        } catch (final Exception e) {
-            e.printStackTrace();
-            throw new OpenEJBTCKRuntimeException(e);
-        }
-
-        final File toDelete;
-        if (currentFile != null && (toDelete = 
currentFile.getParentFile()).exists()) {
-            System.out.println("deleting " + toDelete.getAbsolutePath());
-            delete(toDelete);
-        }
-    }
-
-    protected File getFile(final String name) {
-        final File dir = new File(tmpDir, Math.random() + "");
-        if (!dir.exists() && !dir.mkdir()) {
-            throw new RuntimeException("Failed to create directory: " + dir);
-        }
-        dir.deleteOnExit();
-        return new File(dir, name);
-    }
-
-    @Override
-    public void setup() throws IOException {
-        System.out.println("Setup called");
-        try {
-            
server.start(Arrays.asList("-Dopenejb.classloader.forced-load=org.apache.openejb.tck"),
 "start", true);
-        } catch (final Exception e) {
-            cleanup();
-            throw e;
-        }
-        System.out.println("Started");
-    }
-
-    @Override
-    public void cleanup() throws IOException {
-        System.out.println("Cleanup called");
-        server.destroy();
-    }
-}
diff --git 
a/tck/tck-common/src/main/java/org/apache/openejb/tck/impl/FullRestartContainer.java
 
b/tck/tck-common/src/main/java/org/apache/openejb/tck/impl/FullRestartContainer.java
deleted file mode 100644
index 2199ec2cee..0000000000
--- 
a/tck/tck-common/src/main/java/org/apache/openejb/tck/impl/FullRestartContainer.java
+++ /dev/null
@@ -1,137 +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.
- */
-
-package org.apache.openejb.tck.impl;
-
-import org.apache.openejb.client.RemoteInitialContextFactory;
-import org.apache.openejb.config.RemoteServer;
-import org.apache.openejb.loader.Options;
-import org.apache.openejb.tck.OpenEJBTCKRuntimeException;
-import org.apache.openejb.tck.util.ServerLocal;
-import org.apache.tomee.catalina.facade.ExceptionManagerFacade;
-import org.jboss.testharness.api.DeploymentException;
-import org.jboss.testharness.spi.Containers;
-
-import javax.naming.Context;
-import javax.naming.InitialContext;
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.Properties;
-
-/**
- * flow:
- * - copy file
- * - start the server
- * - stop the server
- * - remove the file
- */
-public class FullRestartContainer extends AbstractContainers implements 
Containers {
-    private static final File WEBAPP_DIR = new 
File(System.getProperty("openejb.home"), "webapps/");
-    private static final File APPS_DIR = new 
File(System.getProperty("openejb.home"), "apps/");
-
-    private RemoteServer server;
-    private Exception exception;
-    private File currentFile;
-
-    public FullRestartContainer() {
-        System.out.println("ContainersImpl=" + 
FullRestartContainer.class.getName());
-    }
-
-    @Override
-    public DeploymentException getDeploymentException() {
-        if (exception instanceof DeploymentException) {
-            return (DeploymentException) exception;
-        }
-        System.out.println("BADCAST");
-        return new DeploymentException("", exception);
-    }
-
-    @Override
-    public boolean deploy(final InputStream archive, final String name) throws 
IOException {
-        if (name.endsWith("war")) {
-            currentFile = new File(WEBAPP_DIR, name);
-        } else {
-            currentFile = new File(APPS_DIR, name);
-        }
-
-        System.out.println(currentFile);
-        writeToFile(currentFile, archive);
-
-        final int port = ServerLocal.getPort(-1);
-        if (port > 0) {
-            server = new RemoteServer(100, true);
-            server.setPortStartup(port);
-        } else {
-            throw new OpenEJBTCKRuntimeException("Please set the tomee port 
using the system property 'server.http.port'");
-        }
-
-        try {
-            server.start();
-        } catch (final Exception e) {
-            server.destroy();
-            e.printStackTrace();
-            throw e;
-        }
-
-        return (exception = lookup().exception()) == null;
-    }
-
-    @Override
-    public void undeploy(final String name) throws IOException {
-
-        if (null != server) {
-            server.destroy();
-        }
-
-        final File folder = new File(currentFile.getParentFile(), 
currentFile.getName().substring(0, currentFile.getName().length() - 4));
-        if (folder.exists()) {
-            delete(folder);
-        }
-        delete(currentFile);
-    }
-
-    @Override
-    public void setup() throws IOException {
-        // no-op
-    }
-
-    @Override
-    public void cleanup() throws IOException {
-        // no-op
-    }
-
-    private ExceptionManagerFacade lookup() {
-        final Options options = new Options(System.getProperties());
-        final Properties props = new Properties();
-        props.put(Context.INITIAL_CONTEXT_FACTORY, 
RemoteInitialContextFactory.class.getName());
-        final int port = ServerLocal.getPort(-1);
-        if (port > 0) {
-            System.out.println("provider url = " + "http://localhost:"; + port 
+ "/tomee/ejb");
-            props.put(Context.PROVIDER_URL, options.get(Context.PROVIDER_URL, 
"http://localhost:"; + port + "/tomee/ejb"));
-        } else {
-            throw new OpenEJBTCKRuntimeException("Please set the tomee port 
using the system property 'server.http.port'");
-        }
-
-        try {
-            final InitialContext context = new InitialContext(props);
-            return (ExceptionManagerFacade) 
context.lookup("openejb/ExceptionManagerFacadeBusinessRemote");
-        } catch (final Exception e) {
-            throw new OpenEJBTCKRuntimeException(e);
-        }
-    }
-}
diff --git 
a/tck/tck-common/src/main/java/org/apache/openejb/tck/impl/StandaloneContainersImpl.java
 
b/tck/tck-common/src/main/java/org/apache/openejb/tck/impl/StandaloneContainersImpl.java
deleted file mode 100644
index 193901da21..0000000000
--- 
a/tck/tck-common/src/main/java/org/apache/openejb/tck/impl/StandaloneContainersImpl.java
+++ /dev/null
@@ -1,73 +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.
- */
-package org.apache.openejb.tck.impl;
-
-import java.net.URL;
-import java.util.Collection;
-import java.util.Collections;
-
-import org.jboss.testharness.api.DeploymentException;
-
-/**
- * @version $Rev$ $Date$
- */
-public class StandaloneContainersImpl
-    implements org.jboss.testharness.spi.StandaloneContainers
-{
-
-    private final ContainersImpl containers = new ContainersImpl();
-
-    protected ContainersImpl getContainers() {
-        return containers;
-    }
-
-    @Override
-    public void deploy(Collection<Class<?>> classes)
-        throws DeploymentException
-    {
-        deploy(classes, Collections.EMPTY_LIST);
-    }
-
-    @Override
-    public boolean deploy(Collection<Class<?>> classes, Collection<URL> xmls)
-    {
-        final Archive archive = new Archive(xmls, classes);
-        return containers.deploy(archive.getIn(), archive.getName());
-    }
-
-    @Override
-    public DeploymentException getDeploymentException()
-    {
-        return containers.getDeploymentException();
-    }
-
-    @Override
-    public void undeploy()
-    {
-        containers.undeploy(null);
-    }
-
-    @Override
-    public void setup()
-    {
-    }
-
-    @Override
-    public void cleanup()
-    {
-    }
-}

Reply via email to