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

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


The following commit(s) were added to refs/heads/main by this push:
     new 75ab57ad1 TIKA-4537: revert
75ab57ad1 is described below

commit 75ab57ad1a27793ca831dec6e854287632c27f3f
Author: Tilman Hausherr <[email protected]>
AuthorDate: Fri Oct 31 17:15:15 2025 +0100

    TIKA-4537: revert
---
 tika-translate/pom.xml                             | 10 -----
 .../language/translate/impl/RTGTranslatorTest.java | 43 +++++-----------------
 2 files changed, 9 insertions(+), 44 deletions(-)

diff --git a/tika-translate/pom.xml b/tika-translate/pom.xml
index 5e3259c0c..3ab74ad8c 100644
--- a/tika-translate/pom.xml
+++ b/tika-translate/pom.xml
@@ -87,16 +87,6 @@
       <artifactId>tyrus-standalone-client</artifactId>
       <version>2.2.1</version>
     </dependency>
-    <dependency>
-      <groupId>org.testcontainers</groupId>
-      <artifactId>testcontainers</artifactId>
-      <scope>test</scope>
-    </dependency>
-    <dependency>
-      <groupId>org.testcontainers</groupId>
-      <artifactId>junit-jupiter</artifactId>
-      <scope>test</scope>
-    </dependency>
   </dependencies>
   <reporting>
     <plugins>
diff --git 
a/tika-translate/src/test/java/org/apache/tika/language/translate/impl/RTGTranslatorTest.java
 
b/tika-translate/src/test/java/org/apache/tika/language/translate/impl/RTGTranslatorTest.java
index b4c0eca25..45121a91e 100644
--- 
a/tika-translate/src/test/java/org/apache/tika/language/translate/impl/RTGTranslatorTest.java
+++ 
b/tika-translate/src/test/java/org/apache/tika/language/translate/impl/RTGTranslatorTest.java
@@ -22,61 +22,36 @@ import static 
org.junit.jupiter.api.Assertions.assertNotNull;
 import static org.junit.jupiter.api.Assertions.fail;
 import static org.junit.jupiter.api.Assumptions.assumeTrue;
 
-import java.time.Duration;
 import java.util.Locale;
 
-import com.github.dockerjava.api.model.ExposedPort;
-import com.github.dockerjava.api.model.PortBinding;
-import com.github.dockerjava.api.model.Ports;
-import org.junit.jupiter.api.AfterAll;
-import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.Test;
-import org.testcontainers.containers.GenericContainer;
-import org.testcontainers.containers.wait.strategy.Wait;
-import org.testcontainers.junit.jupiter.Testcontainers;
-import org.testcontainers.utility.DockerImageName;
 
 
 /**
- * Test harness for the {@link RTGTranslator}.
+ * Test harness for the {@link RTGTranslator}. See the RTG code on how to 
start docker.
+ * Alternatively try the revision from 31.10.2025.
+ *
  */
-@Testcontainers(disabledWithoutDocker = true)
 public class RTGTranslatorTest {
 
-    static private RTGTranslator translator;
-    static private GenericContainer<?> container;
+    private RTGTranslator translator;
 
 
-    @BeforeAll
-    static void setUp() {
-        // ChatGPT, prompts used:
-        // How can I run "docker run --rm -i -p 6060:6060 
tgowda/rtg-model:500toEng-v1" with testcontainers in java?
-        // What can I do if the container takes longer to initialize?
-        DockerImageName imageName = 
DockerImageName.parse("tgowda/rtg-model:500toEng-v1");
-        PortBinding portBinding = new 
PortBinding(Ports.Binding.bindPort(6060), new ExposedPort(6060));
-        container = new GenericContainer<>(imageName)
-                .withCreateContainerCmdModifier(cmd -> 
cmd.getHostConfig().withPortBindings(portBinding))
-                .waitingFor(Wait.forHttp("/about")
-                        .forPort(6060)
-                        .forStatusCode(200)
-                        .withStartupTimeout(Duration.ofMinutes(5)));
-        container.start();
+    @BeforeEach
+    public void setUp() {
         translator = new RTGTranslator();
     }
 
-    @AfterAll
-    static void finish() {
-        container.close();
-    }
-
     @Test
     public void testSimpleTranslate() {
         assumeTrue(translator.isAvailable());
         String source = "hola seƱor";
         String expected = "hello, sir.";
 
+        String result = null;
         try {
-            String result = translator.translate(source);
+            result = translator.translate(source);
             assertNotNull(result);
             assertEquals(expected, result.toLowerCase(Locale.getDefault()),
                     "Result: [" + result + "]: not equal to expected: [" + 
expected + "]");

Reply via email to