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

damjan pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/openoffice.git

commit d01bf5ec1f78d57bb6531eb8307d286a2beba2c5
Author: Damjan Jovanovic <[email protected]>
AuthorDate: Thu May 8 04:49:33 2025 +0200

    Fix a deadlock in the DBAccess test when connecting to OpenOffice
    for each test instead of once for the whole class.
    
    Patch by: me
---
 test/testuno/source/fvt/uno/db/DBAccess.java | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/test/testuno/source/fvt/uno/db/DBAccess.java 
b/test/testuno/source/fvt/uno/db/DBAccess.java
index fb18be63c3..2667188739 100644
--- a/test/testuno/source/fvt/uno/db/DBAccess.java
+++ b/test/testuno/source/fvt/uno/db/DBAccess.java
@@ -42,7 +42,9 @@ import java.io.IOException;
 
 // ---------- junit imports -----------------
 import org.junit.After;
+import org.junit.AfterClass;
 import org.junit.Before;
+import org.junit.BeforeClass;
 import org.junit.Test;
 import org.openoffice.test.common.FileUtil;
 import org.openoffice.test.common.Testspace;
@@ -54,7 +56,7 @@ import static org.junit.Assert.*;
  * test case for Base's application UI
  */
 public class DBAccess {
-       UnoApp app = new UnoApp();
+       static final UnoApp app = new UnoApp();
        private XOfficeDatabaseDocument m_databaseDocument;
        private XDatabaseDocumentUI m_documentUI;
 
@@ -62,10 +64,18 @@ public class DBAccess {
 //             super();
 //     }
 
+       @BeforeClass
+       public static void setUpConnection() throws Exception {
+               app.start();
+       }
+
+       @AfterClass
+       public static void tearDownConnection() throws InterruptedException, 
Exception {
+               app.close();
+       }
 
        @Before
        public void before() throws java.lang.Exception {
-               app.start();
                String a = null;
                switchToDocument(a);
        }
@@ -73,7 +83,6 @@ public class DBAccess {
        @After
        public void after() throws java.lang.Exception {
                closeDocument();
-               app.close();
        }
        
        private void closeDocument() {

Reply via email to