Test driven development with JSF possible?

Hi,
I got two questions:
Is it possible to just make use of the HTML generation part of JSF, meaning creating the component tree and somehow triggering the generation of HTML for that view, without using a custom view handler?
Second, is it possible to create a component tree OUTSIDE the webcontainer and have it generate HTML for test driven development (JUnit tests not HttpUnit)? Even if it would mean using a mock FacesContext? We do something similar for our code that relies on a plain Servlet context, but because of the request processing lifecycle and all the value/method binding I'm not sure if the same can be done with JSF...
Thanks in advance,
Raymond Brandon

I've looked into these issues some. I specifically wanted a harness for custom controls, per your second request, and a way to do UI unit tests.
I didn't find much to aid in getting the former to happen and it seemed that creating mocks would be a huge hassle. As for the latter, I did find that there are cactus-based tests in the source code that Sun released, and there are some classes for making JSF testing easier, but the tests they have of their own code are surprisingly thin, and there doesn't appear to be an easy way to just grab a jar or two and start doing your own container tests. The Gamma/Beck book Contributing to Eclipse shows examples of writing UI unit tests that would be hugely useful.

Similar Messages

  • Test -Driven Development with the help of Open Script

    Hi Folks,
    I work on a web application that is based on java and other framework, which is more of an extension of java again.
    In order to have my test scripts code to be more aligned with developers' code, I want to import the jar file for source code into Open script and then develop test scripts and give those test scripts back to developers to run them on JUnit environment before they check in the code to source control. This way, I want to ensure that if any test scripts because of any bugs or regressions.
    And also I want to enable the build team to run these test scripts during build time as part of sanity. This would reduce our testing time a lot.
    What are your ideas and please provide your insights.
    Edited by: OATS Explorer on Mar 16, 2012 12:09 AM

    You need to to javascript and ajax. Generic example below but you'll have to figure out the specifics based on what you are doing.
    Checkbox:
    onclick=do_my_stuff(this);Javascript:
    function do_my_stuff(pObj)
      var get = new htmldb_Get(null,$v('pFlowId'),'APPLICATION_PROCESS=DO_STUFF',0);
      get.addParam('x01',pObj.value);
      ret = get.get();
      get=null;
    }PL/SQL application process, on-demand, named DO_STUFF:
    BEGIN
      do_stuff(apex_application.g_x01);
      commit; -- it's up to you if you need to commit or not if do_stuff is performing DML.
    END;Edited by: gti_matt on Jan 11, 2012 1:01 PM

  • Test Driven Development (TDD) in the ABAP world

    Hi All,
    It's been a long time since I've had any spare time to be active on the SCN forums so firstly hello to everyone.
    I've worked on a number of different SAP technologies over the years, starting with ABAP and moving into BSP, Portal API, Web Dynpro, Visual Composer, etc...  I'm currently working on a 7.01 Portal sat on top of an Oracle database and an old R/3 4.5b system.
    I'm also currently working on methodologies (trying to give something back to my colleagues here at AO) and have hit a bit of a blank around Test Driven Development when working in the ABAP stack.  I use JUnit to help me design, build and test Java based web services, ultimately used in WD, VC and via standalone Java applications.  I'm keen on increasing the adoption of TDD and other XP based practices but it needs to be viable in the ABAP world as well as the Java world.
    Here's my question - does anyone have any suggestions/experiences/guides or even just thoughts around using TDD with ABAP?
    I try to make all code I create service based so I rely on heavy use of componentisation, regardless of the language I am working with.  Obviously this is great with Java and ABAP Objects is also quite good, but sometimes we have to work with good old fashioned ABAP in the shape of programs, function groups and function modules.  I tend to treat a function group as a class and the function modules as the methods when designing and componentising.
    Applying the Java TDD approach, my rough idea is to use class/function groups to package my logic and then extend the class or group with an extra method/module that acts as the unit test routine.  I wonder if there is a better way though?
    It would be good to have a decent discussion in this area and capture everyone's thoughts as I'm sure I'm not the only person thinking along these lines.
    Thanks,
    Gareth.

    Hi Sandra,
    Thanks for that.  I wasn't sure if there'd be a proper SAP solution or not.
    Gareth.

  • Test Driven Development...

    Hi,
    I'd like to hear some pro's and con's about this Test Driven
    Development methodology. Have anyone of you in this forum been
    using this technique for your unit tesing? If so, please share the
    experiences.
    http://www.fusionauthority.com/Techniques/Article.cfm/ArticleID:4560
    Thanks in advance!

    Well doing iterative development is a good thing in general.
    There's no way the customer is ever going to determine all the
    things they want up front... so I've found keeping projects broken
    down into as smallest phases as possible makes it easier to predict
    target dates, and then at the same time you code a bit... test,
    catch technical issues as well as functionality/workflow... so by
    the end of development the end user/customer has what they want,
    and your code is fort knox tested.

  • ABAP UNIT - Test Driven Development

    Dear ABAPers,
    I hope some of you may have also ventured into this area of Test Driven Development.  I have just started looking into this new and exciting way of development.  My understanding after having gone through the available blogs and some reading material on TDD, is that, we have to religiously embrace Object Oriented programing to actually benefit from TDD methodology.  That raised a big question in my mind, how do we implement this technique when we are coding in the user exits like MV45AFZZ, which is mostly classical ABAP programming?
    Please help me understand the TDD a bit more than I currently do.
    Thanks much,
    SMA.
    <- removed by moderator ->
    Edited by: Neil Gardiner on Sep 29, 2010 10:38 AM

    As Dirk already mentioned TDD is writing test before writing productive code. This approach is not limited to OO practices or unit tests.
    E.g. writing an eCatt script in advance that passes as soon the scenario is working, adheres to TDD practices also..
    Vice versa if one practices unit testing and oo patterns it is no TDD if the tests are written after the productive code.
    Regards
      Klaus

  • Test Driven Development (TDD)

    Dear ABAPers,
    I hope some of you may have also ventured into this area of Test Driven Development. I have just started looking into this new and exciting way of development. My understanding after having gone through the available blogs and some reading material on TDD, is that, we have to religiously embrace Object Oriented programing to actually benefit from TDD methodology. That raised a big question in my mind, how do we implement this technique when we are coding in the user exits like MV45AFZZ, which is mostly classical ABAP programming?
    Please help me understand the TDD a bit more than I currently do.
    Thanks much,
    SMA.
    I tried placing this query in different forums on SDN and I am curiously awaiting for some ideas on this topic.
    (will reward any helpful replies/suggestions)

    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/1089283c-133d-2a10-f6b4-f3fd58265fb8
    http://www.webopedia.com/TERM/T/test_driven_development.html
    http://www.testdriven.com/modules/news/article.php?storyid=605
    http://blogs.ittoolbox.com/visualbasic/operating/archives/test-driven-development-life-and-beyond-4672
    http://www.testingreflections.com/taxonomy/page/or/53?from=56
    http://blogs.ittoolbox.com/visualbasic/operating/archives/test-driven-development-top-10-questions-5084
    Regards.

  • ADF + TDD (Test Driven Development)

    Hi,
    I'm learning TDD and I'll really appreciate to apply this technique to my Oracle ADF developments.
    With JUnit integration I can easily test my ADF BC and my beans but I now want to develop functional tests.
    So I want to test my JSF pages, redirections and so on.
    I found HtmlUnit, do you know if it's working well with ADF?
    Has you already developed with ADF using the TDD way? What did you learn from your experience?
    Thanks in advance for your help.

    You can integrate HTTP Unit into JDeveloper see this for example:
    http://blogs.oracle.com/shay/2007/08/09
    But also note that there are JSF specific testing frameworks out there that you can try out:
    http://www.infoq.com/news/2007/12/jsf-testing-tools

  • Where do I put the Jakarta files standard.jar and jstl.jar when developing with JSF 2.0 in OEPE using web logic server

    hi everybody, I am wondering what should i do with the standard.jar and jstl.jar files when using we logic. I tried putting both files into
    the directory c:\oracle\middleware\oracle_home\user_projects\domains\base_domain\bin.  I don't know if this is correct.  Thanks in
    in advance for the help.

    Anyways I found this link on www.oracle.com website by the same author of the book I am reading Deepak Vohra - Templating with JSF 2.0 Facelets.
    although here he is using Weblogic 11g although I don't think it makes a difference.  have a look at the Setting up the Environment section
    where he says to download the jstl.jar and standard.jar files.
    http://www.oracle.com/technetwork/articles/java/facelets-454361.html

  • Test-Driven Development for OUAF+Edge application

    Hi Folks,
    I work on a edge application (web application) that is based on OUAF.
    In order to have my test scripts code to be more aligned with developers' code, I want to import the jar file for source code into Open script (oracle testing tool based out of Eclipse IDE) and then develop test scripts and give those test scripts back to developers to run them on JUnit environment before they check in the code to source control. This way, I want to ensure that if any test scripts because of any bugs or regressions.
    And also I want to enable the build team to run these test scripts during build time as part of sanity. This would reduce our testing time a lot.
    What are your ideas and please provide your insights.
    Edited by: OATS Explorer on Mar 16, 2012 12:11 AM

    any ideas on this please, by anyone?

  • Test Driven Development in Pl/Sql

    Hi All,
    TDD is wonderful method of development of application.
    I saw TDD in Java world with My Eclipse IDE, this approache is possible in Pl/Sql world.
    I need to do the POC on it and want to implement in our project.
    If anybody implemented in there projects please share the information.
    Saw some link on google.
    1. There is UTSql package created by Steven.
    2. There is soln given by TOAD.
    Thanks
    Sandeep

    As the saying goes, you can lead a horse to water but you cannot make it drink.
    This is a principle I've found in many development teams. Especially "established" ones that have been working together for at least a year or so.
    To suddenly introduce new practices and new standards... does not work. The bigger/more drastic or different the change, the more painful it is to implement properly.
    So if the developers in the team are not committed to a TDD approach (in PL/SQL or whatever language used), and it is something new and different as far as the practices of that team goes... you may well ask yourself whether it is worth trying to enforce it. I've personally seen a whole dev team (and one of the better ones I've worked with) all resign in a period of 12 months due to being forced down a software development environment and cycle they simply did not accept.
    So whatever approach you choose, you need to make sure that you have the full and complete buy-in of every single developer on that team, and the commitment to follow that approach. At the same time, you need to make the transition for them as painless as possible, and provide the checks and reviews to make sure that this approach is consistently followed until it becomes the SOP for the team members.
    And no amount of fancy TOAD or this or that framework, will address this human accept and make TDD work.

  • Urgent Requirement : Java Web Developer with Websphere Portal : CA

    The Strategic Technologies Software Engineer - Advanced
    Job Title – Software Engineer - Advanced
    Location : CA
    Description:
    •     This Advanced Web Developer position will be a development team that is enhancing the feature set on the corporate intranet, IBM portal based system.
    •     Responsible for designing, developing and unit test components in a highly iterative and agile manner.
    •     Responsible for Design and Development of JSR168 portlets, servlets, JSPs and deploying the same to IBM WebSphere Environment. Ability to understand Themes, Personalization, SSO and integrate portlets.
    •     Responsible for writing Data access components using plain Java/JDBC and as well as using technologies like Spring and Hibernate
    •     Ability to quickly learn and come up to speed in a new environment and follow standards.
    •     Aside from solid web development skills, the candidate filling this position must have experience with test driven develop (TDD) techniques and have the demeanor and communication skills required for pair programming.
    •     Responsible for coordinating with team members to achieve desired results and possible mentoring of Junior programmers whenever there is a need.
    •     Proactively identifying issues in the development and bring up the same to the attention of tech lead or management attention at the very early stages. Ability to learn from team mates and solving issues quickly with the help of more knowledgeable team mates in that technology
    •     Strong experience in JSR 168 compliant, portlet design and development, preferably in a IBM portal environment – 2 to 4 years
    •     Strong experience with Java, J2EE web application design, development of servlets, jsps, JSTL and good understanding of MVC framework – minimum 4 years
    •     Strong experience in coding unit tests with JUNIT
    •     Experience with Javascript , html, XML and CSS in support of web application development
    •     Experience with design and development of data access component in Java with SQL knowledge
    •     Experience using IDEs like Eclipse , RAD and application servers like IBM Websphere Application Server
    •     Must have good communication skills both verbally and in written form and the ability to work independently with minimal guidance and as a member of a team. Education: A computer science college degree or equivalent experience.
    Must have:
    •     8 years Java web development skills and excellent understanding of object-oriented analysis / design / programming.
    5 years:
    •     Deep understanding of web application design / web security
    •     Good understanding of Model-View controller distributed architectures.
    •     Experience with Websphere Studio Application Developer (Eclipse)
    •     Experience with Service Oriented Architecture (SOA)
    •     OO Analysis and Design experience.
    •     Experience with the scrum agile development methodology, including TDD and JUNIT.
    Hands-on experience with IBM's Websphere Portal is required.
    If it interest you, please send your updated resume with your contact details ASAP at [email protected].
    Regards,
    Ejaz
    Symphony Enterprises LLC
    412-250-7227 (Tel) | 412-774-9230 (Fax)
    IT Staffing | Training |
    VERTICALS | Banking, Finance, Insurance | Healthcare | Manufacturing | Retail & Distribution
    [email protected] | www.symphonyenterprises.com
    WMBE & NWBE Certified Company
    A Member of Women's Business Enterprise National Council (WBENC)
    and National Association of Women Business Owners (NAWBO)

    I'm getting the same error on WebSphere 6.1.5. Is there any solution for this?

  • ChaRM: Normal Change - Not possible to set "Successfully Tested" unless the Maint. Cycle is set to "In Development with Release"

    Hello,
    I'm doing some tests with ChaRM, Normal Change scenario.
    As far as I know, the following steps would be the correct sequence (concerning development and test phases only):
    1) Developers perform the correction in DEV and release their TASKS of the transport request
    2) Developer Lead set the Normal Change document status to "to be tested"
    3) In background, a Transport of Copies is created with all data previously stored in the original transport request. Then this ToC is transported into QAS
    4) Change Manager set the Maintenance Cycle status to "Test"
    5) Tester performs the test into QAS
    6) Tester provides a valuable feedback and set Normal Change document status to "tested successfully"
    According to the following SAP Portal article, it seems to be correct:
    http://help.sap.com/saphelp_sm71_sp10/helpdata/en/48/db938dceba518de10000000a42189c/frameset.htm
    During my tests, however, I have noticed that it is just possible to go from step 5 to 6 if the Maintenance Cycle status is set to "In Development with Release" (go a step back in the Cycle). Otherwise, I get the following error messages:
    Warning Message Details Status was reset by system
    Warning Message Details Action RELEASE_ALL cannot be performed during this maintenance phase
    Warning Message Next status cannot be set because some actions cannot be executed.
    Once I have done the Cycle status change, then it is possible to move from 5 to 6 without errors and then the original transport request is transported into QAS too.
    Question: Is this the correct behavior or am I missing customizing?
    Thanks in advance for your help.
    Daniel

    Hello Vivek,
    Thanks for your reply.
    It is kinda weird the steps sequence, since the Tester needs to tell the Change Manager to move the cycle's status before approving the correction done in QAS (successfully tested).
    Perhaps a new action between "to be tested" and "successfully tested" could exist, in order to request the CM to perform the cycle update.
    But OK, that's how it is.
    Regards,
    Daniel

  • Test-driven oracle db development with FIT/FitNesse

    Hi,
    I have just finished testing the first version of DbFit, an extension to Fit.Net which allows database developers to write functional and acceptance tests easily and automate them using FIT (Framework for Integrated Testing) and FitNesse, a popular Web-based test and collaboration server.
    Version 0.1 supports testing stored procedures and functions, queries and statements on Oracle DB.
    Source code, binaries, examples, and a short introductory guide for test-driven Oracle database development using FitNesse and DbFit can be downloaded from http://gojko.net/fitnesse/dbfit
    Your comments would be greatly appreciated.
    Gojko Adzic
    http://gojko.net

    Hi Sandra,
    Thanks for that.  I wasn't sure if there'd be a proper SAP solution or not.
    Gareth.

  • How to Fill Sorted Data with model Driven Development

    Hello
    I am using model driven development. I am using getAll in the Fill method. But the results are not returned sorted by some field that I am interested in. How do I tell the Fill to sort it by some field. Is there some annotation that I can provided in the model...
    thanks
    RK

    You should be able to achieve what you want with an explicit criteria filter on your entity.
    In the Modeler Design view, select your entity and add a filter. You'll see that there is a an "Order By" field in the Properties view.
    Enter the value you want there and then save and redeploy your model. When you don't enter anything in the "Criteria" field, you create a getAll fill.
    Here's an example of an entity created with this type of filter; it is sorted by price in ascending order:
    <entity name="Product" persistent="true">
      <annotation name="ServerProperties" ServerType="LCDS"/>
      <annotation name="DMS" Table="PRODUCT"/>
      <annotation name="RDS" introspectedColumns="PRODUCTID,DESCRIPTION,PRICE,PRODUCTNAME"/>
      <annotation name="VisualModeler" width="115" height="110" x="364" y="203"/>
      <id name="productid" type="integer">
      <annotation name="DMS" ColumnName="PRODUCTID"/>
      </id>
      <property name="description" type="string" length="255">
      <annotation name="DMS" ColumnName="DESCRIPTION"/>
      </property>
      <property name="price" type="float">
      <annotation name="DMS" ColumnName="PRICE"/>
      </property>
      <property name="productname" type="string" length="255">
      <annotation name="DMS" ColumnName="PRODUCTNAME"/>
      </property>
      <filter name="MyFill" order="price ASC"/>
      </entity>

  • Missing IMethodRule in Test Driven Application

    Hi All,
                  I am working on a test driven application in Flash Builder 4. I am getting 1046: Type was not found or was not a compile-time constant: [org.flexunit.rules]::IMethodRule. error when I compile the application.
    I am using :
    Flash Builder 4 Premium Eclipse Plugin
    Latest Flex SDK 4.5.1.21328
    Please suggest if I am doing anything wrong.

    As the saying goes, you can lead a horse to water but you cannot make it drink.
    This is a principle I've found in many development teams. Especially "established" ones that have been working together for at least a year or so.
    To suddenly introduce new practices and new standards... does not work. The bigger/more drastic or different the change, the more painful it is to implement properly.
    So if the developers in the team are not committed to a TDD approach (in PL/SQL or whatever language used), and it is something new and different as far as the practices of that team goes... you may well ask yourself whether it is worth trying to enforce it. I've personally seen a whole dev team (and one of the better ones I've worked with) all resign in a period of 12 months due to being forced down a software development environment and cycle they simply did not accept.
    So whatever approach you choose, you need to make sure that you have the full and complete buy-in of every single developer on that team, and the commitment to follow that approach. At the same time, you need to make the transition for them as painless as possible, and provide the checks and reviews to make sure that this approach is consistently followed until it becomes the SOP for the team members.
    And no amount of fancy TOAD or this or that framework, will address this human accept and make TDD work.

Maybe you are looking for