Really, it's just a matter of submitting test cases for basically any functionality you'd expect to have in Java integration, even down to simple method call logic on Java types. We have some of that in larger cases, but very little of it in explicit test cases. That's what we need...so some possible categories for tests:
- Java classes entering the system and introspecting like they're Ruby classes
- Java object instances entering the system and behaving like Ruby objects (normal Ruby operations working like to_s, type, etc)
- Java object instances entering the system and exposing appropriate methods
- Type coercion working as expected where you want it to, like numeric types coercing to Ruby numeric types in sane ways
- Noncoercing methods getting decorated with behaviors you'd expect to see, like making Java Collection work as a Ruby Enumerable, and so on. This would probably also include cases for Java numeric types exposing appropriate coercion and operations as Ruby numeric types.
- Method selection logic mapping to what you would expect given specific types. So if you call with a fixnum, would you expect it to try to call the narrowest method for the fixnum value, or a "long" version all the time?
- Inherited methods working correctly
- Reopening Java types and having access to actual class internals. This may or may not be possible, but it's something people expect to be possible.
- Subclassing of Java types, making sure polymorphic dispatch works and making sure superclass protected members are available
- Interface implementation, making sure dispatch for a wide range of interface method types work correctly
And there's much more, of course.
Here's a possible fix for this. It at least lets you get at the generated class with MyClass.java_class, as follows:
There's more work to do here in general, since we're creating a new class of objects that represent Java classes...I think we can reconcile the two worlds, but the code we have now needs a vast simplification...