Thanks for the links, Stuart, although I managed to figure out what I
was doing wrong: I didn't realize that the Java vararg type Object...
mapped to a sequence in Clojure, so I wasn't properly calling 'invoke'
in java.lang.reflect.Method.

Again, thanks for the links. I'm sure they'll be helpful in the
future.

On Apr 2, 11:26 pm, Stuart Halloway <stuart.hallo...@gmail.com> wrote:
> 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/401f348b53d...
>
>
>
>
>
> > 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
-~----------~----~----~----~------~----~------~--~---

Reply via email to