Files
libreoffice/bridges/test/java_remote/Bug107753_Test.java

384 lines
20 KiB
Java
Raw Normal View History

2012-06-19 17:56:50 +01:00
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
* 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 .
*/
package test.java_remote;
import com.sun.star.bridge.XInstanceProvider;
import com.sun.star.lib.uno.typeinfo.MethodTypeInfo;
import com.sun.star.lib.uno.typeinfo.TypeInfo;
import com.sun.star.uno.UnoRuntime;
import com.sun.star.uno.XComponentContext;
import com.sun.star.uno.XInterface;
import complexlib.ComplexTestCase;
import test.lib.TestBed;
/**
* Test case for bug #107753#.
*
* <p>Bug #107753# "Java UNO: Proxies should implement intuitive semantics of
* equals and hashCode" requests that two proxies are equal iff they represent
* the same UNO object. This implies that if two proxies repsent the same UNO
* object, they must have the same hash code.</p>
*/
public final class Bug107753_Test extends ComplexTestCase {
@Override
public String getTestObjectName() {
return getClass().getName();
}
@Override
public String[] getTestMethodNames() {
return new String[] { "test" };
}
public void test() throws Exception {
TestBed t = new TestBed();
assure("test", t.execute(new Provider(), false, Client.class, 0));
}
public static final class Client extends TestBed.Client {
public static void main(String[] args) {
new Client().execute();
}
@Override
protected boolean run(XComponentContext context) throws Throwable {
boolean success = true;
CWS-TOOLING: integrate CWS sb113 2009-09-01 sb #i76393# second attempt at properly #ifdef-ing previous HG commit d598efdbf012 2009-08-28 sb #i102469# change back <T extends XInterface> to just <T> on queryInterface, to avoid binary incompatibility (method changing its signature from (Ljava/lang/Class;Ljava/lang/Object;)Ljava/lang/Object; to (Ljava/lang/Class;Ljava/lang/Object;)Lcom/sun/star/uno/XInterface;) 2009-08-28 sb #i76393# properly #ifdef previous HG commit d598efdbf012 2009-08-27 sb #i94421# work around compiler error (based on a patch supplied by cloph) 2009-08-26 sb merged in DEV300_m56 2009-08-26 sb #i76393# on Linux, include dynamic section offset in crash report so as to be able to map "prelinked" callstacks back to original (patch by cmc) 2009-08-26 sb #i88162# remove unnecessary whitespace lines from per-locale xcu files (patch by tora) 2009-08-17 Juergen Schmidt #i104292# set context classloader after create new custom UNO loader 2009-08-17 Juergen Schmidt #i103749# integrate patch 2009-08-14 sb #i103269# cherry-picked ssh://hg@hg.services.openoffice.org/cws/sb111 -r 5124ebd5edd1 ("#i101955# changed encoding of XML file content from erroneous ISO-8859-1 to UTF-8") 2009-08-12 sb #i102469# fixed mis-applications of UnoRuntime.queryInterface (detected via the simplified UnoRuntime.queryInterface, the HG changeset 29de35fc9554) to use AnyConverter instead; changed qadevOOo's lib.MultiMethodTest.before to allow throwing arbitrary exceptions, to cater for IllegalArgumentException thrown by AnyConverter 2009-08-12 sb #i104178# drop extra libxml2-config script from libxmlsec 2009-08-10 sb #i101754# simplified osl_getProcessInfo for LINUX (patch by cmc) 2009-08-10 sb #i95018# avoid closing -1 fds (patch supplied by cmc) 2009-08-10 sb #i103585# removed (apparently unnecessary) zlib support from libxml2; in turn, removed zlib dependencies from libxmlsec, libxslt, and redland (assuming those were transitive dependencies brought in by direct dependencies on libxml2) 2009-08-10 sb #i102469# simplified UnoRuntime.queryInterface using Java 5 generics; adapted URE-related modules accordingly 2009-08-10 sb #i101213# adapted setsolar env (solenv/config/) to set PYTHONPATH (and not set PYTHONHOME) in accordance with configure env (set_soenv.in); fixed testtools/source/bridgetest/pyuno (which now should work everywhere out of the box, thanks to the fixed setsolar PYTHONPATH) 2009-08-10 sb cherry-picked ssh://hg@hg.services.openoffice.org/cws/sb111 -r ea8de6d9396b ("#i101955# work in progress for a .hgignore file, continued")
2009-09-16 14:37:52 +00:00
XTransport transport = UnoRuntime.queryInterface(
XTransport.class, getBridge(context).getInstance("Transport"));
Object obj1a = new XType1() {};
CWS-TOOLING: integrate CWS sb113 2009-09-01 sb #i76393# second attempt at properly #ifdef-ing previous HG commit d598efdbf012 2009-08-28 sb #i102469# change back <T extends XInterface> to just <T> on queryInterface, to avoid binary incompatibility (method changing its signature from (Ljava/lang/Class;Ljava/lang/Object;)Ljava/lang/Object; to (Ljava/lang/Class;Ljava/lang/Object;)Lcom/sun/star/uno/XInterface;) 2009-08-28 sb #i76393# properly #ifdef previous HG commit d598efdbf012 2009-08-27 sb #i94421# work around compiler error (based on a patch supplied by cloph) 2009-08-26 sb merged in DEV300_m56 2009-08-26 sb #i76393# on Linux, include dynamic section offset in crash report so as to be able to map "prelinked" callstacks back to original (patch by cmc) 2009-08-26 sb #i88162# remove unnecessary whitespace lines from per-locale xcu files (patch by tora) 2009-08-17 Juergen Schmidt #i104292# set context classloader after create new custom UNO loader 2009-08-17 Juergen Schmidt #i103749# integrate patch 2009-08-14 sb #i103269# cherry-picked ssh://hg@hg.services.openoffice.org/cws/sb111 -r 5124ebd5edd1 ("#i101955# changed encoding of XML file content from erroneous ISO-8859-1 to UTF-8") 2009-08-12 sb #i102469# fixed mis-applications of UnoRuntime.queryInterface (detected via the simplified UnoRuntime.queryInterface, the HG changeset 29de35fc9554) to use AnyConverter instead; changed qadevOOo's lib.MultiMethodTest.before to allow throwing arbitrary exceptions, to cater for IllegalArgumentException thrown by AnyConverter 2009-08-12 sb #i104178# drop extra libxml2-config script from libxmlsec 2009-08-10 sb #i101754# simplified osl_getProcessInfo for LINUX (patch by cmc) 2009-08-10 sb #i95018# avoid closing -1 fds (patch supplied by cmc) 2009-08-10 sb #i103585# removed (apparently unnecessary) zlib support from libxml2; in turn, removed zlib dependencies from libxmlsec, libxslt, and redland (assuming those were transitive dependencies brought in by direct dependencies on libxml2) 2009-08-10 sb #i102469# simplified UnoRuntime.queryInterface using Java 5 generics; adapted URE-related modules accordingly 2009-08-10 sb #i101213# adapted setsolar env (solenv/config/) to set PYTHONPATH (and not set PYTHONHOME) in accordance with configure env (set_soenv.in); fixed testtools/source/bridgetest/pyuno (which now should work everywhere out of the box, thanks to the fixed setsolar PYTHONPATH) 2009-08-10 sb cherry-picked ssh://hg@hg.services.openoffice.org/cws/sb111 -r ea8de6d9396b ("#i101955# work in progress for a .hgignore file, continued")
2009-09-16 14:37:52 +00:00
XType1 obj1b = UnoRuntime.queryInterface(XType1.class, obj1a);
success &= test("obj1a == obj1b", obj1a == obj1b);
Object obj2a = new XType2() {};
CWS-TOOLING: integrate CWS sb113 2009-09-01 sb #i76393# second attempt at properly #ifdef-ing previous HG commit d598efdbf012 2009-08-28 sb #i102469# change back <T extends XInterface> to just <T> on queryInterface, to avoid binary incompatibility (method changing its signature from (Ljava/lang/Class;Ljava/lang/Object;)Ljava/lang/Object; to (Ljava/lang/Class;Ljava/lang/Object;)Lcom/sun/star/uno/XInterface;) 2009-08-28 sb #i76393# properly #ifdef previous HG commit d598efdbf012 2009-08-27 sb #i94421# work around compiler error (based on a patch supplied by cloph) 2009-08-26 sb merged in DEV300_m56 2009-08-26 sb #i76393# on Linux, include dynamic section offset in crash report so as to be able to map "prelinked" callstacks back to original (patch by cmc) 2009-08-26 sb #i88162# remove unnecessary whitespace lines from per-locale xcu files (patch by tora) 2009-08-17 Juergen Schmidt #i104292# set context classloader after create new custom UNO loader 2009-08-17 Juergen Schmidt #i103749# integrate patch 2009-08-14 sb #i103269# cherry-picked ssh://hg@hg.services.openoffice.org/cws/sb111 -r 5124ebd5edd1 ("#i101955# changed encoding of XML file content from erroneous ISO-8859-1 to UTF-8") 2009-08-12 sb #i102469# fixed mis-applications of UnoRuntime.queryInterface (detected via the simplified UnoRuntime.queryInterface, the HG changeset 29de35fc9554) to use AnyConverter instead; changed qadevOOo's lib.MultiMethodTest.before to allow throwing arbitrary exceptions, to cater for IllegalArgumentException thrown by AnyConverter 2009-08-12 sb #i104178# drop extra libxml2-config script from libxmlsec 2009-08-10 sb #i101754# simplified osl_getProcessInfo for LINUX (patch by cmc) 2009-08-10 sb #i95018# avoid closing -1 fds (patch supplied by cmc) 2009-08-10 sb #i103585# removed (apparently unnecessary) zlib support from libxml2; in turn, removed zlib dependencies from libxmlsec, libxslt, and redland (assuming those were transitive dependencies brought in by direct dependencies on libxml2) 2009-08-10 sb #i102469# simplified UnoRuntime.queryInterface using Java 5 generics; adapted URE-related modules accordingly 2009-08-10 sb #i101213# adapted setsolar env (solenv/config/) to set PYTHONPATH (and not set PYTHONHOME) in accordance with configure env (set_soenv.in); fixed testtools/source/bridgetest/pyuno (which now should work everywhere out of the box, thanks to the fixed setsolar PYTHONPATH) 2009-08-10 sb cherry-picked ssh://hg@hg.services.openoffice.org/cws/sb111 -r ea8de6d9396b ("#i101955# work in progress for a .hgignore file, continued")
2009-09-16 14:37:52 +00:00
XType2 obj2b = UnoRuntime.queryInterface(XType2.class, obj2a);
success &= test("obj2a == obj2b", obj2a == obj2b);
Object obj3a = transport.getType1();
CWS-TOOLING: integrate CWS sb113 2009-09-01 sb #i76393# second attempt at properly #ifdef-ing previous HG commit d598efdbf012 2009-08-28 sb #i102469# change back <T extends XInterface> to just <T> on queryInterface, to avoid binary incompatibility (method changing its signature from (Ljava/lang/Class;Ljava/lang/Object;)Ljava/lang/Object; to (Ljava/lang/Class;Ljava/lang/Object;)Lcom/sun/star/uno/XInterface;) 2009-08-28 sb #i76393# properly #ifdef previous HG commit d598efdbf012 2009-08-27 sb #i94421# work around compiler error (based on a patch supplied by cloph) 2009-08-26 sb merged in DEV300_m56 2009-08-26 sb #i76393# on Linux, include dynamic section offset in crash report so as to be able to map "prelinked" callstacks back to original (patch by cmc) 2009-08-26 sb #i88162# remove unnecessary whitespace lines from per-locale xcu files (patch by tora) 2009-08-17 Juergen Schmidt #i104292# set context classloader after create new custom UNO loader 2009-08-17 Juergen Schmidt #i103749# integrate patch 2009-08-14 sb #i103269# cherry-picked ssh://hg@hg.services.openoffice.org/cws/sb111 -r 5124ebd5edd1 ("#i101955# changed encoding of XML file content from erroneous ISO-8859-1 to UTF-8") 2009-08-12 sb #i102469# fixed mis-applications of UnoRuntime.queryInterface (detected via the simplified UnoRuntime.queryInterface, the HG changeset 29de35fc9554) to use AnyConverter instead; changed qadevOOo's lib.MultiMethodTest.before to allow throwing arbitrary exceptions, to cater for IllegalArgumentException thrown by AnyConverter 2009-08-12 sb #i104178# drop extra libxml2-config script from libxmlsec 2009-08-10 sb #i101754# simplified osl_getProcessInfo for LINUX (patch by cmc) 2009-08-10 sb #i95018# avoid closing -1 fds (patch supplied by cmc) 2009-08-10 sb #i103585# removed (apparently unnecessary) zlib support from libxml2; in turn, removed zlib dependencies from libxmlsec, libxslt, and redland (assuming those were transitive dependencies brought in by direct dependencies on libxml2) 2009-08-10 sb #i102469# simplified UnoRuntime.queryInterface using Java 5 generics; adapted URE-related modules accordingly 2009-08-10 sb #i101213# adapted setsolar env (solenv/config/) to set PYTHONPATH (and not set PYTHONHOME) in accordance with configure env (set_soenv.in); fixed testtools/source/bridgetest/pyuno (which now should work everywhere out of the box, thanks to the fixed setsolar PYTHONPATH) 2009-08-10 sb cherry-picked ssh://hg@hg.services.openoffice.org/cws/sb111 -r ea8de6d9396b ("#i101955# work in progress for a .hgignore file, continued")
2009-09-16 14:37:52 +00:00
XType1 obj3b = UnoRuntime.queryInterface(XType1.class, obj3a);
success &= test(
"obj3a != obj3b; only meaningful as long as different proxy"
+ " instances are used for different UNO interfaces of one UNO"
+ " object",
obj3a != obj3b);
Object obj4a = transport.getType2();
CWS-TOOLING: integrate CWS sb113 2009-09-01 sb #i76393# second attempt at properly #ifdef-ing previous HG commit d598efdbf012 2009-08-28 sb #i102469# change back <T extends XInterface> to just <T> on queryInterface, to avoid binary incompatibility (method changing its signature from (Ljava/lang/Class;Ljava/lang/Object;)Ljava/lang/Object; to (Ljava/lang/Class;Ljava/lang/Object;)Lcom/sun/star/uno/XInterface;) 2009-08-28 sb #i76393# properly #ifdef previous HG commit d598efdbf012 2009-08-27 sb #i94421# work around compiler error (based on a patch supplied by cloph) 2009-08-26 sb merged in DEV300_m56 2009-08-26 sb #i76393# on Linux, include dynamic section offset in crash report so as to be able to map "prelinked" callstacks back to original (patch by cmc) 2009-08-26 sb #i88162# remove unnecessary whitespace lines from per-locale xcu files (patch by tora) 2009-08-17 Juergen Schmidt #i104292# set context classloader after create new custom UNO loader 2009-08-17 Juergen Schmidt #i103749# integrate patch 2009-08-14 sb #i103269# cherry-picked ssh://hg@hg.services.openoffice.org/cws/sb111 -r 5124ebd5edd1 ("#i101955# changed encoding of XML file content from erroneous ISO-8859-1 to UTF-8") 2009-08-12 sb #i102469# fixed mis-applications of UnoRuntime.queryInterface (detected via the simplified UnoRuntime.queryInterface, the HG changeset 29de35fc9554) to use AnyConverter instead; changed qadevOOo's lib.MultiMethodTest.before to allow throwing arbitrary exceptions, to cater for IllegalArgumentException thrown by AnyConverter 2009-08-12 sb #i104178# drop extra libxml2-config script from libxmlsec 2009-08-10 sb #i101754# simplified osl_getProcessInfo for LINUX (patch by cmc) 2009-08-10 sb #i95018# avoid closing -1 fds (patch supplied by cmc) 2009-08-10 sb #i103585# removed (apparently unnecessary) zlib support from libxml2; in turn, removed zlib dependencies from libxmlsec, libxslt, and redland (assuming those were transitive dependencies brought in by direct dependencies on libxml2) 2009-08-10 sb #i102469# simplified UnoRuntime.queryInterface using Java 5 generics; adapted URE-related modules accordingly 2009-08-10 sb #i101213# adapted setsolar env (solenv/config/) to set PYTHONPATH (and not set PYTHONHOME) in accordance with configure env (set_soenv.in); fixed testtools/source/bridgetest/pyuno (which now should work everywhere out of the box, thanks to the fixed setsolar PYTHONPATH) 2009-08-10 sb cherry-picked ssh://hg@hg.services.openoffice.org/cws/sb111 -r ea8de6d9396b ("#i101955# work in progress for a .hgignore file, continued")
2009-09-16 14:37:52 +00:00
XType2 obj4b = UnoRuntime.queryInterface(XType2.class, obj4a);
success &= test(
"obj4a != obj4b; only meaningful as long as different proxy"
+ " instances are used for different UNO interfaces of one UNO"
+ " object",
obj4a != obj4b);
success &= test("UnoRuntime.areSame(null, null)",
UnoRuntime.areSame(null, null));
success &= test("!UnoRuntime.areSame(null, obj1a)",
!UnoRuntime.areSame(null, obj1a));
success &= test("!UnoRuntime.areSame(null, obj1b)",
!UnoRuntime.areSame(null, obj1b));
success &= test("!UnoRuntime.areSame(null, obj2a)",
!UnoRuntime.areSame(null, obj2a));
success &= test("!UnoRuntime.areSame(null, obj2b)",
!UnoRuntime.areSame(null, obj2b));
success &= test("!UnoRuntime.areSame(null, obj3a)",
!UnoRuntime.areSame(null, obj3a));
success &= test("!UnoRuntime.areSame(null, obj3b)",
!UnoRuntime.areSame(null, obj3b));
success &= test("!UnoRuntime.areSame(null, obj4a)",
!UnoRuntime.areSame(null, obj4a));
success &= test("!UnoRuntime.areSame(null, obj4b)",
!UnoRuntime.areSame(null, obj4b));
success &= test("!obj1a.equals(null)", !obj1a.equals(null));
success &= test("!UnoRuntime.areSame(obj1a, null)",
!UnoRuntime.areSame(obj1a, null));
success &= test("obj1a.equals(obj1a)", obj1a.equals(obj1a));
success &= test("UnoRuntime.areSame(obj1a, obj1a)",
UnoRuntime.areSame(obj1a, obj1a));
success &= test("obj1a.equals(obj1b)", obj1a.equals(obj1b));
success &= test("UnoRuntime.areSame(obj1a, obj1b)",
UnoRuntime.areSame(obj1a, obj1b));
success &= test("!obj1a.equals(obj2a)", !obj1a.equals(obj2a));
success &= test("!UnoRuntime.areSame(obj1a, obj2a)",
!UnoRuntime.areSame(obj1a, obj2a));
success &= test("!obj1a.equals(obj2b)", !obj1a.equals(obj2b));
success &= test("!UnoRuntime.areSame(obj1a, obj2b)",
!UnoRuntime.areSame(obj1a, obj2b));
success &= test("!obj1a.equals(obj3a)", !obj1a.equals(obj3a));
success &= test("!UnoRuntime.areSame(obj1a, obj3a)",
!UnoRuntime.areSame(obj1a, obj3a));
success &= test("!obj1a.equals(obj3b)", !obj1a.equals(obj3b));
success &= test("!UnoRuntime.areSame(obj1a, obj3b)",
!UnoRuntime.areSame(obj1a, obj3b));
success &= test("!obj1a.equals(obj4a)", !obj1a.equals(obj4a));
success &= test("!UnoRuntime.areSame(obj1a, obj4a)",
!UnoRuntime.areSame(obj1a, obj4a));
success &= test("!obj1a.equals(obj4b)", !obj1a.equals(obj4b));
success &= test("!UnoRuntime.areSame(obj1a, obj4b)",
!UnoRuntime.areSame(obj1a, obj4b));
success &= test("!obj1b.equals(null)", !obj1b.equals(null));
success &= test("!UnoRuntime.areSame(obj1b, null)",
!UnoRuntime.areSame(obj1b, null));
success &= test("obj1b.equals(obj1a)", obj1b.equals(obj1a));
success &= test("UnoRuntime.areSame(obj1b, obj1a)",
UnoRuntime.areSame(obj1b, obj1a));
success &= test("obj1b.equals(obj1b)", obj1b.equals(obj1b));
success &= test("UnoRuntime.areSame(obj1b, obj1b)",
UnoRuntime.areSame(obj1b, obj1b));
success &= test("!obj1b.equals(obj2a)", !obj1b.equals(obj2a));
success &= test("!UnoRuntime.areSame(obj1b, obj2a)",
!UnoRuntime.areSame(obj1b, obj2a));
success &= test("!obj1b.equals(obj2b)", !obj1b.equals(obj2b));
success &= test("!UnoRuntime.areSame(obj1b, obj2b)",
!UnoRuntime.areSame(obj1b, obj2b));
success &= test("!obj1b.equals(obj3a)", !obj1b.equals(obj3a));
success &= test("!UnoRuntime.areSame(obj1b, obj3a)",
!UnoRuntime.areSame(obj1b, obj3a));
success &= test("!obj1b.equals(obj3b)", !obj1b.equals(obj3b));
success &= test("!UnoRuntime.areSame(obj1b, obj3b)",
!UnoRuntime.areSame(obj1b, obj3b));
success &= test("!obj1b.equals(obj4a)", !obj1b.equals(obj4a));
success &= test("!UnoRuntime.areSame(obj1b, obj4a)",
!UnoRuntime.areSame(obj1b, obj4a));
success &= test("!obj1b.equals(obj4b)", !obj1b.equals(obj4b));
success &= test("!UnoRuntime.areSame(obj1b, obj4b)",
!UnoRuntime.areSame(obj1b, obj4b));
success &= test("!obj2a.equals(null)", !obj2a.equals(null));
success &= test("!UnoRuntime.areSame(obj2a, null)",
!UnoRuntime.areSame(obj2a, null));
success &= test("!obj2a.equals(obj1a)", !obj2a.equals(obj1a));
success &= test("!UnoRuntime.areSame(obj2a, obj1a)",
!UnoRuntime.areSame(obj2a, obj1a));
success &= test("!obj2a.equals(obj1b)", !obj2a.equals(obj1b));
success &= test("!UnoRuntime.areSame(obj2a, obj1b)",
!UnoRuntime.areSame(obj2a, obj1b));
success &= test("obj2a.equals(obj2a)", obj2a.equals(obj2a));
success &= test("UnoRuntime.areSame(obj2a, obj2a)",
UnoRuntime.areSame(obj2a, obj2a));
success &= test("obj2a.equals(obj2b)", obj2a.equals(obj2b));
success &= test("UnoRuntime.areSame(obj2a, obj2b)",
UnoRuntime.areSame(obj2a, obj2b));
success &= test("!obj2a.equals(obj3a)", !obj2a.equals(obj3a));
success &= test("!UnoRuntime.areSame(obj2a, obj3a)",
!UnoRuntime.areSame(obj2a, obj3a));
success &= test("!obj2a.equals(obj3b)", !obj2a.equals(obj3b));
success &= test("!UnoRuntime.areSame(obj2a, obj3b)",
!UnoRuntime.areSame(obj2a, obj3b));
success &= test("!obj2a.equals(obj4a)", !obj2a.equals(obj4a));
success &= test("!UnoRuntime.areSame(obj2a, obj4a)",
!UnoRuntime.areSame(obj2a, obj4a));
success &= test("!obj2a.equals(obj4b)", !obj2a.equals(obj4b));
success &= test("!UnoRuntime.areSame(obj2a, obj4b)",
!UnoRuntime.areSame(obj2a, obj4b));
success &= test("!obj2b.equals(null)", !obj2b.equals(null));
success &= test("!UnoRuntime.areSame(obj2b, null)",
!UnoRuntime.areSame(obj2b, null));
success &= test("!obj2b.equals(obj1a)", !obj2b.equals(obj1a));
success &= test("!UnoRuntime.areSame(obj2b, obj1a)",
!UnoRuntime.areSame(obj2b, obj1a));
success &= test("!obj2b.equals(obj1b)", !obj2b.equals(obj1b));
success &= test("!UnoRuntime.areSame(obj2b, obj1b)",
!UnoRuntime.areSame(obj2b, obj1b));
success &= test("obj2b.equals(obj2a)", obj2b.equals(obj2a));
success &= test("UnoRuntime.areSame(obj2b, obj2a)",
UnoRuntime.areSame(obj2b, obj2a));
success &= test("obj2b.equals(obj2b)", obj2b.equals(obj2b));
success &= test("UnoRuntime.areSame(obj2b, obj2b)",
UnoRuntime.areSame(obj2b, obj2b));
success &= test("!obj2b.equals(obj3a)", !obj2b.equals(obj3a));
success &= test("!UnoRuntime.areSame(obj2b, obj3a)",
!UnoRuntime.areSame(obj2b, obj3a));
success &= test("!obj2b.equals(obj3b)", !obj2b.equals(obj3b));
success &= test("!UnoRuntime.areSame(obj2b, obj3b)",
!UnoRuntime.areSame(obj2b, obj3b));
success &= test("!obj2b.equals(obj4a)", !obj2b.equals(obj4a));
success &= test("!UnoRuntime.areSame(obj2b, obj4a)",
!UnoRuntime.areSame(obj2b, obj4a));
success &= test("!obj2b.equals(obj4b)", !obj2b.equals(obj4b));
success &= test("!UnoRuntime.areSame(obj2b, obj4b)",
!UnoRuntime.areSame(obj2b, obj4b));
success &= test("!obj3a.equals(null)", !obj3a.equals(null));
success &= test("!UnoRuntime.areSame(obj3a, null)",
!UnoRuntime.areSame(obj3a, null));
success &= test("!obj3a.equals(obj1a)", !obj3a.equals(obj1a));
success &= test("!UnoRuntime.areSame(obj3a, obj1a)",
!UnoRuntime.areSame(obj3a, obj1a));
success &= test("!obj3a.equals(obj1b)", !obj3a.equals(obj1b));
success &= test("!UnoRuntime.areSame(obj3a, obj1b)",
!UnoRuntime.areSame(obj3a, obj1b));
success &= test("!obj3a.equals(obj2a)", !obj3a.equals(obj2a));
success &= test("!UnoRuntime.areSame(obj3a, obj2a)",
!UnoRuntime.areSame(obj3a, obj2a));
success &= test("!obj3a.equals(obj2b)", !obj3a.equals(obj2b));
success &= test("!UnoRuntime.areSame(obj3a, obj2b)",
!UnoRuntime.areSame(obj3a, obj2b));
success &= test("obj3a.equals(obj3a)", obj3a.equals(obj3a));
success &= test("UnoRuntime.areSame(obj3a, obj3a)",
UnoRuntime.areSame(obj3a, obj3a));
success &= test("obj3a.equals(obj3b)", obj3a.equals(obj3b));
success &= test("UnoRuntime.areSame(obj3a, obj3b)",
UnoRuntime.areSame(obj3a, obj3b));
success &= test("!obj3a.equals(obj4a)", !obj3a.equals(obj4a));
success &= test("!UnoRuntime.areSame(obj3a, obj4a)",
!UnoRuntime.areSame(obj3a, obj4a));
success &= test("!obj3a.equals(obj4b)", !obj3a.equals(obj4b));
success &= test("!UnoRuntime.areSame(obj3a, obj4b)",
!UnoRuntime.areSame(obj3a, obj4b));
success &= test("!obj3b.equals(null)", !obj3b.equals(null));
success &= test("!UnoRuntime.areSame(obj3b, null)",
!UnoRuntime.areSame(obj3b, null));
success &= test("!obj3b.equals(obj1a)", !obj3b.equals(obj1a));
success &= test("!UnoRuntime.areSame(obj3b, obj1a)",
!UnoRuntime.areSame(obj3b, obj1a));
success &= test("!obj3b.equals(obj1b)", !obj3b.equals(obj1b));
success &= test("!UnoRuntime.areSame(obj3b, obj1b)",
!UnoRuntime.areSame(obj3b, obj1b));
success &= test("!obj3b.equals(obj2a)", !obj3b.equals(obj2a));
success &= test("!UnoRuntime.areSame(obj3b, obj2a)",
!UnoRuntime.areSame(obj3b, obj2a));
success &= test("!obj3b.equals(obj2b)", !obj3b.equals(obj2b));
success &= test("!UnoRuntime.areSame(obj3b, obj2b)",
!UnoRuntime.areSame(obj3b, obj2b));
success &= test("obj3b.equals(obj3a)", obj3b.equals(obj3a));
success &= test("UnoRuntime.areSame(obj3b, obj3a)",
UnoRuntime.areSame(obj3b, obj3a));
success &= test("obj3b.equals(obj3b)", obj3b.equals(obj3b));
success &= test("UnoRuntime.areSame(obj3b, obj3b)",
UnoRuntime.areSame(obj3b, obj3b));
success &= test("!obj3b.equals(obj4a)", !obj3b.equals(obj4a));
success &= test("!UnoRuntime.areSame(obj3b, obj4a)",
!UnoRuntime.areSame(obj3b, obj4a));
success &= test("!obj3b.equals(obj4b)", !obj3b.equals(obj4b));
success &= test("!UnoRuntime.areSame(obj3b, obj4b)",
!UnoRuntime.areSame(obj3b, obj4b));
success &= test("!obj4a.equals(null)", !obj4a.equals(null));
success &= test("!UnoRuntime.areSame(obj4a, null)",
!UnoRuntime.areSame(obj4a, null));
success &= test("!obj4a.equals(obj1a)", !obj4a.equals(obj1a));
success &= test("!UnoRuntime.areSame(obj4a, obj1a)",
!UnoRuntime.areSame(obj4a, obj1a));
success &= test("!obj4a.equals(obj1b)", !obj4a.equals(obj1b));
success &= test("!UnoRuntime.areSame(obj4a, obj1b)",
!UnoRuntime.areSame(obj4a, obj1b));
success &= test("!obj4a.equals(obj2a)", !obj4a.equals(obj2a));
success &= test("!UnoRuntime.areSame(obj4a, obj2a)",
!UnoRuntime.areSame(obj4a, obj2a));
success &= test("!obj4a.equals(obj2b)", !obj4a.equals(obj2b));
success &= test("!UnoRuntime.areSame(obj4a, obj2b)",
!UnoRuntime.areSame(obj4a, obj2b));
success &= test("!obj4a.equals(obj3a)", !obj4a.equals(obj3a));
success &= test("!UnoRuntime.areSame(obj4a, obj3a)",
!UnoRuntime.areSame(obj4a, obj3a));
success &= test("!obj4a.equals(obj3b)", !obj4a.equals(obj3b));
success &= test("!UnoRuntime.areSame(obj4a, obj3b)",
!UnoRuntime.areSame(obj4a, obj3b));
success &= test("obj4a.equals(obj4a)", obj4a.equals(obj4a));
success &= test("UnoRuntime.areSame(obj4a, obj4a)",
UnoRuntime.areSame(obj4a, obj4a));
success &= test("obj4a.equals(obj4b)", obj4a.equals(obj4b));
success &= test("UnoRuntime.areSame(obj4a, obj4b)",
UnoRuntime.areSame(obj4a, obj4b));
success &= test("!obj4b.equals(null)", !obj4b.equals(null));
success &= test("!UnoRuntime.areSame(obj4b, null)",
!UnoRuntime.areSame(obj4b, null));
success &= test("!obj4b.equals(obj1a)", !obj4b.equals(obj1a));
success &= test("!UnoRuntime.areSame(obj4b, obj1a)",
!UnoRuntime.areSame(obj4b, obj1a));
success &= test("!obj4b.equals(obj1b)", !obj4b.equals(obj1b));
success &= test("!UnoRuntime.areSame(obj4b, obj1b)",
!UnoRuntime.areSame(obj4b, obj1b));
success &= test("!obj4b.equals(obj2a)", !obj4b.equals(obj2a));
success &= test("!UnoRuntime.areSame(obj4b, obj2a)",
!UnoRuntime.areSame(obj4b, obj2a));
success &= test("!obj4b.equals(obj2b)", !obj4b.equals(obj2b));
success &= test("!UnoRuntime.areSame(obj4b, obj2b)",
!UnoRuntime.areSame(obj4b, obj2b));
success &= test("!obj4b.equals(obj3a)", !obj4b.equals(obj3a));
success &= test("!UnoRuntime.areSame(obj4b, obj3a)",
!UnoRuntime.areSame(obj4b, obj3a));
success &= test("!obj4b.equals(obj3b)", !obj4b.equals(obj3b));
success &= test("!UnoRuntime.areSame(obj4b, obj3b)",
!UnoRuntime.areSame(obj4b, obj3b));
success &= test("obj4b.equals(obj4a)", obj4b.equals(obj4a));
success &= test("UnoRuntime.areSame(obj4b, obj4a)",
UnoRuntime.areSame(obj4b, obj4a));
success &= test("obj4b.equals(obj4b)", obj4b.equals(obj4b));
success &= test("UnoRuntime.areSame(obj4b, obj4b)",
UnoRuntime.areSame(obj4b, obj4b));
success &= test("obj1a.hashCode() == obj1b.hashCode()",
obj1a.hashCode() == obj1b.hashCode());
success &= test("obj2a.hashCode() == obj2b.hashCode()",
obj2a.hashCode() == obj2b.hashCode());
success &= test("obj3a.hashCode() == obj3b.hashCode()",
obj3a.hashCode() == obj3b.hashCode());
success &= test("obj4a.hashCode() == obj4b.hashCode()",
obj4a.hashCode() == obj4b.hashCode());
return success;
}
private static boolean test(String message, boolean condition) {
if (!condition) {
System.err.println("Failed: " + message);
}
return condition;
}
}
private static final class Provider implements XInstanceProvider {
public Object getInstance(String instanceName) {
return new XTransport() {
public Object getType1() {
return new XType1() {};
}
public Object getType2() {
return new XType2() {};
}
};
}
}
public interface XTransport extends XInterface {
Object getType1();
Object getType2();
TypeInfo[] UNOTYPEINFO = { new MethodTypeInfo("getType1", 0, 0),
new MethodTypeInfo("getType2", 1, 0) };
}
public interface XType1 extends XInterface {
TypeInfo[] UNOTYPEINFO = null;
}
public interface XType2 extends XInterface {
TypeInfo[] UNOTYPEINFO = null;
}
}