Topic
  • 8 replies
  • Latest Post - ‏2012-11-15T20:20:18Z by SystemAdmin
SystemAdmin
SystemAdmin
9029 Posts

Pinned topic Disable testing support

‏2012-11-13T21:01:46Z |
All,

I have a WEF project with a number of service provider models (and corresponding service consumer models), and all of the providers have Testing support enabled in the Service definition builder. What I wanted to do was to disable testing support for all the providers before deploying it on QA, since testing support creates a lot of extra pages etc. I found this article that talks about testing support.
https://www.ibm.com/developerworks/forums/thread.jspa?messageID=14868884

So I opened up the exported WAR and inspected the model and it seems like testing support is not disabled, as mentioned in the article above. Can someone validate this? If it is not disabled automatically on WAR export, is there a property that I could set that would facilitate this?

Thanks,
Sameer
Updated on 2012-11-15T20:20:18Z at 2012-11-15T20:20:18Z by SystemAdmin
  • Dinger
    Dinger
    117 Posts

    Re: Disable testing support

    ‏2012-11-13T22:06:47Z  
    Hi sameerkumarg,

    I just tried this and verified that it works as I would expect. Using a project which has Testing Support enabled for the provider model, I right-clicked the project in the eclipse Project Explorer and selected "Export->Web Experience Factory Portlet WAR". I inspected the war file and didn't see any of the testing support pages.

    Are you using the "Export->Web Experience Factory Portlet WAR" or "Export->Web Experience Factory Application WAR" menu item to generate your production WAR file for deployment? If you use the "Export->WAR file" menu item, then WEF will produce a WAR that is meant to be used for development. See this page for more information:

    http://www-10.lotus.com/ldd/pfwiki.nsf/xpDocViewer.xsp?lookupName=Web+Experience+Factory+8+Documentation#action=openDocument&res_title=Overview_publishing_and_exporting_wef8&content=pdcontent

    The content of this post is my own and does not necessarily represent the positions, strategies, or opinions of IBM.
  • SystemAdmin
    SystemAdmin
    9029 Posts

    Re: Disable testing support

    ‏2012-11-13T22:19:07Z  
    • Dinger
    • ‏2012-11-13T22:06:47Z
    Hi sameerkumarg,

    I just tried this and verified that it works as I would expect. Using a project which has Testing Support enabled for the provider model, I right-clicked the project in the eclipse Project Explorer and selected "Export->Web Experience Factory Portlet WAR". I inspected the war file and didn't see any of the testing support pages.

    Are you using the "Export->Web Experience Factory Portlet WAR" or "Export->Web Experience Factory Application WAR" menu item to generate your production WAR file for deployment? If you use the "Export->WAR file" menu item, then WEF will produce a WAR that is meant to be used for development. See this page for more information:

    http://www-10.lotus.com/ldd/pfwiki.nsf/xpDocViewer.xsp?lookupName=Web+Experience+Factory+8+Documentation#action=openDocument&res_title=Overview_publishing_and_exporting_wef8&content=pdcontent

    The content of this post is my own and does not necessarily represent the positions, strategies, or opinions of IBM.
    Hi Thomas,

    I did export a Web Experience Factory Portlet WAR from the designer. When I extracted a provider model out of the exported WAR and looked at it in a text editor, I still see the "AddTestingSupport" and "TestCreateMain" inputs set to True. Doesn't that mean that testing support is still enabled? I was expecting that the exported WAR would have the value "False".
    This may be the desired behavior, but I wanted to make sure Testing support was indeed disabled.

    Thanks,
    Sameer
  • kevintap
    kevintap
    748 Posts

    Re: Disable testing support

    ‏2012-11-14T14:45:14Z  
    Hi Thomas,

    I did export a Web Experience Factory Portlet WAR from the designer. When I extracted a provider model out of the exported WAR and looked at it in a text editor, I still see the "AddTestingSupport" and "TestCreateMain" inputs set to True. Doesn't that mean that testing support is still enabled? I was expecting that the exported WAR would have the value "False".
    This may be the desired behavior, but I wanted to make sure Testing support was indeed disabled.

    Thanks,
    Sameer
    Hi Sameer,

    The testing support should be automatically disabled when running a WEF application in a "production" mode. You won't specifically see the "AddTestingSupport" or "TestCreateMain" builder inputs in the models changed when you export a WAR - we don't modify the .model files. However, WEF does know (based on how the EAR/WAR was exported from the WEF Designer) that the application has been exported as a production EAR/WAR and should be running in a production mode. When WEF generates these service provider models in a production mode WAR, these inputs for testing support are ignored.

    You can verify this by launching a service provider model from your WEF Designer, then examining the URL that the browser is directed to. You can then manually adjust the URL to point to the same model as deployed in your QA environment and verify that the testing support is not available.

    This is done both for performance (as you were initially concerned about) and for security purposes, as it would not be desirable to have unrestricted access to the raw data services in this test mode when an application is deployed in a production context.
    The postings on this site are my own and don't necessarily represent IBM's positions, strategies or opinions.
  • SystemAdmin
    SystemAdmin
    9029 Posts

    Re: Disable testing support

    ‏2012-11-15T17:33:14Z  
    • kevintap
    • ‏2012-11-14T14:45:14Z
    Hi Sameer,

    The testing support should be automatically disabled when running a WEF application in a "production" mode. You won't specifically see the "AddTestingSupport" or "TestCreateMain" builder inputs in the models changed when you export a WAR - we don't modify the .model files. However, WEF does know (based on how the EAR/WAR was exported from the WEF Designer) that the application has been exported as a production EAR/WAR and should be running in a production mode. When WEF generates these service provider models in a production mode WAR, these inputs for testing support are ignored.

    You can verify this by launching a service provider model from your WEF Designer, then examining the URL that the browser is directed to. You can then manually adjust the URL to point to the same model as deployed in your QA environment and verify that the testing support is not available.

    This is done both for performance (as you were initially concerned about) and for security purposes, as it would not be desirable to have unrestricted access to the raw data services in this test mode when an application is deployed in a production context.
    The postings on this site are my own and don't necessarily represent IBM's positions, strategies or opinions.
    Thanks Kevin. I have one last question. So when I export a WAR from the designer, it is considered a "Production" WAR. What if the WAR is built as a part of a build process, i.e., on a build server where the artifacts are checked out of Source control and ANT scripts are used to generate the WAR. Is the WAR considered "Production" in that scenario as well?

    Thanks,
    Sameer
  • SystemAdmin
    SystemAdmin
    9029 Posts

    Re: Disable testing support

    ‏2012-11-15T17:50:04Z  
    Thanks Kevin. I have one last question. So when I export a WAR from the designer, it is considered a "Production" WAR. What if the WAR is built as a part of a build process, i.e., on a build server where the artifacts are checked out of Source control and ANT scripts are used to generate the WAR. Is the WAR considered "Production" in that scenario as well?

    Thanks,
    Sameer
    Yes, if you're building using our OOTB build scripts.

    See these two articles:
    http://www-10.lotus.com/ldd/pfwiki.nsf/xpSearch.xsp?searchValue=buildPortletWar
    --
    Sam
    The postings on this site are my own and do not necessarily represent the positions, strategies, or opinions of IBM.
  • SystemAdmin
    SystemAdmin
    9029 Posts

    Re: Disable testing support

    ‏2012-11-15T18:05:42Z  
    Yes, if you're building using our OOTB build scripts.

    See these two articles:
    http://www-10.lotus.com/ldd/pfwiki.nsf/xpSearch.xsp?searchValue=buildPortletWar
    --
    Sam
    The postings on this site are my own and do not necessarily represent the positions, strategies, or opinions of IBM.
    Thanks Sam. Now I can test all my providers in peace :)

    Regards,
    Sameer
  • kevintap
    kevintap
    748 Posts

    Re: Disable testing support

    ‏2012-11-15T20:13:32Z  
    Thanks Sam. Now I can test all my providers in peace :)

    Regards,
    Sameer
    Hi Sameer,

    As Sam mentioned, if you're using the WEF provided build scripts, then your WAR should be a production mode WAR.

    The key bit to check here is in the WEB-INF/config/bowstreet.properties file. Check the value of the bowstreet.server.type property. This property should either be development for a development mode WAR file or deployment for a production WAR file.

    The build scripts that are provided with WEF automatically call a task called setDeploymentProperties (in deploymentwar.xml and portletwar.xml) which ensures that this property gets set to the appropriate value for a production mode WAR.
    The postings on this site are my own and don't necessarily represent IBM's positions, strategies or opinions.
  • SystemAdmin
    SystemAdmin
    9029 Posts

    Re: Disable testing support

    ‏2012-11-15T20:20:18Z  
    • kevintap
    • ‏2012-11-15T20:13:32Z
    Hi Sameer,

    As Sam mentioned, if you're using the WEF provided build scripts, then your WAR should be a production mode WAR.

    The key bit to check here is in the WEB-INF/config/bowstreet.properties file. Check the value of the bowstreet.server.type property. This property should either be development for a development mode WAR file or deployment for a production WAR file.

    The build scripts that are provided with WEF automatically call a task called setDeploymentProperties (in deploymentwar.xml and portletwar.xml) which ensures that this property gets set to the appropriate value for a production mode WAR.
    The postings on this site are my own and don't necessarily represent IBM's positions, strategies or opinions.
    Kevin,

    Thanks for the clarification. I did check the bowstreet.server.type property in the exported WAR file and it is indeed "deployment". Also, we are using WEF provided build scripts to generate the WAR, so we should be good.

    Regards,
    Sameer