From f9ac0d2bbbb5d6587e2b38d763e49e65e0529f3d Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Tue, 14 Nov 2023 17:21:11 +0100 Subject: Dispose some test components Otherwise, JunitTest_forms_unoapi_2 left behind two instances of frm::OGridControlModel. Change-Id: Idaf7bae26b18e20821968ebf52e7864043963e03 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159422 Tested-by: Jenkins Reviewed-by: Stephan Bergmann --- qadevOOo/tests/java/ifc/io/_XPersistObject.java | 10 ++++++++++ qadevOOo/tests/java/ifc/util/_XCloneable.java | 6 ++++++ 2 files changed, 16 insertions(+) (limited to 'qadevOOo') diff --git a/qadevOOo/tests/java/ifc/io/_XPersistObject.java b/qadevOOo/tests/java/ifc/io/_XPersistObject.java index 083d0f71c692..717a611eb8e2 100644 --- a/qadevOOo/tests/java/ifc/io/_XPersistObject.java +++ b/qadevOOo/tests/java/ifc/io/_XPersistObject.java @@ -33,6 +33,7 @@ import com.sun.star.io.XObjectInputStream; import com.sun.star.io.XObjectOutputStream; import com.sun.star.io.XOutputStream; import com.sun.star.io.XPersistObject; +import com.sun.star.lang.XComponent; import com.sun.star.uno.UnoRuntime; @@ -154,6 +155,11 @@ public class _XPersistObject extends MultiMethodTest { } bResult &= locRes; } + + XComponent comp = UnoRuntime.queryInterface(XComponent.class, oCopy); + if (comp != null) { + comp.dispose(); + } } else { Object oCopy = tParam.getMSF().createInstance(sname); XPersistObject persCopy = UnoRuntime.queryInterface(XPersistObject.class, oCopy); @@ -162,6 +168,10 @@ public class _XPersistObject extends MultiMethodTest { bResult = persCopy.getServiceName().equals(sname); + XComponent comp = UnoRuntime.queryInterface(XComponent.class, oCopy); + if (comp != null) { + comp.dispose(); + } } } catch (com.sun.star.uno.Exception e) { diff --git a/qadevOOo/tests/java/ifc/util/_XCloneable.java b/qadevOOo/tests/java/ifc/util/_XCloneable.java index 62de17b010a0..1f446d801aee 100644 --- a/qadevOOo/tests/java/ifc/util/_XCloneable.java +++ b/qadevOOo/tests/java/ifc/util/_XCloneable.java @@ -22,6 +22,7 @@ import lib.MultiMethodTest; import java.util.Arrays; +import com.sun.star.lang.XComponent; import com.sun.star.lang.XServiceInfo; import com.sun.star.lang.XTypeProvider; import com.sun.star.uno.UnoRuntime; @@ -57,6 +58,11 @@ public class _XCloneable extends MultiMethodTest { result &= checkImplementationID(oObj, clone); tRes.tested("createClone()", result) ; + + XComponent comp = UnoRuntime.queryInterface(XComponent.class, clone); + if (comp != null) { + comp.dispose(); + } } protected byte[] getImplementationID(XInterface ifc) { -- cgit