db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Kalén <mka...@apache.org>
Subject ProxyExamples#testReferenceProxyWithInheritance
Date Fri, 15 Sep 2006 14:21:16 GMT
Is the testcase ProxyExamples#testReferenceProxyWithInheritance
a known failure on the 1.0.x branch at the moment?

I'm currently looking into a fix for dynamic proxies when using
per-thread metadata profiles - a follow-up on a fix I did for
CollectionProxy-instances a long time ago, see:

I have not actually tried to rollback my changes and see if they
are responsible but the are so isolated to per-thread mode so
I am pretty sure they are not...

testReferenceProxyWithInheritance fails because the proxied unloaded
instances are only instanceof Ownable, not the specific instanceof
checked by the following asserts in the testcase:
325:assertTrue(owned1 instanceof Ownable2);
326:assertTrue(owned2 instanceof Ownable1);

There is a comment in the testcase:
323:// This should be true according the docs of class Proxy and because
324:// the concrete classes are Onwable2Impl/Onwable1Impl

However, are not the comments and asserts wrong? The proxies are
instanceof Ownable until they are materialized, when the instances
are indeed instanceof the more specific interfaces.

If I change the testcase lines 325-326 to this:
  assertTrue(owned1 instanceof Ownable);
  assertTrue(owned2 instanceof Ownable);
  assertTrue(ProxyHelper.getRealObject(owned1) instanceof Ownable2);
  assertTrue(ProxyHelper.getRealObject(owned2) instanceof Ownable1);
...it passes.

Any comments on this? I am thinking wrong and the old testcase code
correct? (In that case something in proxy generation code needs to
be fixed, since the test currently fails.)


To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org

View raw message