Book Image

Java EE Development with Eclipse - Second Edition

By : Ram Kulkarni
Book Image

Java EE Development with Eclipse - Second Edition

By: Ram Kulkarni

Overview of this book

<p>Java EE is a technology for developing enterprise class, scalable applications. With recent changes to Java EE specifications, JEE application development has become a lot simpler. However, recent changes have also added many new specifications, some of which compete with existing JEE specification. Along with JEE specifications and APIs, it is also very important to understand the entire application development process and tools that can help simplify and accelerate JEE application development.</p> <p>This guide provides a complete overview of developing JEE applications using Eclipse. The many features of the Eclipse IDE are explained. These enable the rapid development, debugging, testing, and deployment of JEE applications. You’ll explore not just different JEE technologies and how to use them (JSP, JSF, JPA, JDBC, EJB, web services etc.), but also suitable technologies for different scenarios.</p> <p>The book starts with how to set up the development environment for JEE applications and then goes on to describe many JEE specifications in detail, with an emphasis on examples. You’ll learn how to deploy an example application on Tomcat and Glassfish Application Server.</p> <p>You’ll create a simple application that reads from a queue, processes the request, and publishes results to a topic and Eclipse MAT (Memory Analysis Tool) to debug memory issues.</p>
Table of Contents (18 chapters)
Java EE Development with Eclipse Second Edition
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Creating and executing unit tests using Eclipse EE


We will take the JDBC version of the course management application that we developed in Chapter 4, Creating a JEE Database Application, because it is simple to understand. Let's start with a simple test case for validating a course. The following is the source code of Course.java:

package packt.book.jee.eclipse.ch5.bean;

import java.sql.SQLException;
import java.util.List;

import packt.book.jee.eclipse.ch5.dao.CourseDAO;

public class Course {
  private int id;
  private String name;
  private int credits;
  private Teacher teacher;
  private int teacherId;
  private CourseDAO courseDAO = new CourseDAO();

  public int getId() {
    return id;
  }
  public void setId(int id) {
    this.id = id;
  }
  public String getName() {
    return name;
  }
  public void setName(String name) {
    this.name = name;
  }
  public int getCredits() {
    return credits;
  }
  public void setCredits(int credits) {
    this.credits = credits;
  }
  public...