Connection strings for structure tests and others without a query?

Jul 29, 2014 at 8:32 PM
Dear Seddryck,

is it possible to set connection strings on test case level for structure tests and others without a connectionstring-property?

I am trying to figure out, how to set connection strings via references as well (genbi) and it does not seem to be possible to use references on such kind of tests. How do you usually fulfill your requirements here?


Best regards,
Tilo
Coordinator
Jul 29, 2014 at 10:49 PM
I'm a bit lost with your question.

Do you need a sample on how to write a genbiL script where tests make usage of a connectionString defined in the references?
Jul 30, 2014 at 7:54 AM
Yes, sorry for my weirdly asked question. I was late :)

I try again:
On tests which use the <structure>-tag, I cannot set specific connection strings, can I? When I want to set references on Test Suite-Level, I would need to be able to set the connection strings with the reference name, right? Or is there another way on how to let the test know which connection is shall use other than the default connection string?
Coordinator
Jul 30, 2014 at 9:07 AM
Inside a test about structure,you should be able to use a connectionString defined as a reference (in the setting element). To achieve this in the connectionString attribute of the element structure, you must set the name of the connectionString prefixed by an "@" (connectionString="@MyReference"). If not working, it's a bug (AFAIR, my Team or I have never used a reference in a structure test but always a default, so definitively possible that it's an open bug).

I will check this during the next days.
Jul 30, 2014 at 12:13 PM
I tried to evaluate and perhaps the result helps to check this.

Inside a test about structure i'm currently not able to set a connectionString. The NBi-TestSuite does not define a connectionString-property for the structure element, as far as I understand.
<xs:element name="structure">
              <xs:complexType>
                <xs:choice>
                  <xs:element name="perspective" type="perspective-type"/>
                  <xs:element name="measure-group" type="measure-group-type"/>
                  <xs:element name="measure" type="measure-type"/>
                  <xs:element name="dimension" type="dimension-type"/>
                  <xs:element name="hierarchy" type="hierarchy-type"/>
                  <xs:element name="level" type="level-type"/>
                  <xs:element name="property" type="property-type"/>
                  <xs:element name="table" type="table-type"/>
                  <xs:element name="column" type="column-type"/>
                  <xs:element name="perspectives" type="perspectives-type"/>
                  <xs:element name="measure-groups" type="measure-groups-type"/>
                  <xs:element name="measures" type="measures-type"/>
                  <xs:element name="dimensions" type="dimensions-type"/>
                  <xs:element name="hierarchies" type="hierarchies-type"/>
                  <xs:element name="levels" type="levels-type"/>
                  <xs:element name="properties" type="properties-type"/>
                </xs:choice>
              </xs:complexType>
            </xs:element>
NUnit does not accept the test with the connectionString-property set due to the mismatch with the schema.
    <system-under-test>
      <structure  connectionString="@myConnection">
        <dimension caption="myDim" perspective="myCube" />
      </structure>
NBi.NUnit.Runtime.TestSuite.ExecuteTestCases:
System.ArgumentException : The test suite is not valid. Check with the XSD
Coordinator
Jul 30, 2014 at 12:56 PM
Sorry, my mistake. The connection string attribute must be put on the dimension element not on the structure element.
Jul 30, 2014 at 1:06 PM
This works! Thank you!
    <system-under-test>
      <structure>
        <dimension caption="myDim" perspective="myCube" connectionString="@myConnection"/>
      </structure>
    </system-under-test>
Marked as answer by Seddryck on 7/30/2014 at 3:04 PM