ValidationError class

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

ValidationError class

mmimica
Hello!

I just noticed that ValidationError>>model: says "self parameter:
aClass", while #parameter: is not understood by the object hierarchy.
At least not in Pharo 1.4. Clearly a mistake.
Reply | Threaded
Open this post in threaded view
|

Re: ValidationError class

Guillermo Polito
Hi Milan!

I wonder if you can be more specific :).  Which project are you using?  Where does that class come from.

Thanks!
Guille

On Sat, May 26, 2012 at 5:45 PM, Milan Mimica <[hidden email]> wrote:
Hello!

I just noticed that ValidationError>>model: says "self parameter:
aClass", while #parameter: is not understood by the object hierarchy.
At least not in Pharo 1.4. Clearly a mistake.

Reply | Threaded
Open this post in threaded view
|

Re: ValidationError class

mmimica
On 30 May 2012 11:43, Guillermo Polito <[hidden email]> wrote:
Hi Milan!

I wonder if you can be more specific :).  Which project are you using?  Where does that class come from.

It belongs to the Glorp-Misc package.
So it's part of Glorp port. Not sure if this is the right place to complain...


--
Milan Mimica
http://sparklet.sf.net
Reply | Threaded
Open this post in threaded view
|

Re: ValidationError class

Guillermo Polito
Sure it is!  We will see if the right thing is to do is to report it or fix it directly on our branch.

BTW, can you provide us a little snipped of code showing how you get originally the error? :)  Because it seems it is not tested since tests never went through that case.  That way we can create a new unit test for glorp ;).

Thanks!
Guille

On Wed, May 30, 2012 at 3:57 PM, Milan Mimica <[hidden email]> wrote:
On 30 May 2012 11:43, Guillermo Polito <[hidden email]> wrote:
Hi Milan!

I wonder if you can be more specific :).  Which project are you using?  Where does that class come from.

It belongs to the Glorp-Misc package.
So it's part of Glorp port. Not sure if this is the right place to complain...


--
Milan Mimica
http://sparklet.sf.net

Reply | Threaded
Open this post in threaded view
|

Re: ValidationError class

mmimica
On 30 May 2012 16:42, Guillermo Polito <[hidden email]> wrote:
Sure it is!  We will see if the right thing is to do is to report it or fix it directly on our branch.

BTW, can you provide us a little snipped of code showing how you get originally the error? :)  Because it seems it is not tested since tests never went through that case.  That way we can create a new unit test for glorp ;).

I have a batter idea. Why don't I provide a test for it?


--
Milan Mimica
http://sparklet.sf.net
Reply | Threaded
Open this post in threaded view
|

Re: ValidationError class

Guillermo Polito

On Wed, May 30, 2012 at 8:01 PM, Milan Mimica <[hidden email]> wrote:
On 30 May 2012 16:42, Guillermo Polito <[hidden email]> wrote:
Sure it is!  We will see if the right thing is to do is to report it or fix it directly on our branch.

BTW, can you provide us a little snipped of code showing how you get originally the error? :)  Because it seems it is not tested since tests never went through that case.  That way we can create a new unit test for glorp ;).

I have a batter idea. Why don't I provide a test for it?

Would be great :).

Tx!
 


--
Milan Mimica
http://sparklet.sf.net

Reply | Threaded
Open this post in threaded view
|

Re: ValidationError class

mmimica
On 30 May 2012 20:02, Guillermo Polito <[hidden email]> wrote:
On Wed, May 30, 2012 at 8:01 PM, Milan Mimica <[hidden email]> wrote:

I have a better idea. Why don't I provide a test for it?

Would be great :).

I just can't figure how to make a patch so here it is. Just add it to GlorpDescriptorValidationTest class.

testValidateMultipleMappingsError
| descriptor table mapping1 mapping2 system field1 field2 |
system := DynamicDescriptorSystem new.
descriptor := system addEmptyDescriptorFor: GlorpCustomer.
table := DatabaseTable named: 'Table1'.
field1 := table createFieldNamed: 'one' type: OraclePlatform new integer.
field2 := table createFieldNamed: 'two' type: OraclePlatform new integer.
descriptor addTable: table.
mapping1 := descriptor newMapping: DirectMapping.
mapping1 from: #id to: field1.
mapping2 := descriptor newMapping: DirectMapping.
mapping2 from: #id to: field2.
self should: [descriptor validate] raise: MultipleMappingsForInstanceVariable


--
Milan Mimica
http://sparklet.sf.net
Reply | Threaded
Open this post in threaded view
|

Re: ValidationError class

Guillermo Polito
:3 great.  Next week I'll work a whole day on dbx related stuff, and add it.

Thank you very much!!

On Wed, May 30, 2012 at 9:07 PM, Milan Mimica <[hidden email]> wrote:
On 30 May 2012 20:02, Guillermo Polito <[hidden email]> wrote:
On Wed, May 30, 2012 at 8:01 PM, Milan Mimica <[hidden email]> wrote:

I have a better idea. Why don't I provide a test for it?

Would be great :).

I just can't figure how to make a patch so here it is. Just add it to GlorpDescriptorValidationTest class.

testValidateMultipleMappingsError
| descriptor table mapping1 mapping2 system field1 field2 |
system := DynamicDescriptorSystem new.
descriptor := system addEmptyDescriptorFor: GlorpCustomer.
table := DatabaseTable named: 'Table1'.
field1 := table createFieldNamed: 'one' type: OraclePlatform new integer.
field2 := table createFieldNamed: 'two' type: OraclePlatform new integer.
descriptor addTable: table.
mapping1 := descriptor newMapping: DirectMapping.
mapping1 from: #id to: field1.
mapping2 := descriptor newMapping: DirectMapping.
mapping2 from: #id to: field2.
self should: [descriptor validate] raise: MultipleMappingsForInstanceVariable


--
Milan Mimica
http://sparklet.sf.net