Write tests which help you add value on projects and provide a foundation of Java knowledge you can build on.
The author of book has given tremendous solutions to solve automation testing challenges with the help of java.
- Introduction
- Testers use Java differently
- Exclusions
- Windows and Mac supported
- Supporting Source Code
- About the Author
- Acknowledgments
- Chapter One – Basics of Java Revealed
- Java Example Code
- Chapter Two – Install the Necessary Software
- Introduction
- Do you already have JDK or Maven installed?
- Install The Java JDK
- Install Maven
- Install The IDE
- Create a Project using the IDE
- About your new project
- Add JUnit to the
pom.xml
file - Summary
- Chapter Three – Writing Your First Java Code
- My First JUnit Test
- Prerequisites
- Create A JUnit Test Class
- Create a Method
- Make the method a JUnit test
- Calculate the sum
- Assert the value
- Run the
@Test
method - Summary
- References and Recommended Reading
- Chapter Four – Work with Other Classes
- Use
@Test
methods to understand Java - Warnings about
Integer
- Summary
- References and Recommended Reading
- Use
- Chapter Five – Working with Our Own Classes
- Context
- First create an
@Test
method - Write code that doesn’t exist
- New Requirements
- Now Refactor
- Summary
- Chapter Six – Java Classes Revisited: Constructors, Fields, Getter & Setter Methods
- Context
- Constructor
- Getters and Setters
- Summary
- References and Recommended Reading
- Chapter Seven – Basics of Java Revisited
- Comments
- Statement
- Packages
- Java Classes
- Importing Classes
- Static Imports
- Data Types
- Operators
- Strings
- Summary
- References and Recommended Reading
- Chapter Eight – Selections and Decisions
- Ternary Operators
if
statementelse
statement- Nested
if
else
switch
statement- Summary
- References and Recommended Reading
- Chapter Nine – Arrays and For Loop Iteration
- Arrays
- Exercises
- Summary
- References and Recommended Reading
- Chapter Ten – Introducing Collections
- A Simple Introduction
- Iterating with
while
anddo...while
- Interfaces
- Summary
- References and Recommended Reading
- Chapter Eleven – Introducing Exceptions
- What is an exception?
- Catching Exceptions
- An Exception is an object
- Catch more than one exception
- JUnit and Exceptions
- Throwing an Exception
finally
- Summary
- References and Recommended Reading
- Chapter Twelve – Introducing Inheritance
- Inheritance
- Inherit from Interfaces and Abstract Classes
- Summary
- References and Recommended Reading
- Chapter Thirteen – More About Exceptions
- Unchecked and Checked Exceptions
- Difference between
Exception
,Error
andThrowable
- Create your own Exception class
- Summary
- References and Recommended Reading
- Chapter Fourteen – JUnit Explored
@Test
- Before & After
@Ignore
- JUnit Assertions
- Asserting with Hamcrest Matchers and
assertThat
fail
static
importing- Summary
- References and Recommended Reading
- Chapter Fifteen – Strings Revisited
String
SummarySystem.out.println
- Special character encoding
String
Concatenation- Converting to/from a
String
- Constructors
- Comparing Strings
- Manipulating Strings
- Basic String parsing with
split
- Manipulating strings With
StringBuilder
- Concatenation,
.format
, orStringBuilder
- Summary
- References and Recommended Reading
- Chapter Sixteen – Random Data
Math.random
java.util.random
- Seeding random numbers
- Using Random Numbers to generate Random Strings
- Discussion random data in automation
- Summary
- References and Recommended Reading
- Chapter Seventeen – Dates and Times
currentTimeMillis
andnanoTime
Date
SimpleDateFormat
Calendar
- Summary
- References and Recommended Reading
- Chapter Eighteen – Properties and Property Files
Properties
Basics- Java’s
System
Properties - Working with Property files
- Summary
- References and Recommended Reading
- Chapter Nineteen – Files
- Example of reading and writing a file
- File
- Writing And Reading Files
- Additional File Methods
- Files
- Summary
- References and Recommended Reading
- Chapter Twenty – Math and BigDecimal
- BigDecimal
- Math
- Summary
- References and Recommended Reading
- Chapter Twenty One – Collections Revisited
- Set
- Map
- Implementations
- Summary
- References and Recommended Reading
- Chapter Twenty Two – Advancing Concepts
- Interfaces
- Abstract Classes
- Generics
- Logging
- Enum
- Regular Expressions
- Reflection
- Annotations
- Design Patterns
- Concurrency
- Additional File considerations
- Summary
- Chapter Twenty Three – Next Steps
- Recommended Reading
- Recommended Videos
- Recommended Web Sites
- Next Steps
- References
- Appendix – IntelliJ Hints and Tips
- Shortcut Keys
- Code Completion
- Navigating Source Code
- Running a JUnit Test
- Loading Project Source
- Help Menu
- Summary
- Appendix – Exercise Answers
- Chapter Three – My First JUnit Test
- Chapter Four – Work With Other Classes
- Chapter Five – Work With Our Own Classes
- Chapter Six – Java Classes Revisited: Constructors, Fields, Getter & Setter Methods
- Chapter Eight – Selections and Decisions
- Chapter Nine – Arrays and For Loop Iteration
- Chapter Ten – Introducing Collections
- Chapter Eleven – Introducing Exceptions
- Chapter Twelve – Introducing Inheritance
- Chapter Thirteen – More Exceptions
- Chapter Fourteen – JUnit Explored
- Chapter Fifteen – Strings Revisited
- Chapter Sixteen – Random Data
- Chapter Seventeen – Dates & Times
- Chapter Eighteen – Properties and Property Files
- Chapter Nineteen – Files
- Chapter Twenty – Math and BigDecimal
- Chapter Twenty One – Collections Revisite
Original Source : https://leanpub.com/javaForTesters