In Detail Thorough testing is the basis of good software. Whether we use an agile development methodology such as Extreme Programming, or a more traditional approach, we must test our software at the unit level and application level. The tests must run automatically and cover all aspects of the software. In this book, the authors draw on more than 20 years of experience to show how automated testing can be applied to a real commercial product. This book will teach you how to automatically test user interfaces (Swing GUIs), the help system, internationalization, log files, spreadsheets, email, and web services, how to perform tests involving multiple JVMs, and a host of other things. These tests are applied at the module level (unit tests) and at the application level (function tests). The authors have developed the test processes in the broader context of an Extreme Programming (XP) methodology. However, the testing techniques are certainly not specific to XP, and may be applied within any given development methodology. This book is a practical guide to automated software testing for extreme Java programming using Swing GUIs, with lots of ready-to-use real-life examples and source code for automated testing of the software components usually regarded as too hard to test automatically. Approach This book is a practical guide based on the authors' daily experience developing and maintaining a cutting-edge Artificial Intelligence system. Every chapter comes up with real-life examples and the source code that comes with the book is full of useful (and well-tested) tools. The practical examples make this book suitable learning material for Swing developers. Who this book is for This book is for Swing developers who design and develop complex software for user interfaces that requires extensive testing. If you want to learn to test your Swing GUI components, this book is for you. Apache CXF Web Service Development (December 2009) (ATTiCA)......Page 1 About the Authors......Page 5 About the Reviewer......Page 7 Table of Contents......Page 8 Preface......Page 14 Getting Familiar with CXF......Page 20 XML......Page 21 SOAP (Simple Object Access Protocol)......Page 22 WSDL (Web Services Description language)......Page 23 REST (Representational State Transfer)......Page 25 Introducing web services......Page 26 Approaches for web service development......Page 27 Web service SOAP communication styles......Page 28 History of CXF......Page 29 Support for web service standards......Page 30 Frontend programming APIs......Page 31 Support for RESTful services......Page 32 Ease of use......Page 33 For ANT users......Page 34 For Maven users......Page 35 Summary......Page 37 Developing a Web Service with CXF......Page 38 The Order Processing Application......Page 39 Creating a Service Endpoint Interface (SEI)......Page 40 Developing a service implementation class......Page 43 Spring-based server bean......Page 44 Developing a client......Page 45 Developing web service client code......Page 46 Running the program......Page 49 Building the code......Page 50 Executing the code......Page 51 Bus......Page 52 JAX-WS......Page 54 Messaging and Interceptors......Page 56 Service model......Page 58 Data binding......Page 59 Protocol binding......Page 60 Summary......Page 62 JAX-WS frontend......Page 64 Code-first development......Page 65 Creating Service Endpoint Interface (SEI)......Page 66 Adding Java annotations......Page 67 Publishing the service......Page 72 Developing a consumer......Page 73 Running the Code-first example......Page 74 Contract-first development......Page 75 Generating service components......Page 77 Publishing the web service......Page 86 Creating a simple dynamic client......Page 87 Running the dynamic client......Page 89 Using the CXF service model for building dynamic client......Page 90 Running the dynamic client which uses Service Model API......Page 93 Provider and Dispatch services......Page 94 Message mode......Page 95 javax.xml.transform.Source......Page 96 Implementing Provider service......Page 98 Publishing the Provider service......Page 101 Implementing the Dispatch service......Page 102 Running the provider dispatch example......Page 104 Web service context......Page 106 Implementing Context in service......Page 107 Running the web service context example......Page 108 Developing a simple frontend......Page 109 Creating server implementation......Page 110 Creating client......Page 111 Running the simple frontend example......Page 112 Summary......Page 113 Learning about Service Transports......Page 114 HTTP transport......Page 115 SOAP over HTTP......Page 116 HTTP only......Page 118 HTTP Conduit......Page 119 HTTP destination......Page 120 HTTPs transport......Page 121 Generating crypto key......Page 122 Creating client and server bean configuration......Page 123 Developing the client component......Page 126 Building and deploying......Page 127 Configuring SSL for Jetty runtime......Page 128 JMS transport......Page 131 Developing an embedded broker......Page 132 Creating a server and client bean configuration......Page 133 Developing a client component......Page 135 Performing build and deployment......Page 136 Local transport......Page 139 Creating client bean configuration......Page 140 Developing a Client......Page 141 Building and executing......Page 142 Summary......Page 143 Understanding CXF interceptors......Page 144 Understanding interceptor phase and chain......Page 145 Overview of the interceptor API......Page 146 The PhaseInterceptor interface......Page 147 The AbstractPhaseInterceptor class......Page 148 Developing the custom interceptor......Page 150 Developing the server side interceptor......Page 151 Developing the client side interceptor......Page 154 Adding a client side interceptor to the client code......Page 157 Developing the standalone server for publishing the Order Process web service......Page 158 Building and running the Order Process web service and interceptor......Page 159 Building the code......Page 160 Executing the code......Page 161 Testing the custom interceptor for negative condition......Page 162 Understanding CXF features......Page 164 Developing service and implementation class......Page 165 Developing a server component......Page 166 Creating the client bean configuration file......Page 167 Building and executing the code......Page 168 Overview of Invoker API......Page 170 The AbstractInvoker class......Page 171 Developing custom invoker......Page 172 Summary......Page 177 Developing RESTful Services with CXF......Page 178 Overview of REST and RESTful services......Page 179 Java API for RESTful services......Page 181 CXF JAX-RS implementation......Page 183 Developing end-to-end RESTful services using CXF JAX-RS implementation......Page 184 Creating Java data objects for Request and Response......Page 185 Providing binding for the Request and Response data objects......Page 187 Developing the implementation class......Page 188 Creating the client......Page 198 Running the program......Page 202 Building the code......Page 203 Deploying the code......Page 204 Executing the code......Page 205 Adding exception handling to RESTful service......Page 207 Summary......Page 212 Deploying RESTful Services with CXF......Page 214 Configuring CategoryService RESTful bean using Spring......Page 215 Integrating Spring using web.xml......Page 217 Building the code......Page 218 Deploying the code......Page 220 Installing POSTER client......Page 221 Invoking the Get Category operation......Page 223 Invoking the Add Category operation......Page 225 Invoking the Update Category operation......Page 227 Invoking the Add Books operation......Page 229 Invoking the Get Books operation......Page 231 Invoking the Update Category operation with invalid request......Page 233 Invoking the Get Category operation with invalid request......Page 235 Invoking the Delete Category operation......Page 237 Invoking the Book Shop application using CXF APIs......Page 238 Configuring JSON support for the Book Shop application......Page 243 Incorporating JSON message format for the Book Shop application......Page 244 Invoking the Get Category operation with JSON as the message format......Page 247 Invoking the Add Category operation with JSON as the message format......Page 249 Invoking the Book Shop application with JSON as the message format using CXF APIs......Page 251 Intercepting messages for the Book Shop application......Page 253 Summary......Page 256 Invoking a web service using the Java client......Page 258 Analyzing the service WSDL definition......Page 259 Generate the web service clients......Page 264 Analyzing the JAX-WS and client generated artifacts......Page 268 Modifying the generated client......Page 269 Running the client......Page 271 Invoking the web service using JavaScript......Page 272 Generating the JavaScript client......Page 273 Analyzing the generated artifacts......Page 275 Creating the client......Page 279 Running the client......Page 283 Creating Service Implementation from the WSDL file......Page 284 Generating the web Service Implementation......Page 285 Analyzing the Service Implementation generated artifacts......Page 286 Modifying the generated Service Implementation......Page 287 Deploying and publishing the web service......Page 290 Invoking the web service......Page 291 Validating WSDL files......Page 292 Summary......Page 293 Downloading the source code......Page 294 Downloading the software required for the book......Page 295 Setting up the environment......Page 296 Using Maven for Build management......Page 297 Building chapter source code using Maven......Page 298 Getting Started with Spring......Page 302 Understanding Inversion of Control......Page 303 Overview of aspect-oriented programming......Page 305 The Spring IoC container......Page 306 Creating the entity model......Page 307 Creating services......Page 311 Creating the application and wiring POJO......Page 313 Creating the standalone client......Page 317 Running the program......Page 319 Building the code......Page 320 Executing the code......Page 322 Summary......Page 323 Index......Page 324 The Extreme approach to complete Java application testing Learn Swing user interface testing strategy Automate testing of components usually thought too hard to test automatically Practical guide with ready-to-use examples and source code Based on the authors' experience developing and testing commercial software In Detail Thorough testing is the basis of good software. Whether we use an agile development methodology such as Extreme Programming, or a more traditional approach, we must test our software at the unit level and application level. The tests must run automatically and cover all aspects of the software. In this book, the authors draw on more than 20 years of experience to show how automated testing can be applied to a real commercial product. This book will teach you how to automatically test user interfaces (Swing GUIs), the help system, internationalization, log files, spreadsheets, email, and web services, how to perform tests involving multiple JVMs, and a host of other things. These tests are applied at the module level (unit tests) and at the application level (function tests). The authors have developed the test processes in the broader context of an Extreme Programming (XP) methodology. However, the testing techniques are certainly not specific to XP, and may be applied within any given development methodology