[ 
http://issues.apache.org/jira/browse/DERBY-1075?page=comments#action_12371334 ] 

David Van Couvering commented on DERBY-1075:
--------------------------------------------

I looked at this patch and it looks *very good*!  Thanks, Deepa, for addressing 
a very important issue and writing code that is very easy to read and follow.

I did have one little eensy weensy comment -- I am not *sure* you need to set 
the context classloader, but I suspect this may be needed by the underlying 
classloader stuff in the engine.  

Also, if you tire of reflection, there is another way to do this using 
interfaces that makes writing test code much easier.  Basically, you define an 
interface that is implemented by the class you are trying to work with (e.g. 
the metadata test class).  Then you can cast the class you load with your 
specialized classloader into the interface you have defined.  It's OK that the 
interface and the implementation are loaded by different classloaders (as long 
as the interface class is *only* loaded by your default classloader and not by 
the specialized one, which is generally the case).  After that you can invoke 
methods on the interface using regular, type-checked Java code.

I have some code that shows how this is done sitting in my sandbox for the 
classloading work I was doing for shared code if you'd like to see an example.

Right now, it's not a lot of reflection, but in case it starts getting a little 
hairy...

I vote +1 on this patch, but I personally hesitate to commit it without some 
other folks reviewing it.  Deepa, if you don't get any other reviews in the 
next few days, let me know, and I'll go ahead and commit.

David

> Combine the script and the test available for upgrade testing into a java test
> ------------------------------------------------------------------------------
>
>          Key: DERBY-1075
>          URL: http://issues.apache.org/jira/browse/DERBY-1075
>      Project: Derby
>         Type: Sub-task
>     Reporter: Deepa Remesh
>     Assignee: Deepa Remesh
>     Priority: Minor
>      Fix For: 10.2.0.0
>  Attachments: derby-1075-patch1-draft.diff, derby-1075-patch1-draft.status, 
> derby-1075-v1.diff, derby-1075-v1.status, loader.java, loader_v2.java
>
> Separating a part of DERBY-514 into a sub-task. This sub-task is to combine 
> the script 'runphases.ksh' and the java file 'phaseTester.java' into a single 
> java test. This will help to later add the upgrade tests into the regression 
> suite. Also, this sub-task can be done independent of DERBY-1049 which is 
> blocking DERBY-514.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira

Reply via email to