Applied MyEclipse and JUnit to do Hibernate Code Gen and Testing

Loading...

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

0 comments

Post a comment

    Post a comment
    Embed Video
    Edit your comment Cancel

    Favorites, Groups & Events

    Applied MyEclipse and JUnit to do Hibernate Code Gen and Testing - Presentation Transcript

    1. Applied MyEclipse and JUnit to do Hibernate Code Gen and Testing Albert Guo [email_address]
    2. Agenda
      • High Level Picture
      • Hibernate Code Generation
          • Code Gen Process
          • Generate DAO for the four tables
          • Artifacts
          • Spring Configuration File
          • Sequence Diagram
      • Apply JUnit to do DAOs Test
          • JUnit Framework
          • How to Test with JUnit?
          • Simplified Workflow of Applying JUnit
          • Testing Process
          • Generate Unit Test Result via Ant
    3. High Level Picture Application Context DAO Classes ApplicationContext.xml Hibernate Mapping files Client Layer Business Layer Persistence Layer Spring – IOC Container Hibernate Session Mgt. Business Service Classes Hibernate Windchill Workflow Data Source / Connection Pool
    4. Code Gen Process including POJOs, DAOs, hibernate mapping files and Spring configuration file
    5. Filled in connection info. Add MS SQL driver Save password, then you do not need to type in again
    6. Click Test Driver to test database connection If you connect to database successfully, then you can see this popup window
    7. Generate DAO for the four tables
    8. Select tables which we would like to do code gen. Click Hibernate Reverse Engineering
    9. Assign destination Generate hibernate mapping file Generate POJO Generate Spring DAO
    10. Select ID Generator
    11. Artifacts We had generated POJOs, hibernate mapping files, and DAOs
    12. Spring Configuration File Inject webSiteDataSource into sessionFactory
    13. Spring Configuration File – cont. Inject sessionFactory into each DAOs.
    14. Sequence Diagram
    15. Apply Junit to do DAOs Test
    16. JUnit Framework
    17. How to Test with JUnit? WipPortingDAO junit TestCase exercise 1..* TestRunner run 1..* WipPortingDAOTest test 1 test 2 …
    18. Simplified Workflow of Applying JUnit Class files Test Cases Test Methods Test Suites Test Runner
    19. Testing Process Overrides setUp() and/or tearDown() Writes test methods, ex. test…() Uses Assert.assert … () Writes suite() and/or main()
    20. Create Fixture via MyEclipse
    21. Create Fixture via MyEclipse – cont.
    22. Create Fixture via MyEclipse – cont.
    23. Create Fixture via MyEclipse – cont.
    24. Exercise & Verify
    25. Exercise & Verify – cont.
    26. Suit Management
    27. Suit Management
    28. Generate Unit Test Result via Ant
    29. Generate Unit Test Result via Ant

    + Guo AlbertGuo Albert, 2 years ago

    custom

    1619 views, 0 favs, 0 embeds more stats

    More info about this document

    © All Rights Reserved

    Go to text version

    • Total Views 1619
      • 1619 on SlideShare
      • 0 from embeds
    • Comments 0
    • Favorites 0
    • Downloads 53
    Most viewed embeds

    more

    All embeds

    less

    Flagged as inappropriate Flag as inappropriate
    Flag as inappropriate

    Select your reason for flagging this presentation as inappropriate. If needed, use the feedback form to let us know more details.

    Cancel
    File a copyright complaint
    Having problems? Go to our helpdesk?

    Categories