Oracle Waveset 8.1.1 Deployment Guide

Example 3: Finishing the Test Configuration

In this next example, you finish the test configuration.

Prepare the Test

Use the following steps to prepare the compatibility tests.

ProcedureTo Prepare the Test

  1. Set up the following files:

    sample/compat/example.3/example.properties

    sample/compat/example.3/SimulatedCompatibilityConfig.xml


    Note –

    The default path to the simulated resource in SimulatedCompatibilityConfig is /tmp/mySimulatedResource.xml.

    You can edit this path to specify a different location by changing two lines in the file.


  2. Before executing the example, copy ant-junit.jar from Apache ant 1.6.5 to your $WSHOME/WEB-INF/lib directory.

  3. You must initialize the repository to run the encrypt command.

    For example, use the lh import sample/init.xml command to initialize the repository, where the original file looks like the following:


    <Attribute name="login_infos">
             <List>
               <Object>
                 <Attribute name="sim_user" value="ctUser" />
                 <Attribute name="sim_password" value="ctPass" />
                 <Attribute name="shouldfail" value="no" />
               </Object>
               <Object>
                 <Attribute name="sim_user" value="ctUser" />
                 <Attribute name="sim_password" value="wrongPass" />
                 <Attribute name="shouldfail" value="yes" />
               </Object>
               <Object>
                 <Attribute name="sim_user" value="ctUser" />
                 <Attribute name="sim_password">
                   <!-- result of ’encrypt ctPass’ from lh console -->
                   <EncryptedData>11D1DEF534EA1BE0:-32DFBF32:1165DC91D73:
    -7FFA|mDBIkSQB3xg=</EncryptedData>
                 </Attribute>
                 <Attribute name="shouldfail" value="no" />
               </Object>
               <Object>
                 <Attribute name="sim_user" value="ctUser" />
                 <Attribute name="sim_password">
                   <!-- result of ’encrypt wrongPass’ from lh console -->
                   <EncryptedData>11D1DEF534EA1BE0:-32DFBF32:1165DC91D73:
    -7FFA|m0n9bAaMx+sKpqs5PmH3eQ==
    </EncryptedData>
                 </Attribute>
                 <Attribute name="shouldfail" value="yes" />
               </Object>
             </List>
           </Attribute>
  4. In each case, use an encrypt command from the lh console to get an encrypted password that can be decrypted in your environment.

    Run lh console and at the console prompt, type the text in single quotes for each of the preceding EncryptedData entries (for example, encrypt ctPass) and replace the text between <EncryptedData> and </EncryptedData> with the result.

    See the following example:


    <!-- result of ’encrypt ctPass’ from lh console -->
    <EncryptedData>11D1DEF534EA1BE0:-65F64461:1163AB5A7B2:-7FFA|iMm4Tcqck+M=</EncryptedData>
    
    <!-- result of ’encrypt wrongPass’ from lh console -->
    <EncryptedData>11D1DEF534EA1BE0:-65F64461:1163AB5A7B2:-7FFA|d1/PheqRok+J3uaggtj9Gw==
    </EncryptedData>

    Alternatively, you can have the DataProvider skip the two login info entries by commenting out the whole block as follows:


    <!-- commented out
           <Attribute name="login_infos">
             <List>
               <Object>
                 <Attribute name="sim_user" value="ctUser" />
                 <Attribute name="sim_password" value="ctPass" />
                 <Attribute name="shouldfail" value="no" />
               </Object>
               <Object>
                 <Attribute name="sim_user" value="ctUser" />
                 <Attribute name="sim_password" value="wrongPass" />
                 <Attribute name="shouldfail" value="yes" />
               </Object>
               <Object>
                 <Attribute name="sim_user" value="ctUser" />
                 <Attribute name="sim_password">
                   <EncryptedData>11D1DEF534EA1BE0:-32DFBF32:1165DC91D73:-7FFA|mDBIkSQB3xg=
    </EncryptedData>
                 </Attribute>
                 <Attribute name="shouldfail" value="no" />
               </Object>
               <Object>
                 <Attribute name="sim_user" value="ctUser" />
                 <Attribute name="sim_password">
                   <EncryptedData>11D1DEF534EA1BE0:-32DFBF32:1165DC91D73:
    -7FFA|m0n9bAaMx+sKpqs5PmH3eQ==
    </EncryptedData>
                 </Attribute>
                 <Attribute name="shouldfail" value="yes" />
               </Object>
             </List>
           </Attribute>
    -->
  5. Next, copy the new data and paste it inside the <EncryptedData> tag to replace the old data. Be certain there are no extra spaces or line breaks inside the tag.

Execute the Tests

Use the following steps to execute the compatibility tests.

ProcedureTo Execute the Tests

  1. Open a command window.

  2. At the prompt, type

    cd $WSHOME

    bin/lh com.sun.idm.testing.adapter.CompatibilitySuite -propsFile sample/compat/example.3/example.properties

    Your output should look similar to the following example:


    TestSuite: com.sun.idm.testing.adapter.CompatibilitySuite
    Starting internal database server ...
    DB Server @ jdbc:hsqldb:hsql://127.0.0.1:57022/idm
    Importing file ./sample/compat/example.3/SimulatedCompatibilityConfig.xml
    ’Create(com.sun.idm.testing.adapter.compatibility.Create)’ passed  (31 ms)
    ’Authenticate(com.sun.idm.testing.adapter.compatibility.AuthenticateUser)’ passed  (12 ms)
    ’DeleteExisting(com.sun.idm.testing.adapter.compatibility.DeleteExisting)’ passed  (1 ms)
    ’DeleteMissing(com.sun.idm.testing.adapter.compatibility.DeleteMissing)’ passed  (1 ms)
    ’UpdateExisting(com.sun.idm.testing.adapter.compatibility.UpdateExisting)’ passed  (33 ms)
    ’RenameExisting(com.sun.idm.testing.adapter.compatibility.RenameExisting)’ passed  (5 ms)
    ’EnableExisting(com.sun.idm.testing.adapter.compatibility.EnableExisting)’ passed  (10 ms)
    ’DisableExisting(com.sun.idm.testing.adapter.compatibility.DisableExisting)’ passed  (5 ms)
    ’Iterate(com.sun.idm.testing.adapter.compatibility.Iterate)’ passed  (352 ms)
    
    Tests run: 9, failures: 0, errors: 0, skipped: 0, Time elapsed: 10262 ms

What Happened

The line specifying the included tests was removed from the example.properties file, which should run the entire suite.

Additional data is required for the remaining tests, so the SimulatedCompatibilityConfig.xml file was modified to include update, rename, and iterate attributes. These attributes modify users, rename users, and create a set of users over which to iterate. In addition, the file added an login_info attribute that specifies a list of items used to authenticate a user if authentication is supported by the resource adapter.

Finally, the shouldfail attribute, provided in the file under the login info entries, allows negative tests. The tests in the suite should now complete with no errors or skipped tests.