the TCK no longer needs 1000 threads at the same time
*/
package io.smallrye.faulttolerance.tck;
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
import java.util.logging.Logger;
import org.jboss.arquillian.container.test.spi.client.deployment.ApplicationArchiveProcessor;
import org.jboss.arquillian.test.spi.TestClass;
import org.jboss.shrinkwrap.api.Archive;
-import org.jboss.shrinkwrap.api.Node;
import org.jboss.shrinkwrap.api.ShrinkWrap;
import org.jboss.shrinkwrap.api.asset.EmptyAsset;
-import org.jboss.shrinkwrap.api.asset.StringAsset;
import org.jboss.shrinkwrap.api.container.ClassContainer;
import org.jboss.shrinkwrap.api.container.LibraryContainer;
import org.jboss.shrinkwrap.api.spec.JavaArchive;
-import org.jboss.shrinkwrap.impl.base.io.IOUtil;
/**
* @author Martin Kouba
@@ -38,9 +33,6 @@ public class FaultToleranceApplicationArchiveProcessor implements ApplicationArc
private static final Logger LOGGER = Logger.getLogger(FaultToleranceApplicationArchiveProcessor.class.getName());
- private static final String MAX_THREADS_OVERRIDE = "io.smallrye.faulttolerance.mainThreadPoolSize=1000";
- private static final String MP_CONFIG_PATH = "/WEB-INF/classes/META-INF/microprofile-config.properties";
-
@Override
public void process(Archive<?> applicationArchive, TestClass testClass) {
if (!(applicationArchive instanceof ClassContainer)) {
@@ -63,27 +55,6 @@ public class FaultToleranceApplicationArchiveProcessor implements ApplicationArc
applicationArchive.add(EmptyAsset.INSTANCE, "META-INF/beans.xml");
}
- String config;
- if (!applicationArchive.contains(MP_CONFIG_PATH)) {
- config = MAX_THREADS_OVERRIDE;
- } else {
- ByteArrayOutputStream output = readCurrentConfig(applicationArchive);
- applicationArchive.delete(MP_CONFIG_PATH);
- config = output.toString() + "\n" + MAX_THREADS_OVERRIDE;
- }
- classContainer.addAsResource(new StringAsset(config), MP_CONFIG_PATH);
-
LOGGER.info("Added additional resources to " + applicationArchive.toString(true));
}
-
- private ByteArrayOutputStream readCurrentConfig(Archive<?> appArchive) {
- try {
- Node node = appArchive.get(MP_CONFIG_PATH);
- ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
- IOUtil.copy(node.getAsset().openStream(), outputStream);
- return outputStream;
- } catch (IOException e) {
- throw new RuntimeException("Failed to prepare microprofile-config.properties");
- }
- }
}
