Introduction to Java Testing

Customized Onsite Training

2
Days
  • Customized Content
  • For Groups of 5+
  • Online or On-location
  • Expert Instructors

Live Online Training

$950.00
or 2 vouchers
  • Live Online Training
  • Expert Instructors
  • Guaranteed to Run
  • 100% Free Re-take Option
  • 1-minute Video

Upcoming Classes

  • See More Classes

Please select a class.
Overview

This course introduces the experienced Java programmer to testing and test-driven development practices using JUnit. We work from the basics of JUnit as a tool, to best practices for writing effective and maintainable tests. The course is not strictly a TDD course, but we introduce TDD and take students through an illustrative case study. We discuss the importance of mocking and explore testing techniques using Mockito. Finally we discuss concerns and strategies for testing enterprise components in the Java EE context.

Goals
  1. Build unit tests for Java classes using JUnit.
  2. Write effective tests, and design classes for testability.
  3. Understand test-driven development (TDD) and use dynamic mocking to support isolated testing.
  4. Develop effective testing strategies for Java-EE components.
Outline
  1. Automated Unit Testing with JUnit
    1. Automated Testing
    2. JUnit and Related Tools
    3. The @Test Annotation
    4. The Assert Class Utility
    5. Test Runners
    6. Lifecycle Methods
    7. Expecting Exceptions
    8. Test Suites
  2. Writing Tests
    1. Test Granularity
    2. Reusing Test Logic
    3. Recording and Comparing Output
    4. Test Isolation
    5. Controlling the Test Environment
    6. Managing Dependencies
    7. Non-Invasive Testing
    8. Designing for Testability
    9. Factories
    10. Testing and Threads
  3. Test-Driven Development
    1. Writing the Test First
    2. The TDD Cycle
    3. Advantages of TDD
    4. Resistance to TDD
    5. A Case Study
  4. Mocking
    1. Mock Objects in Testing
    2. Mock Objects in Test-Driven Development
    3. Static vs. Dynamic Mocks
    4. Stubbing
    5. Verifying
    6. Matching and Capturing
    7. Using a Spy
    8. Partial Mocking
  5. Testing Enterprise Components
    1. Challenges in Java-EE Testing
    2. The Java Naming and Directory Interface
    3. Mocking JNDI
    4. Java-EE Dependency Injection
    5. Testing Persistence Components
    6. Mocking JDBC and JPA
    7. Test Databases
    8. Auto-Rollback
    9. Verifying Transactionality and Cleanup
    10. Web Components
    11. Mocking the Web Container
    12. Asynchronous Messaging
    13. Mocking the JMS Session
    14. Web-Services APIs: JAX-WS and JAX-RS
Class Materials

Each student in our Live Online and our Onsite classes receives a comprehensive set of materials, including course notes and all the class examples.

Class Prerequisites

Experience in the following is required for this Java Fundamentals class:

  • Solid Java programming experience is essential
Preparing for Class

No cancelation for low enrollment

Certified Microsoft Partner

Registered Education Provider (R.E.P.)

GSA schedule pricing

74,839

Students who have taken Live Online Training

15,233

Organizations who trust Webucator for their training needs

100%

Satisfaction guarantee and retake option

9.41

Students rated our trainers 9.41 out of 10 based on 5,189 reviews

Contact Us or call 1-877-932-8228