<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="./spec.xsl" ?>

<spec title="IDM tools test specification" version="1.5" estimated-time= "8 hours" author = "Andrey Yamkovoy, Jaroslav Pospisil" author-email="jaroslav.pospisil@netbeans.org"  last-updated = "2 June 2008">
<intro>This test specification provides the usecases of work with IDM tools functionality.</intro>

<caseblock name="Verify Identity runtime (Access Manager).">
	<purpose>Verify Identity runtime (AM) and Identity tooling successfull installation and configuration.</purpose>
	<setup></setup>
        
        <usecase name="Installation of Java EE 5 SDK.">
            <action>If you have already installed and configured the Java EE 5 SDK with Access Manager in the past, please check your userdir and if it exists, delete the file
        
[Your_Userdir]/AccessManager/AMConfig_opt_SUNWappserver_domains)domain1_applications_j2ee-modules_amserver_

before you begin a fresh installation.</action>

   <action>Ensure that you have installed the full NetBeans IDE. You can use either standalone Netbeans installation or Tools bundle of Java EE 5 SDK, mentioned one line lower. </action>
   <action>Obtain latest version of Java Application Platform SDK 5 from http://java.sun.com/javaee/downloads/index.jsp. Easiest way is to download JavaEE + Tools version,which already contains NetBeans 6.1 Beta2 with SDK Glassfish added.</action>
   <action>Otherwise download JavaEE version and run the Java SDK installer, specify an installation directory, and accept the rest default.</action>
   <action>Check that Add-Ons include the Sun Java System Access Manager 7.1.</action>
   <action>Continue to run the Installer, when it finishes, click on "Start Server" button and select Finish.</action>
   <action>Start the IDE.</action>
   <action>Go to the Services tab, select the Servers node. right-click the Servers node and choose Add Server from the pop-up menu.. The Add Server Instance dialog opens.</action>
   <action>Click Next. The Platform Location Folder page opens.</action>
   <action>In the Platform Location field, use the Browse button to navigate to and select the directory containing the Java Application Platform SDK you have just installed.</action>
   <action>Click Finish.</action>
   <action>The Sun Java System Access Manager appears as a node in the Services Tab under the Application Server you have just installed. It should be started, it's neccessary to start SDK Glassfish first, to use Sun Java System Access Manager  .</action>
   <result>Notice: When you log into AM admin console next time,there'll be no Configurator page,since configuration files are already there.</result>
        
        </usecase>
        
        <usecase name="Verify Identity tooling is installed correctly.">
	   <action>Switch to 'Services' TAB / Servers / Glassfish v2 (server must be running).</action>

           <result>There should be 'Sun Java System Access Managers' node.</result>
           <result>There should be 'Sun Java System Access Managers > Default Instance > Profiles > Anonymous' node.</result>
           <result>There should be 'Sun Java System Access Managers > Default Instance > Profiles > SAML-SenderVauches' node.</result>
           <result>There should be 'Sun Java System Access Managers > Default Instance > Profiles > SAML-HolderOfKey' node.</result>
           <result>There should be 'Sun Java System Access Managers > Default Instance > Profiles > X509Token' node.</result>
           <result>There should be 'Sun Java System Access Managers > Default Instance > Profiles > UserNameToken' node.</result>
           <result>There should be 'Sun Java System Access Managers > Default Instance > Profiles > UserNameToken-plain' node.</result>
           <result>There should be 'Sun Java System Access Managers > Default Instance > Profiles > LibertyX509Token' node.</result>
           <result>There should be 'Sun Java System Access Managers > Default Instance > Profiles > LibertyBearerToken' node.</result>
           <result>There should be 'Sun Java System Access Managers > Default Instance > Profiles > LibertySAMLToken' node.</result>
	</usecase>
        
        <usecase name="Verify Identity tooling is configured correctly.">
           <action>Select one of the security profiles under 'Sun Java System Access Managers > Default Instance > Profiles' node.</action>
           <action>Right click on the profile and choose Edit.</action>
           <result>Editor window opened without any error.</result>
	</usecase> 

        <usecase name="Verify 'Edit' dialog for Anonymous profile.">

           <action>Select 'Anonymous' profile under 'Sun Java System Access Managers > Default Instance > Profiles' node in 'Services' TAB.</action>
           <action>Right click on the profile and choose 'Edit'.</action>
           <result>Editor window opened without any error.</result>
           <result>'Sign response' checkbox is unchecked.</result>
           <result>'Use Default Key Store' checkbox is checked and enabled.</result>
           <result>Editboxes 'Keystore Location', 'Keystore Password', 'Key Alias', 'Key Alias Password' are empty and disabled.</result>

           <result>'Browse' button is disabled.</result>
	</usecase> 

        <usecase name="Verify 'Edit' dialog for SAML-SenderVouches profile.">
           <action>Select 'SAML-SenderVouches' profile under 'Sun Java System Access Managers > Default Instance > Profiles' node in 'Services' TAB.</action>
           <action>Right click on the profile and choose 'Edit'.</action>
           <result>Editor window opened without any error.</result>
           <result>'Sign response' checkbox is checked and enabled.</result>

           <result>'Use Default Key Store' checkbox is checked and enabled.</result>
           <result>Editboxes 'Keystore Location', 'Keystore Password', 'Key Alias', 'Key Alias Password' are empty and disabled.</result>
           <result>'Browse' button is disabled.</result>
	</usecase> 
        
        <usecase name="Verify 'Edit' dialog for SAML-HolderOfKey profile.">
           <action>Select 'SAML-HolderOfKey' profile under 'Sun Java System Access Managers > Default Instance > Profiles' node in 'Services' TAB.</action>
           <action>Right click on the profile and choose 'Edit'.</action>

           <result>Editor window opened without any error.</result>
           <result>'Sign response' checkbox is checked and enabled.</result>
           <result>'Use Default Key Store' checkbox is checked and enabled.</result>
           <result>Editboxes 'Keystore Location', 'Keystore Password', 'Key Alias', 'Key Alias Password' are empty and disabled.</result>
           <result>'Browse' button is disabled.</result>
	</usecase> 

        <usecase name="Verify 'Edit' dialog for X509Token profile.">

           <action>Select 'X509Token' profile under 'Sun Java System Access Managers > Default Instance > Profiles' node in 'Services' TAB.</action>
           <action>Right click on the profile and choose 'Edit'.</action>
           <result>Editor window opened without any error.</result>
           <result>'Sign response' checkbox is checked and enabled.</result>
           <result>'Use Default Key Store' checkbox is checked and enabled.</result>
           <result>Editboxes 'Keystore Location', 'Keystore Password', 'Key Alias', 'Key Alias Password' are empty and disabled.</result>

           <result>'Browse' button is disabled.</result>
	</usecase> 

        <usecase name="Verify 'Edit' dialog for UserNameToken profile.">
           <action>Select 'UserNameToken' profile under 'Sun Java System Access Managers > Default Instance > Profiles' node in 'Services' TAB.</action>
           <action>Right click on the profile and choose 'Edit'.</action>
           <result>Editor window opened without any error.</result>
           <result>'Sign response' checkbox is checked and enabled.</result>

           <result>'Use Default Key Store' checkbox is checked and enabled.</result>
           <result>Editboxes 'Keystore Location', 'Keystore Password', 'Key Alias', 'Key Alias Password' are empty and disabled.</result>
           <result>'Browse' button is disabled.</result>
           <result>Username/password table should contain 1 row for user 'testuser'.</result>
           <result>Buttons 'Add...', 'Edit...' and 'Remove' should work properly and provide corresponding functionality.</result>
	</usecase> 

        <usecase name="Verify 'Edit' dialog for LibertyX509Token profile.">

           <action>Select 'LibertyX509Token' profile under 'Sun Java System Access Managers > Default Instance > Profiles' node in 'Services' TAB.</action>
           <action>Right click on the profile and choose 'Edit'.</action>
           <result>Editor window opened without any error.</result>
           <result>'Sign response' checkbox is checked and disabled.</result>
           <result>'Use Default Key Store' checkbox is checked and enabled.</result>
           <result>Editboxes 'Keystore Location', 'Keystore Password', 'Key Alias', 'Key Alias Password' are empty and disabled.</result>

           <result>'Browse' button is disabled.</result>
	</usecase> 

        <usecase name="Verify 'Edit' dialog for LibertyBearerToken profile.">
           <action>Select 'LibertyBearerToken' profile under 'Sun Java System Access Managers > Default Instance > Profiles' node in 'Services' TAB.</action>
           <action>Right click on the profile and choose 'Edit'.</action>
           <result>Editor window opened without any error.</result>
           <result>'Sign response' checkbox is checked and disabled.</result>

           <result>'Use Default Key Store' checkbox is checked and enabled.</result>
           <result>Editboxes 'Keystore Location', 'Keystore Password', 'Key Alias', 'Key Alias Password' are empty and disabled.</result>
           <result>'Browse' button is disabled.</result>
	</usecase> 

        <usecase name="Verify 'Edit' dialog for LibertySAMLToken profile.">
           <action>Select 'LibertySAMLToken' profile under 'Sun Java System Access Managers > Default Instance > Profiles' node in 'Services' TAB.</action>
           <action>Right click on the profile and choose 'Edit'.</action>

           <result>Editor window opened without any error.</result>
           <result>'Sign response' checkbox is checked and disabled.</result>
           <result>'Use Default Key Store' checkbox is checked and enabled.</result>
           <result>Editboxes 'Keystore Location', 'Keystore Password', 'Key Alias', 'Key Alias Password' are empty and disabled.</result>
           <result>'Browse' button is disabled.</result>
	</usecase> 


</caseblock>

<caseblock name="Verify WS security based on Web Application project type.">
	<purpose>Verify WS security based on WebApplication project type. Note that verification should be done for projects with Java EE version 'Java EE 5' only, 'J2EE 1.4' (JAX-RPC web services) Identity support has been cancelled.</purpose>
	<setup>Start IDE, start AS, create WebApplication1 and WS in it, create WebApplication2 and WSC in it.</setup>
        
        <usecase name="Verify SAML-SenderVouches profile.">
	   <action>Select web service node in the projects tree under 'WebApplication1 > Web Services'.</action>
           <action>Right click on the web service and choose 'Edit Web Service Attributes'.</action>

           <action>In opened window select 'AM Security' TAB.</action>
           <action>Check in the checkbox 'Enable Message Level Security' and select security mechanism 'SAML-SenderVouches'.</action>
           <action>Push OK button to close the dialog with applying the changes.</action>
           <action>Deploy WebApplication1.</action>
           <action>Create Servlet in WebApplication2 and write the code in it for WS invocation.</action>
           <action>Right click on the web service client and choose 'Edit Web Service Attributes'.</action>

           <action>In opened window select 'AM Security' TAB.</action>
           <action>Check in the checkbox 'Enable Message Level Security' and select security mechanism 'SAML-SenderVouches'.</action>
           <action>Push OK button to close the dialog with applying the changes.</action>
           <action>Deploy WebApplication2.</action>
           <action>Run servlet from WebApplication2.</action>
           <result>Servlet (WS invocation code) should work without any errors.</result>

           <result>File 'amconfig.xml' should be created under 'WebApplication1 > Configuration Files > amserver' and contain WSP configuration with 'SAML-SenderVouches' profile.</result>
           <result>File 'amconfig.xml' should be created under 'WebApplication2 > Configuration Files > amserver' and contain WSC configuration with 'SAML-SenderVouches' profile.</result>
	</usecase>

        <usecase name="Verify SAML-HolderOfKey profile.">
	   <action>Select web service node in the projects tree under 'WebApplication1 > Web Services'.</action>
           <action>Right click on the web service and choose 'Edit Web Service Attributes'.</action>

           <action>In opened window select 'AM Security' TAB.</action>
           <action>Check in the checkbox 'Enable Message Level Security' and select security mechanism 'SAML-HolderOfKey'.</action>
           <action>Push OK button to close the dialog with applying the changes.</action>
           <action>Deploy WebApplication1.</action>
           <action>Create Servlet in WebApplication2 and write the code in it for WS invocation.</action>
           <action>Right click on the web service client and choose 'Edit Web Service Attributes'.</action>

           <action>In opened window select 'AM Security' TAB.</action>
           <action>Check in the checkbox 'Enable Message Level Security' and select security mechanism 'SAML-HolderOfKey'.</action>
           <action>Push OK button to close the dialog with applying the changes.</action>
           <action>Deploy WebApplication2.</action>
           <action>Run servlet from WebApplication2.</action>
           <result>Servlet (WS invocation code) should work without any errors.</result>

           <result>File 'amconfig.xml' should be created under 'WebApplication1 > Configuration Files > amserver' and contain WSP configuration with 'SAML-HolderOfKey' profile.</result>
           <result>File 'amconfig.xml' should be created under 'WebApplication2 > Configuration Files > amserver' and contain WSC configuration with 'SAML-HolderOfKey' profile.</result>
	</usecase>

        <usecase name="Verify X509Token profile.">
	   <action>Select web service node in the projects tree under 'WebApplication1 > Web Services'.</action>
           <action>Right click on the web service and choose 'Edit Web Service Attributes'.</action>

           <action>In opened window select 'AM Security' TAB.</action>
           <action>Check in the checkbox 'Enable Message Level Security' and select security mechanism 'X509Token'.</action>
           <action>Push OK button to close the dialog with applying the changes.</action>
           <action>Deploy WebApplication1.</action>
           <action>Create Servlet in WebApplication2 and write the code in it for WS invocation.</action>
           <action>Right click on the web service client and choose 'Edit Web Service Attributes'.</action>

           <action>In opened window select 'AM Security' TAB.</action>
           <action>Check in the checkbox 'Enable Message Level Security' and select security mechanism 'X509Token'.</action>
           <action>Push OK button to close the dialog with applying the changes.</action>
           <action>Deploy WebApplication2.</action>
           <action>Run servlet from WebApplication2.</action>
           <result>Servlet (WS invocation code) should work without any errors.</result>

           <result>File 'amconfig.xml' should be created under 'WebApplication1 > Configuration Files > amserver' and contain WSP configuration with 'X509Token' profile.</result>
           <result>File 'amconfig.xml' should be created under 'WebApplication2 > Configuration Files > amserver' and contain WSC configuration with 'X509Token' profile.</result>
	</usecase>

        <usecase name="Verify UserNameToken profile.">
	   <action>Select web service node in the projects tree under 'WebApplication1 > Web Services'.</action>
           <action>Right click on the web service and choose 'Edit Web Service Attributes'.</action>

           <action>In opened window select 'AM Security' TAB.</action>
           <action>Check in the checkbox 'Enable Message Level Security' and select security mechanism 'UserNameToken'.</action>
           <action>Push OK button to close the dialog with applying the changes.</action>
           <action>Deploy WebApplication1.</action>
           <action>Create Servlet in WebApplication2 and write the code in it for WS invocation.</action>
           <action>Right click on the web service client and choose 'Edit Web Service Attributes'.</action>

           <action>In opened window select 'AM Security' TAB.</action>
           <action>Check in the checkbox 'Enable Message Level Security' and select security mechanism 'UserNameToken'.</action>
           <action>Fill the appeared username and password editboxes with valid values (the same values should be in the UserNameToken profile runtime configuration).</action>
           <action>Push OK button to close the dialog with applying the changes.</action>
           <action>Deploy WebApplication2.</action>
           <action>Run servlet from WebApplication2.</action>

           <result>Servlet (WS invocation code) should work without any errors.</result>
           <result>File 'amconfig.xml' should be created under 'WebApplication1 > Configuration Files > amserver' and contain WSP configuration with 'UserNameToken' profile.</result>
           <result>File 'amconfig.xml' should be created under 'WebApplication2 > Configuration Files > amserver' and contain WSC configuration with 'UserNameToken' profile and entered user/password data.</result>
	</usecase>

        <usecase name="Verify LibertyX509Token profile.">
	   <action>Select web service node in the projects tree under 'WebApplication1 > Web Services'.</action>

           <action>Right click on the web service and choose 'Edit Web Service Attributes'.</action>
           <action>In opened window select 'AM Security' TAB.</action>
           <action>Check in the checkbox 'Enable Message Level Security' and select security mechanism 'LibertyX509Token'.</action>
           <action>Push OK button to close the dialog with applying the changes.</action>
           <action>Deploy WebApplication1.</action>
           <action>Create Servlet in WebApplication2 and write the code in it for WS invocation.</action>

           <action>Right click on the web service client and choose 'Edit Web Service Attributes'.</action>
           <action>In opened window select 'AM Security' TAB.</action>
           <action>Check in the checkbox 'Enable Message Level Security' and select security mechanism 'LibertyDiscoverySecurity'.</action>
           <action>Push OK button to close the dialog with applying the changes.</action>
           <action>Deploy WebApplication2.</action>
           <action>Run servlet from WebApplication2.</action>

           <action>Servlet page will be redirrected to access manager for authentication. Enter username/password (by default 'jsmith/jsmith') pair and Log In.</action>
           <result>Servlet (WS invocation code) should work without any errors.</result>
           <result>File 'amconfig.xml' should be created under 'WebApplication1 > Configuration Files > amserver' and contain WSP configuration with 'LibertyX509Token' profile.</result>
           <result>File 'amconfig.xml' should be created under 'WebApplication2 > Configuration Files > amserver' and contain WSC configuration with 'LibertyDicoverySecurity' profile.</result>
	</usecase>

        <usecase name="Verify LibertyBearerToken profile.">

	   <action>Select web service node in the projects tree under 'WebApplication1 > Web Services'.</action>
           <action>Right click on the web service and choose 'Edit Web Service Attributes'.</action>
           <action>In opened window select 'AM Security' TAB.</action>
           <action>Check in the checkbox 'Enable Message Level Security' and select security mechanism 'LibertyBearerToken'.</action>
           <action>Push OK button to close the dialog with applying the changes.</action>
           <action>Deploy WebApplication1.</action>

           <action>Create Servlet in WebApplication2 and write the code in it for WS invocation.</action>
           <action>Right click on the web service client and choose 'Edit Web Service Attributes'.</action>
           <action>In opened window select 'AM Security' TAB.</action>
           <action>Check in the checkbox 'Enable Message Level Security' and select security mechanism 'LibertyDiscoverySecurity'.</action>
           <action>Push OK button to close the dialog with applying the changes.</action>
           <action>Deploy WebApplication2.</action>

           <action>Run servlet from WebApplication2.</action>
           <action>Servlet page will be redirrected to access manager for authentication. Enter username/password (by default 'jsmith/jsmith') pair and Log In.</action>
           <result>Servlet (WS invocation code) should work without any errors.</result>
           <result>File 'amconfig.xml' should be created under 'WebApplication1 > Configuration Files > amserver' and contain WSP configuration with 'LibertyBearerToken' profile.</result>
           <result>File 'amconfig.xml' should be created under 'WebApplication2 > Configuration Files > amserver' and contain WSC configuration with 'LibertyDicoverySecurity' profile.</result>
	</usecase>

        
        <usecase name="Verify LibertySAMLToken profile.">
	   <action>Select web service node in the projects tree under 'WebApplication1 > Web Services'.</action>
           <action>Right click on the web service and choose 'Edit Web Service Attributes'.</action>
           <action>In opened window select 'AM Security' TAB.</action>
           <action>Check in the checkbox 'Enable Message Level Security' and select security mechanism 'LibertySAMLToken'.</action>
           <action>Push OK button to close the dialog with applying the changes.</action>

           <action>Deploy WebApplication1.</action>
           <action>Create Servlet in WebApplication2 and write the code in it for WS invocation.</action>
           <action>Right click on the web service client and choose 'Edit Web Service Attributes'.</action>
           <action>In opened window select 'AM Security' TAB.</action>
           <action>Check in the checkbox 'Enable Message Level Security' and select security mechanism 'LibertyDiscoverySecurity'.</action>
           <action>Push OK button to close the dialog with applying the changes.</action>

           <action>Deploy WebApplication2.</action>
           <action>Run servlet from WebApplication2.</action>
           <action>Servlet page will be redirrected to access manager for authentication. Enter username/password (by default 'jsmith/jsmith') pair and Log In.</action>
           <result>Servlet (WS invocation code) should work without any errors.</result>
           <result>File 'amconfig.xml' should be created under 'WebApplication1 > Configuration Files > amserver' and contain WSP configuration with 'LibertySAMLToken' profile.</result>
           <result>File 'amconfig.xml' should be created under 'WebApplication2 > Configuration Files > amserver' and contain WSC configuration with 'LibertyDicoverySecurity' profile.</result>

	</usecase>
</caseblock>

<caseblock name="Verify WS security based on EJB Module project type.">
	<purpose>Verify WS security based on EJB Module project type. Note that verification should be done for projects with Java EE version 'Java EE 5' only, 'J2EE 1.4' (JAX-RPC web services) Identity support has been cancelled.</purpose>
	<setup>Start IDE, start AS, create EJBModule1 and WS in it.</setup>
        
        <usecase name="Verify SAML-SenderVouches profile.">
	   <action>Select web service node in the projects tree under 'EJBModule1 > Web Services'.</action>
           <action>Right click on the web service and choose 'Edit Web Service Attributes'.</action>

           <action>In opened window select 'AM Security' TAB.</action>
           <action>Check in the checkbox 'Enable Message Level Security' and select security mechanism 'SAML-SenderVouches'.</action>
           <action>Push OK button to close the dialog with applying the changes.</action>
           <action>Deploy EJBModule1.</action>
           <action>Create EJBModule2 and WSC in it.</action>
           <action>Create SessionBean in the EJBModule2 and add a business method to it with WS invocation code.</action>

           <action>Right click on the web service client and choose 'Edit Web Service Attributes'.</action>
           <action>In opened window select 'AM Security' TAB.</action>
           <action>Check in the checkbox 'Enable Message Level Security' and select security mechanism 'SAML-SenderVouches'.</action>
           <action>Push OK button to close the dialog with applying the changes.</action>
           <action>Deploy EJBModule2.</action>
           <action>Create WebApplication3 and Servlet in it.</action>

           <action>Write the code in servlet to invoke the business method of SessionBean.</action>
           <action>Run servlet from WebApplication3.</action>
           <result>Servlet (SessionBean invocation code > WS invocation code) should work without any errors.</result>
           <result>File 'amconfig.xml' should be created under 'EJBModule1 > Configuration Files > amserver' and contain WSP configuration with 'SAML-SenderVouches' profile.</result>
           <result>File 'amconfig.xml' should be created under 'EJBModule2 > Configuration Files > amserver' and contain WSC configuration with 'SAML-SenderVouches' profile.</result>
	</usecase>

        <usecase name="Verify SAML-HolderOfKey profile.">
	   <action>Select web service node in the projects tree under 'EJBModule1 > Web Services'.</action>
           <action>Right click on the web service and choose 'Edit Web Service Attributes'.</action>
           <action>In opened window select 'AM Security' TAB.</action>
           <action>Check in the checkbox 'Enable Message Level Security' and select security mechanism 'SAML-HolderOfKey'.</action>
           <action>Push OK button to close the dialog with applying the changes.</action>

           <action>Deploy EJBModule1.</action>
           <action>Create EJBModule2 and WS in it.</action>
           <action>Create SessionBean in the EJBModule2 and add a business method to it with WS invocation code.</action>
           <action>Right click on the web service client and choose 'Edit Web Service Attributes'.</action>
           <action>In opened window select 'AM Security' TAB.</action>
           <action>Check in the checkbox 'Enable Message Level Security' and select security mechanism 'SAML-HolderOfKey'.</action>

           <action>Push OK button to close the dialog with applying the changes.</action>
           <action>Deploy EJBModule2.</action>
           <action>Create WebApplication3 and Servlet in it.</action>
           <action>Write the code in servlet to invoke the business method of SessionBean.</action>
           <action>Run servlet from WebApplication3.</action>
           <result>Servlet (SessionBean invocation code > WS invocation code) should work without any errors.</result>

           <result>File 'amconfig.xml' should be created under 'EJBModule1 > Configuration Files > amserver' and contain WSP configuration with 'SAML-HolderOfKey' profile.</result>
           <result>File 'amconfig.xml' should be created under 'EJBModule2 > Configuration Files > amserver' and contain WSC configuration with 'SAML-HolderOfKey' profile.</result>
	</usecase>

        <usecase name="Verify X509Token profile.">
	   <action>Select web service node in the projects tree under 'EJBModule1 > Web Services'.</action>
           <action>Right click on the web service and choose 'Edit Web Service Attributes'.</action>

           <action>In opened window select 'AM Security' TAB.</action>
           <action>Check in the checkbox 'Enable Message Level Security' and select security mechanism 'X509Token'.</action>
           <action>Push OK button to close the dialog with applying the changes.</action>
           <action>Deploy EJBModule1.</action>
           <action>Create EJBModule2 and WS in it.</action>
           <action>Create SessionBean in the EJBModule2 and add a business method to it with WS invocation code.</action>

           <action>Right click on the web service client and choose 'Edit Web Service Attributes'.</action>
           <action>In opened window select 'AM Security' TAB.</action>
           <action>Check in the checkbox 'Enable Message Level Security' and select security mechanism 'X509Token'.</action>
           <action>Push OK button to close the dialog with applying the changes.</action>
           <action>Deploy EJBModule2.</action>
           <action>Create WebApplication3 and Servlet in it.</action>

           <action>Write the code in servlet to invoke the business method of SessionBean.</action>
           <action>Run servlet from WebApplication3.</action>
           <result>Servlet (SessionBean invocation code > WS invocation code) should work without any errors.</result>
           <result>File 'amconfig.xml' should be created under 'EJBModule1 > Configuration Files > amserver' and contain WSP configuration with 'X509Token' profile.</result>
           <result>File 'amconfig.xml' should be created under 'EJBModule2 > Configuration Files > amserver' and contain WSC configuration with 'X509Token' profile.</result>
	</usecase>

        <usecase name="Verify UserNameToken profile.">
	   <action>Select web service node in the projects tree under 'EJBModule1 > Web Services'.</action>
           <action>Right click on the web service and choose 'Edit Web Service Attributes'.</action>
           <action>In opened window select 'AM Security' TAB.</action>
           <action>Check in the checkbox 'Enable Message Level Security' and select security mechanism 'UserNameToken'.</action>
           <action>Push OK button to close the dialog with applying the changes.</action>

           <action>Deploy EJBModule1.</action>
           <action>Create EJBModule2 and WS in it.</action>
           <action>Create SessionBean in the EJBModule2 and add a business method to it with WS invocation code.</action>
           <action>Right click on the web service client and choose 'Edit Web Service Attributes'.</action>
           <action>In opened window select 'AM Security' TAB.</action>
           <action>Check in the checkbox 'Enable Message Level Security' and select security mechanism 'UserNameToken'.</action>

           <action>Fill the appeared username and password editboxes with valid values (the same values should be in the UserNameToken profile runtime configuration).</action>
           <action>Push OK button to close the dialog with applying the changes.</action>
           <action>Deploy EJBModule2.</action>
           <action>Create WebApplication3 and Servlet in it.</action>
           <action>Write the code in servlet to invoke the business method of SessionBean.</action>
           <action>Run servlet from WebApplication3.</action>

           <result>Servlet (SessionBean invocation code > WS invocation code) should work without any errors.</result>
           <result>File 'amconfig.xml' should be created under 'EJBModule1 > Configuration Files > amserver' and contain WSP configuration with 'UserNameToken' profile.</result>
           <result>File 'amconfig.xml' should be created under 'EJBModule2 > Configuration Files > amserver' and contain WSC configuration with 'UserNameToken' profile and entered user/password data.</result>
	</usecase>

        <usecase name="Verify LibertyX509Token profile.">
	   <action>Select web service node in the projects tree under 'EJBModule1 > Web Services'.</action>

           <action>Right click on the web service and choose 'Edit Web Service Attributes'.</action>
           <action>In opened window select 'AM Security' TAB.</action>
           <action>Check in the checkbox 'Enable Message Level Security' and select security mechanism 'LibertyX509Token'.</action>
           <action>Push OK button to close the dialog with applying the changes.</action>
           <action>Deploy EJBModule1.</action>
           <action>Create WebApplication2 and WS in it.</action>

           <action>Create Servlet in WebApplication2 and write the code in it for WS invocation.</action>
           <action>Right click on the web service client and choose 'Edit Web Service Attributes'.</action>
           <action>In opened window select 'AM Security' TAB.</action>
           <action>Check in the checkbox 'Enable Message Level Security' and select security mechanism 'LibertyDiscoverySecurity'.</action>
           <action>Push OK button to close the dialog with applying the changes.</action>
           <action>Deploy WebApplication2.</action>

           <action>Run servlet from WebApplication2.</action>
           <action>Servlet page will be redirrected to access manager for authentication. Enter username/password (by default 'jsmith/jsmith') pair and Log In.</action>
           <result>Servlet (WS invocation code) should work without any errors.</result>
           <result>File 'amconfig.xml' should be created under 'EJBModule1 > Configuration Files > amserver' and contain WSP configuration with 'LibertyX509Token' profile.</result>
           <result>File 'amconfig.xml' should be created under 'WebApplication2 > Configuration Files > amserver' and contain WSC configuration with 'LibertyDicoverySecurity' profile.</result>
	</usecase>

        <usecase name="Verify LibertyBearerToken profile.">
	   <action>Select web service node in the projects tree under 'EJBModule1 > Web Services'.</action>
           <action>Right click on the web service and choose 'Edit Web Service Attributes'.</action>
           <action>In opened window select 'AM Security' TAB.</action>
           <action>Check in the checkbox 'Enable Message Level Security' and select security mechanism 'LibertyBearerToken'.</action>
           <action>Push OK button to close the dialog with applying the changes.</action>

           <action>Deploy EJBModule1.</action>
           <action>Create WebApplication2 and WS in it.</action>
           <action>Create Servlet in WebApplication2 and write the code in it for WS invocation.</action>
           <action>Right click on the web service client and choose 'Edit Web Service Attributes'.</action>
           <action>In opened window select 'AM Security' TAB.</action>
           <action>Check in the checkbox 'Enable Message Level Security' and select security mechanism 'LibertyDiscoverySecurity'.</action>

           <action>Push OK button to close the dialog with applying the changes.</action>
           <action>Deploy WebApplication2.</action>
           <action>Run servlet from WebApplication2.</action>
           <action>Servlet page will be redirrected to access manager for authentication. Enter username/password (by default 'jsmith/jsmith') pair and Log In.</action>
           <result>Servlet (WS invocation code) should work without any errors.</result>
           <result>File 'amconfig.xml' should be created under 'EJBModule1 > Configuration Files > amserver' and contain WSP configuration with 'LibertyBearerToken' profile.</result>

           <result>File 'amconfig.xml' should be created under 'WebApplication2 > Configuration Files > amserver' and contain WSC configuration with 'LibertyDicoverySecurity' profile.</result>
	</usecase>
        
        <usecase name="Verify LibertySAMLToken profile.">
	   <action>Select web service node in the projects tree under 'EJBModule1 > Web Services'.</action>
           <action>Right click on the web service and choose 'Edit Web Service Attributes'.</action>
           <action>In opened window select 'AM Security' TAB.</action>
           <action>Check in the checkbox 'Enable Message Level Security' and select security mechanism 'LibertySAMLToken'.</action>

           <action>Push OK button to close the dialog with applying the changes.</action>
           <action>Deploy EJBModule1.</action>
           <action>Create WebApplication2 and WS in it.</action>
           <action>Create Servlet in WebApplication2 and write the code in it for WS invocation.</action>
           <action>Right click on the web service client and choose 'Edit Web Service Attributes'.</action>
           <action>In opened window select 'AM Security' TAB.</action>

           <action>Check in the checkbox 'Enable Message Level Security' and select security mechanism 'LibertyDiscoverySecurity'.</action>
           <action>Push OK button to close the dialog with applying the changes.</action>
           <action>Deploy WebApplication2.</action>
           <action>Run servlet from WebApplication2.</action>
           <action>Servlet page will be redirrected to access manager for authentication. Enter username/password (by default 'jsmith/jsmith') pair and Log In.</action>
           <result>Servlet (WS invocation code) should work without any errors.</result>

           <result>File 'amconfig.xml' should be created under 'EJBModule1 > Configuration Files > amserver' and contain WSP configuration with 'LibertySAMLToken' profile.</result>
           <result>File 'amconfig.xml' should be created under 'WebApplication2 > Configuration Files > amserver' and contain WSC configuration with 'LibertyDicoverySecurity' profile.</result>
	</usecase>
</caseblock>

<caseblock name="Verify WS security profile options.">
	<purpose>Verify WS security profile options. It should be verified for all security profiles.</purpose>

        <usecase name="Verify enabled 'verify response' option.">

            <action>Open 'Edit Web Service Attributes' for WSC.</action>
            <action>Check in 'Verify Response' checkbox.</action>
            <result>In case of 'Sign Response' option in runtime for this security profile is enabled the WS invocation test should pass otherwise should fail.</result>
	</usecase>

        <usecase name="Verify disabled 'verify response' option.">
            <action>Open 'Edit Web Service Attributes' for WSC.</action>

            <action>Clear 'Verify Response' checkbox.</action>
            <result>Independent of 'Sign Response' option in runtime for this security profile is enabled or not the WS invocation test should pass.</result>
	</usecase>

        <usecase name="Verify 'custom keystore' option.">
            <action>Create custom keystore and import certificate from the 'amclientkeystore.jks'.</action>
            <action>Configure AM runtime security profile to use this custom keystore.</action>

            <action>Configure WSC to use this custom keystore.</action>
            <action>Run test to verify WS invocation code.</action>
            <result>Test should pass.</result>
	</usecase>
</caseblock>

<caseblock name="Verify WS security based on Web Application project type inside EAR.">
	<purpose>Verify WS security based on Web Application project type inside EAR. Note that verification should be done for projects with Java EE version 'Java EE 5' only, 'J2EE 1.4' (JAX-RPC web services) Identity support has been cancelled.</purpose>

	<setup>Start IDE, start AS. Create EnterpriseApplication1 with WebModule1 in it, create WS in WebModule1. Create EnterpriseApplication2 with WebModule2 in it, create WSC in WebModule2.</setup>

        <usecase name="Verify security profiles.">
	   <action>Verify all test cases from section 'Verify WS security based on Web Application project type'. The only differences is web project will be a module of entrprise application and need to deploy whole enterprise application instead of web project separately.</action>
           <result>All testcases should pass.</result>
	</usecase>
        
</caseblock>

<caseblock name="Verify WS security based on EJB Module project type inside EAR.">
	<purpose>Verify WS security based on EJB Module project type inside EAR.</purpose>
	<setup>Start IDE, start AS. Create EnterpriseApplication1 with EJBModule1 in it, create WS in EJBModule1. Create EnterpriseApplication2 with EJBModule2 in it, create WSC in EJBModule2.</setup>

        <usecase name="Verify security profiles.">
	   <action>Verify all test cases from section 'Verify WS security based on EJB Module project type'. The only differences is ejb module will be a module of entrprise application and need to deploy whole enterprise application instead of ejb module separately.</action>
           <result>All testcases should pass.</result>
	</usecase>

        
</caseblock>

<caseblock name="Verify WS security with remote AM instance.">
	<purpose>Verify WS security with remote AM instance.</purpose>
	<setup>Cofigure AM for remote use on the remote host. Start IDE.</setup>

        <usecase name="Verify security profiles with remote AM instance.">
           <action>Right click on the 'Sun Java System Access Managers' node in the 'Services' TAB and choose 'Add Server...'.</action>
           <action>In appeared dialog fill the remote server details and push 'Finish' button.</action>

           <action>Add remote AS instance and start it.</action>
	   <action>Verify all testcases from this test specification. The only differences is all applications will be deployed on the remote AS and in the 'Edit WS Attributes' dialogs need to set server value with remote AM instance.</action>
           <result>Remote AM instance node should appear in the 'Services' TAB under 'Sun Java System Access Managers' node.</result>
           <result>All testcases should pass.</result>
	</usecase>
</caseblock>

<caseblock name="Verify AM security and WSIT security co-existence.">

	<purpose>There should be no conflicts between AM security and WSIT security. Note that verification should be done for WS and WSC based on all supported projects types and different Java EE versions (Java EE 5 and J2EE 1.4).</purpose>

        <usecase name="Verify AM security when WSIT security is enabled for WS.">
            <action>Open 'Edit Web Service Attributes' dialog for WS.</action>
            <action>Switch to the 'WSIT Configuration' TAB and check in 'Secure Service' checkbox.</action>
            <action>Switch to the 'AM Security' TAB.</action>
            <result>Checkbox 'Enable Message Level Security' should be disabled.</result>

	</usecase>

        <usecase name="Verify WSIT security when AM security is enabled for WS.">
            <action>Open 'Edit Web Service Attributes' dialog for WS.</action>
            <action>Switch to the 'AM Security' TAB and check in 'Enable Message Level Security' checkbox.</action>
            <action>Switch to the 'WSIT Configuration' TAB.</action>
            <result>Checkbox 'Secure Service' should be disabled.</result>

	</usecase>

        <usecase name="Verify AM security when WSIT security is enabled for WSC.">
            <action>Open 'Edit Web Service Attributes' dialog for WSC.</action>
            <action>Switch to the 'WSIT Configuration' TAB and enable WSIT security.</action>
            <action>Switch to the 'AM Security' TAB.</action>
            <result>Checkbox 'Enable Message Level Security' should be disabled.</result>

	</usecase>

        <usecase name="Verify WSIT security when AM security is enabled for WSC.">
            <action>Open 'Edit Web Service Attributes' dialog for WSC.</action>
            <action>Switch to the 'AM Security' TAB and check in 'Enable Message Level Security' checkbox.</action>
            <action>Switch to the 'WSIT Configuration' TAB.</action>
            <result>All checkboxes should be disabled.</result>

	</usecase>
</caseblock>

<caseblock name="Verify identity samples.">
	<purpose>The identity samples should work without any errors.</purpose>
	<setup>Start IDE, start AS.</setup>

        <usecase name="Verify Stock sample.">
            <action>Create 'Stock Service' project from category 'Samples > Identity Blueprints'.</action>

            <action>Resolve reference problems for created project.</action>
            <action>Create 'Stock Client' project from category 'Samples > Identity Blueprints'</action>
            <action>Verify all testcases from section 'Verify WS security based on Web Application project type'. The only differences is client web project will be a module of enterprise application and need to deploy whole enterprise application instead of client web project separately.</action>
            <result>All testcases should pass with Stock sample projects.</result>
	</usecase>
</caseblock>

</spec>

