Hi Geoff, You should have no trouble using setAccessible. There are several demos of this in the source code for the book [1] that use setAccessible to check private fields in a unit test. (See lancet/test/ step-2-complete.clj [2], for instance).
Hope this helps, Stu [1] http://github.com/stuarthalloway/programming-clojure/tree/master [2] http://github.com/stuarthalloway/programming-clojure/blob/401f348b53ddf8ba9b90a445981a134c5eb20783/lancet/test/step_2_complete.clj > > What are the limitations of Clojure and Java interoperability? Are > they clearly stated somewhere? > > I have been experimenting with using Clojure to test some existing > Java code (being able to do so makes a convincing argument to use it > where I work) and I've noticed that there doesn't seem to be any way > to call or access package-protected methods or fields -- either that > or I'm doing something wrong. :) > > I've also been trying use the java.lang.reflect capabilities (such as > setAccessible() in java.lang.reflect.AccessbileObject) and noticed > that they do not have an effect. How much can be done using those > libraries within Clojure to affect Java code? > > Any information provided would be most helpful. Being able to use > Clojure to write tests for existing Java code (that extensively > employs package-protected methods and fields) would be a nice way to > demonstrate Clojure's capabilities to some people I work with. > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~----------~----~----~----~------~----~------~--~---