Test Harness
Every adapter must have a test harness capable of testing the adapter classes in a non-JCA environment. This simplifies the unit testing of the adapter classes. Listing 17.29 contains a test harness for the ASCII file adapter.
Listing 17.29. testHarness.java
/** * Title: ASCII File Adapter<p> * Description: This package contains all non-JCA classes of the * ASCII file adapter.<p> * Copyright: Copyright (c) Atul Apte<p> * Company: iConexio Technologies Inc.<p> * @author Atul Apte * @version 1.0 */ package com.iconexio.asciiFileAdapter; /** * The test harness is a standalone Java program that uses the ASCII file * parser classes to parse the customer data file and display the contents * to the standard output. */ import java.util.Vector; ... |
Get Java™ Connector Architecture: Building Custom Connectors and Adapters now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.