Commit b30c4a4f authored by Pete Gillin's avatar Pete Gillin
Browse files

Fix the harmony tests for java.beans.PropertyChangeSupport.

Prior to this change, the tests were requiring that, for example, if
you add a proxy to a proxy to a regular listener, and then call the
no-arg getter, it will return a different proxy to a different proxy
to the same regular listener. The android implementation failed this
test, because it only returned a proxy to the regular listener,
i.e. it didn't re-wrap it to the original depth. With this change, the
test requires that it should be wrapped in *up two* two layers rather
than *exactly* two layers. I can see nothing in the javadoc that seems
to require the stricter behaviour. I can't imagine any user caring
(all they'll care about is that the listeners behave correctly). And
we've lived for 7 years with the current behaviour without anyone
complaining. It's not worth the effort and risk of changing the
behaviour now, but it is better to have tests which assert sensible
behaviour consistent with the javadoc is better than having no tests
at all (which is what we have right now, since these tests are
suppressed).

Additionally, prior to this change, there was no test for the property
names of the proxy listeners. This is required to be correct by the
javadoc, and it does provide value to users who want to examine the
listeners, so it makes sense to add these assertions.

Bug: 17433734
Fixes: 17433734
Test: make cts && cts-tradefed run cts -m CtsLibcoreTestCases --primary-abi-only -t com.android.org.apache.harmony.beans.tests.java.beans.PropertyChangeSupportTest
Change-Id: I44bdef8d4fc2222b57e969d71a18370f8eede886
parent a0527d8a
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment