Account Options

  1. Sign in
The old Google Groups will be going away soon.
Switch to the new Google Groups.
Google Groups Home
« Groups Home
Potential Bug: getIsSuccess() and addResult()
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  8 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Rawlins  
View profile  
 More options Feb 6, 6:04 am
From: Rawlins <rob...@supporttime.com>
Date: Mon, 6 Feb 2012 03:04:14 -0800 (PST)
Local: Mon, Feb 6 2012 6:04 am
Subject: Potential Bug: getIsSuccess() and addResult()

Hello Guys,

I have a process in this application that compiles a result object from
multiple other results using addResult().

Pseudo code looks something like this:

MasterResult = ValidateThis.newResult();

for object in array {
    thisResult = ValidateThis.Validate(object);

    MasterResult.addResult(thisResult);

}

This allows me to build a single result object for multiple objects at once.

However, even if the result objects that are added have failures -
getIsSuccess() on the Master result always returns 'true'.

Calling getFailures() on the master object returns all the failures I would
expect.

Is this a bug?

Thanks.

Robert


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
James Buckingham  
View profile  
 More options Feb 6, 8:52 am
From: James Buckingham <clarke...@gmail.com>
Date: Mon, 6 Feb 2012 05:52:05 -0800 (PST)
Local: Mon, Feb 6 2012 8:52 am
Subject: Re: Potential Bug: getIsSuccess() and addResult()

Been a few months since I touched VT now but isn't there a way of appending
the result onto an existing one?

So in your case it would be something like:-

MasterResult = ValidateThis.newResult();

for object in array {
    ValidateThis.Validate(objectType=object,result=MasterResult);

}

I might have the attribute names wrong there.

Cheers,
James


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Robert Rawlins  
View profile  
 More options Feb 6, 9:28 am
From: Robert Rawlins <rob...@weboffins.com>
Date: Mon, 6 Feb 2012 14:28:13 +0000
Local: Mon, Feb 6 2012 9:28 am
Subject: Re: [ValidateThis] Re: Potential Bug: getIsSuccess() and addResult()

Oh yeah - that's a good point James - let me give that a go:

*clicking*

Ah yes - that works quite perfectly!

Well spotted mate.

I still think the issue I found is probably a bug though.

Rob

On 6 Feb 2012, at 13:52, James Buckingham wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
James Buckingham  
View profile  
 More options Feb 6, 9:38 am
From: James Buckingham <clarke...@gmail.com>
Date: Mon, 6 Feb 2012 06:38:51 -0800 (PST)
Local: Mon, Feb 6 2012 9:38 am
Subject: Re: [ValidateThis] Re: Potential Bug: getIsSuccess() and addResult()

Yeah didn't quite answer your point but thought I'd offer the alternative.

Glad it worked :-).

Cheers,
James


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
John Whish  
View profile  
 More options Feb 6, 9:52 am
From: John Whish <john.wh...@googlemail.com>
Date: Mon, 6 Feb 2012 14:52:40 +0000
Local: Mon, Feb 6 2012 9:52 am
Subject: Re: [ValidateThis] Re: Potential Bug: getIsSuccess() and addResult()
Yeah James has it :)

Foo = ValidateThis.Validate(objectType=object);
Foo = ValidateThis.Validate(objectType=anotherobject,result=Foo);

Using addResult, does hasErrors() return false?

On 6 February 2012 14:38, James Buckingham <clarke...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Bob Silverberg  
View profile  
 More options Feb 6, 9:55 am
From: Bob Silverberg <bob.silverb...@gmail.com>
Date: Mon, 6 Feb 2012 09:55:08 -0500
Local: Mon, Feb 6 2012 9:55 am
Subject: Re: [ValidateThis] Re: Potential Bug: getIsSuccess() and addResult()
That is a good point, James.  It is probably how I would address it.

Regarding your question, Rob, yes that seems like an oversight. It
would make sense that addResult would consider the success status of
each Result object.

Do you want to add that and send me a pull request?

Thanks,
Bob

--
Bob Silverberg
www.silverwareconsulting.com

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Robert Rawlins  
View profile  
 More options Feb 6, 10:11 am
From: Robert Rawlins <rob...@weboffins.com>
Date: Mon, 6 Feb 2012 15:11:40 +0000
Local: Mon, Feb 6 2012 10:11 am
Subject: Re: [ValidateThis] Re: Potential Bug: getIsSuccess() and addResult()
Hi John / Bob

I will get something worked up over the next couple of days if I can and send a pull request across - sure it's only a minor issue.

Robert

On 6 Feb 2012, at 14:52, John Whish wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Bob Silverberg  
View profile  
 More options Mar 23, 5:14 pm
From: Bob Silverberg <bob.silverb...@gmail.com>
Date: Fri, 23 Mar 2012 17:14:25 -0400
Local: Fri, Mar 23 2012 5:14 pm
Subject: Re: [ValidateThis] Re: Potential Bug: getIsSuccess() and addResult()
I finally got around to fixing this. It's on GitHub now and will be
included in the next release.

Bob

--
Bob Silverberg
www.silverwareconsulting.com

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »