This would be a great feature. The only database I have access to which supports UDTs is PostgreSQL, but I dont know UDTs well enough to say for sure how hard this is going to be to support in a generic manner.
Since you seem to have given this more thought than I have, would you be interested in writing a StructType.java to support STRUCTS in your database and contribute it to SQLUnit?
If you are interested, check out the "writing your own type" section of the documentation to see how the StructType.java will interface with SQLUnit.
TIA
-sujit
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I've got Oracle stored procs to test that return STRUCTs containing ARRAYs of more STRUCTs (Don't ask; I didn't write them).
I'll see how far I get this week on handling just basic structs. I'm changing the <bean> tag to <struct> but am open to whatever words you think are best.
-doug
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I applied the patch that you sent me manually (for some reason I was unable to patch the code directly, not sure why). The change was to replace tcs with tcs.hashCode() right?
So I've (finally) got past the CVS change. Since sourceforge changed servers, I had to do a fresh checkout from the other server. I will reply to your email about the other fixes you were sending on Monday (I dont have the message right now).
-sujit
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Yes, thanks for catching that, it was lenggi in the developer's forum. I found this out later. In any case, I was able to get the new cvs repository to work, so I will be able to apply your patch now. Sorry about the delay.
Regarding your question in the email, I would suggest doing this. At the root of your sqlunit code, run:
cvs diff -up > /path/to/patchfile.patch
Then send me the patchfile as an attachment. You can click on the Patches link, it should allow you to upload a patch file.
I will then be able to apply your patch like so:
patch -p0 <patchfile.patch
Sending me individual files or a cvs diff works too, but it would be more time consuming for me to manually apply the patches.
Thanks
-sujit
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Will the next version handle user-defined types returned as STRUCTs? I'm thinking of something like:
...
<param id="1" inout="out" type="STRUCT" typename="MY_OBJ_TYP" classname="MyBean">
...
<outparam id="1">
<bean classname="MyBean">
<field name="capacity">3</field>
</bean>
</outparam>
where the returned object would be treated as a JavaBean.
Since the class name is only used to create an entry in the type map and there might be nested UDTs, it might make more sense to use:
<connection>
...
<typemap>
<typedef typename="MY_OBJ_TYP" classname="MyBean" />
<typedef typename="MY_SUB_OBJ_TYPE" classname="MySubBean">
<typemap>
</connection>
instead of <param ... classname="MyBean">.
The classname attribute of the bean element probably isn't needed either. So we might have:
<outparam id="1" type="STRUCT">
<bean>
<field name="capacity">3</field>
<field name="subBean">
<bean><field name="width">11</field></bean>
</field>
</bean>
</outparam>
Hi Douglas,
This would be a great feature. The only database I have access to which supports UDTs is PostgreSQL, but I dont know UDTs well enough to say for sure how hard this is going to be to support in a generic manner.
Since you seem to have given this more thought than I have, would you be interested in writing a StructType.java to support STRUCTS in your database and contribute it to SQLUnit?
If you are interested, check out the "writing your own type" section of the documentation to see how the StructType.java will interface with SQLUnit.
TIA
-sujit
I've got Oracle stored procs to test that return STRUCTs containing ARRAYs of more STRUCTs (Don't ask; I didn't write them).
I'll see how far I get this week on handling just basic structs. I'm changing the <bean> tag to <struct> but am open to whatever words you think are best.
-doug
Hi David,
Yes, the <struct> sounds better than <bean> in that it specifies the kind of data that is to follow. Thanks in advance for taking this on.
-sujit
I applied the patch that you sent me manually (for some reason I was unable to patch the code directly, not sure why). The change was to replace tcs with tcs.hashCode() right?
So I've (finally) got past the CVS change. Since sourceforge changed servers, I had to do a fresh checkout from the other server. I will reply to your email about the other fixes you were sending on Monday (I dont have the message right now).
-sujit
I haven't sent you any patches yet. Must have been someone else.
-doug
Hi Doug,
Yes, thanks for catching that, it was lenggi in the developer's forum. I found this out later. In any case, I was able to get the new cvs repository to work, so I will be able to apply your patch now. Sorry about the delay.
Regarding your question in the email, I would suggest doing this. At the root of your sqlunit code, run:
cvs diff -up > /path/to/patchfile.patch
Then send me the patchfile as an attachment. You can click on the Patches link, it should allow you to upload a patch file.
I will then be able to apply your patch like so:
patch -p0 <patchfile.patch
Sending me individual files or a cvs diff works too, but it would be more time consuming for me to manually apply the patches.
Thanks
-sujit