Is there a way to use takeFromCtx for the ExpectedValue in DBQueryStep?

Mar 22, 2009 at 9:33 PM
Edited Mar 22, 2009 at 9:36 PM
I have tried every way I can think of to variablize the ExpectedValue in the validation of a DBQueryStep, but no luck.  Is there a way to accomplish this?
The following code works correctly.  However, I would like to use a variable as with SQLQueryParam to bind the value to <LocationID>.  I have not found a way to do it.

<TestStep assemblyPath="" typeName="Microsoft.Services.BizTalkApplicationFramework.BizUnit.DBQueryStep">
   <DelayBeforeCheck>5</DelayBeforeCheck>
   <ConnectionString takeFromCtx="connectionstring"></ConnectionString>
  
   <SQLQuery>
    <RawSQLQuery>select * from dbo.LocationProfiles where LocationID = '{0}'</RawSQLQuery>
    <SQLQueryParams>
     <SQLQueryParam takeFromCtx="locationid"></SQLQueryParam>
    </SQLQueryParams>
   </SQLQuery>

      <Rows>
        <Columns>
            <LocationID>3996662407D1376</LocationID>
        </Columns>
   </Rows>
</TestStep>


 Thank you.
Doug Garber
Mar 22, 2009 at 10:15 PM

Hi,

I'll take a look at the code-base again and get back  but i dont think this is possible. Parameters to the steps are passed through the context for substitution of context keys and wildcards but i dont think that result columns of the queries are processed in this way.

Rgds
benjy

Mar 22, 2009 at 10:52 PM

Hi Benjy,

Thank you for the quick response.  It is unfortunate, if your analysis proves correct.  Since it would often be the case that the result value would be the same as the lookup value, it could allow more flexibility in reusing the same xml for multiple tests.

Thanks again,

Doug

From: santoshbenjamin [mailto:notifications@codeplex.com]
Sent: Sunday, March 22, 2009 6:15 PM
To: Garber, Doug
Subject: Re: Is there a way to use takeFromCtx for the ExpectedValue in DBQueryStep? [bizunit:50922]

From: santoshbenjamin

Hi,

I'll take a look at the code-base again and get back but i dont think this is possible. Parameters to the steps are passed through the context for substitution of context keys and wildcards but i dont think that result columns of the queries are processed in this way.

Rgds
benjy

Read the full discussion online.

To add a post to this discussion, reply to this email (bizunit@discussions.codeplex.com)

To start a new discussion for this project, email bizunit@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe on codePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at codeplex.com

Mar 23, 2009 at 7:55 AM
Hi Doug,
I had a look at the code. As we discussed above, the code which reads the column value is in DBQueryStep.cs Line 170 as follows

string colValue = bamValidationCol.InnerText;

as opposed to parameters which are read as (example)

this.connectionString = context.ReadConfigAsString( testConfig, "ConnectionString" );

So, if you have the source code, I would suggest you use a similar approach and just pass the "bamValidationCol.InnerText" and the column name through a helper function which reads the context to substitute the value.

Maybe Kevin would be able to make this change in the official code base.

Cheers
benjy

Mar 23, 2009 at 7:49 PM

Hi Benjy,

I just tried downloading the source and got an empty zip.  Can you provide direction to getting the code?

Thanks,

Doug

From: santoshbenjamin [mailto:notifications@codeplex.com]
Sent: Monday, March 23, 2009 3:55 AM
To: Garber, Doug
Subject: Re: Is there a way to use takeFromCtx for the ExpectedValue in DBQueryStep? [bizunit:50922]

From: santoshbenjamin

Hi Doug,
I had a look at the code. As we discussed above, the code which reads the column value is in DBQueryStep.cs Line 170 as follows

string colValue = bamValidationCol.InnerText;

as opposed to parameters which are read as (example)

this.connectionString = context.ReadConfigAsString( testConfig, "ConnectionString" );

So, if you have the source code, I would suggest you use a similar approach and just pass the "bamValidationCol.InnerText" and the column name through a helper function which reads the context to substitute the value.

Maybe Kevin would be able to make this change in the official code base.

Cheers
benjy

Read the full discussion online.

To add a post to this discussion, reply to this email (bizunit@discussions.codeplex.com)

To start a new discussion for this project, email bizunit@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe on codePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at codeplex.com

Mar 24, 2009 at 8:08 AM
Hi Doug,
The Release MSI is actually a source code download. It just puts the source and bins into the install location (Program Files). The latest release is at :
http://bizunit.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=20013

When opening the solution, VS will prompt for the TFS connection and you can elect to remove the source control bindings permanently.

HTH,
Benjy

Coordinator
May 25, 2009 at 8:38 PM

Hi,

 

Look slike a reasonable change, I'll update this and get it in the next release.

 

thanks,

 

Kevin