Tutorial 7 Unit Test and Web service deployment



Similar documents
Tutorial IV: Unit Test

JUnit. Introduction to Unit Testing in Java

Consuming, Providing & Publishing WS

Unit testing with JUnit and CPPUnit. Krzysztof Pietroszek

Effective unit testing with JUnit

Table of Contents. LESSON: The JUnit Test Tool...1. Subjects...2. Testing What JUnit Provides...4. JUnit Concepts...5

Unit Testing webmethods Integrations using JUnit Practicing TDD for EAI projects

Approach of Unit testing with the help of JUnit

Implementing SQI via SOAP Web-Services

Joke Server example. with Java and Axis. Web services with Axis SOAP, WSDL, UDDI. Joke Metaservice Joke Server Joke Client.

PDQ-Wizard Prototype 1.0 Installation Guide

Developing Web Services with Eclipse and Open Source. Claire Rogers Developer Resources and Partner Enablement, HP February, 2004

Unit Testing and JUnit

Unit Testing JUnit and Clover

Test Driven Development

WIRIS quizzes web services Getting started with PHP and Java

Author: Sascha Wolski Sebastian Hennebrueder Tutorials for Struts, EJB, xdoclet and eclipse.

Software Development Tools

Agile.NET Development Test-driven Development using NUnit

DEVELOPING CONTRACT - DRIVEN WEB SERVICES USING JDEVELOPER. The purpose of this tutorial is to develop a java web service using a top-down approach.

Test-Driven Development

Feith Dashboard iq Server Version 8.1 Install Guide

Endo-Testing: Unit Testing with Mock Objects

Testing, Debugging, and Verification

Java Access to Oracle CRM On Demand. By: Joerg Wallmueller Melbourne, Australia

Unit Testing. and. JUnit

Using JUnit in SAP NetWeaver Developer Studio

02267: Software Development of Web Services

Automated Integration Testing & Continuous Integration for webmethods

Test Automation Integration with Test Management QAComplete

Contents. Introduction and System Engineering 1. Introduction 2. Software Process and Methodology 16. System Engineering 53

Overview of Web Services API

TCH Forecaster Installation Instructions

Automated Testing of Graphical Models in Heterogeneous Test Environments

Web. Services. Web Technologies. Today. Web. Technologies. Internet WWW. Protocols TCP/IP HTTP. Apache. Next Time. Lecture # Apache.

How To Test In Bluej

JUnit Automated Software Testing Framework. Jeff Offutt. SWE 437 George Mason University Thanks in part to Aynur Abdurazik. What is JUnit?

3. Installation and Configuration. 3.1 Java Development Kit (JDK)

Creating Web Services Applications with IntelliJ IDEA

Outline. 1 Denitions. 2 Principles. 4 Implementation and Evaluation. 5 Debugging. 6 References

Continuous Integration with Jenkins. Coaching of Programming Teams (EDA270) J. Hembrink and P-G. Stenberg [dt08jh8

soapui Product Comparison

Chapter 1: Web Services Testing and soapui

Brekeke PBX Web Service

Domain Specific Languages for Selenium tests

A Sample OFBiz application implementing remote access via RMI and SOAP Table of contents

MarathonITE. GUI Testing for Java/Swing Applications

Test Driven Development

T320 E-business technologies: foundations and practice

Integration of. ERP systems and epages 6. with Web services

Web-Service Example. Service Oriented Architecture

CS 2112 Spring Instructions. Assignment 3 Data Structures and Web Filtering. 0.1 Grading. 0.2 Partners. 0.3 Restrictions

Software Engineering I (02161)

Gothenburg Mainframe and Continuous Integration. Jan Marek com. CA Technologies. Session S610

Unit Testing & JUnit

Applets, RMI, JDBC Exam Review

Web Services Regression Testing

Lab work Software Testing

Testing Tools Content (Manual with Selenium) Levels of Testing

Ce document a été téléchargé depuis le site de Precilog. - Services de test SOA, - Intégration de solutions de test.

Going Interactive: Combining Ad-Hoc and Regression Testing

Test-Driven Development and Unit Testing with Parasoft Concerto

E-vote 2011 Version: 1.0 Testing and Approval Date: 26/10/2009. E-vote SSA-U Appendix 5 Testing and Approval Project: E-vote 2011

Agile Testing and Extreme Programming

Advanced Test-Driven Development

Java course - IAG0040. Unit testing & Agile Software Development

UNIT TESTING. Written by Patrick Kua Oracle Australian Development Centre Oracle Corporation

Xtreme RUP. Ne t BJECTIVES. Lightening Up the Rational Unified Process. 2/9/2001 Copyright 2001 Net Objectives 1. Agenda

an open source web service toolkit for Java Mark Volkmann Object Computing, Inc.

02267: Software Development of Web Services

Java Bluetooth stack Acceptance Test Plan Version 1.0

Property-based testing for Web Services. The PROWESS consortium

Systems Integration: Co C mp m onent- t bas a e s d s o s ftw ft a w r a e r e ngin i eeri r n i g

Web Services using Tomcat and Eclipse

National University of Ireland, Maynooth MAYNOOTH, CO. KILDARE, IRELAND. Testing Guidelines for Student Projects

XP & Scrum. extreme Programming. XP Roles, cont!d. XP Roles. Functional Tests. project stays on course. about the stories

Continuous integration for databases using

RUP. Development Process. Iterative Process (spiral) Waterfall Development Process. Agile Development Process. Well-known development processes

Web-JISIS Reference Manual

Introduction to Testing Webservices

Consuming a Web Service(SOAP and RESTful) in Java. Cheat Sheet For Consuming Services in Java

Software Testing with Python

IBM Rational Software

Supplement IV.D: Tutorial for MS Access. For Introduction to Java Programming By Y. Daniel Liang

Address Phone & Fax Internet

Topics covered. Agile methods Plan-driven and agile development Extreme programming Agile project management Scaling agile methods

+ Introduction to JUnit. IT323 Software Engineering II By: Mashael Al-Duwais

Transcription:

Tutorial 7 Unit Test and Web service deployment junit, Axis

Last lecture On Software Reuse The concepts of software reuse: to use the knowledge more than once Classical software reuse techniques Component-based software reuse How web services help with component-based software reuse Quality-based software reuse How aspect-orientation helps with quality-base reuse Don t reinvent the wheel

This tutorial will cover skills you can apply to your project immediately: Unit test Today Deployment of Web services Note. We shall do the two tutorials on these subjects, but we have to save some time for you to express yourselves during the next lecture time. Thus we compress the two tutorials into one.

Unit Test: 1. What is Unit Test? Integration Test: System Test: Acceptance Test: The earlier a bug is found, the better! Test can be done once a unit is ready! Replace other units with stubs!

What can be tested in units? A functional requirement: Given input that satisfies the precondition, whether the output satisfies the post-condition A unit can be a member function, a class, a package, a component or a subsystem Automation is the key! Replace user interaction with the scripts, if possible; replace some with stubs A unit tested can still have bugs, but most trivial bugs should have been found

What can not be tested? Generally, test can not replace the verification or code review Specifically for unit test, interactions between this unit and other units after integration, system and user acceptance are not possible when the system is not ready yet

JUnit JUnit is an open source Java testing framework used to write and run repeatable tests. JUnit features include: Assertions for testing expected results Test fixtures for sharing common test data Test suites for easily organizing and running tests Graphical and textual test runners JUnit was originally written by Erich Gamma and Kent Beck (the authors of the Gang of Four (design patterns) book).

Test-driven development Extreme Programming Also called Paired programming How test helps? Avoid misunderstandings of the requirements of the swapped units Refactoring How test helps? Make sure each refactoring step preserves the semantics and achieves quality improvements

OpenOME and JUnit

2. Web Service Deployment in the course We have 11 teams, codenames are: mindz, photons, team2, xteam, lumiere solutions, mugqq, overnight enterprise, team7, websilon, team9, canadiantired The URL of the tomcat server is http://128.100.36.17:8080 The deployed web service should be placed under c:\program files\apache software foundation\tomcat 5.5\webapps\axis\WEB- INF\classes\<codename>

2.1 Develop Web service in AXIS deploy.wsdd, undeploy.wsdd can be generated from WSDL: java -cp $AXISCLASSPATH org.apache.axis.wsdl.wsdl2java -s -d Session -Nurn:AddressFetcher2=samples.addr samples/addr/addressbook.wsdl Start a simple Axis server java -cp.:$axisclasspath org.apache.axis.transport.http.simpleaxisserver -p 9012 & Deploy the web service java -cp $AXISCLASSPATH org.apache.axis.client.adminclient -p 9012 samples/addr/deploy.wsdd Call the web service from the client program java -cp.:$axisclasspath samples.addr.main -p 9012 $*

Feedback from the client Using proxy without session maintenance. (queries without session should say: "ADDRESS NOT FOUND!") >> Storing address for 'Purdue Boilermaker' >> Querying address for 'Purdue Boilermaker' >> Response is: [ADDRESS NOT FOUND!] >> Querying address for 'Purdue Boilermaker' again >> Response is: [ADDRESS NOT FOUND!] Using proxy with session maintenance. >> Storing address for 'Purdue Boilermaker' >> Querying address for 'Purdue Boilermaker' >> Response is: 1 University Drive West Lafayette, IN 47907 Phone: (765) 494-4900 >> Querying address for 'Purdue Boilermaker' again >> Response is: 1 University Drive West Lafayette, IN 47907 Phone: (765) 494-4900

2.2 Test Web Service using JUnit Test Cases (e.g. AddressBookTestCase.java) can be generated by: java -cp $AXISCLASSPATH org.apache.axis.wsdl.wsdl2java -s -d Session -Nurn:AddressFetcher2=samples.addr --testcase samples/addr/addressbook.wsdl Modify the generated AddressBookTestCase.java : public void dotest () throws Exception { String[] args = {"-p", "9012"}; Main.main(args); } Run the following command: java -cp.:$axisclasspath junit.textui.testrunner -noloading samples.addr.addressbooktestcase

Feedback from the Unit Test.- Testing address book sample. Using proxy without session maintenance. (queries without session should say: "ADDRESS NOT FOUND!") >> Storing address for 'Purdue Boilermaker' >> Querying address for 'Purdue Boilermaker' >> Response is: [ADDRESS NOT FOUND!] >> Querying address for 'Purdue Boilermaker' again >> Response is: [ADDRESS NOT FOUND!] Using proxy with session maintenance. >> Storing address for 'Purdue Boilermaker' >> Querying address for 'Purdue Boilermaker' >> Response is: 1 University Drive West Lafayette, IN 47907 Phone: (765) 494-4900 >> Querying address for 'Purdue Boilermaker' again >> Response is: 1 University Drive West Lafayette, IN 47907 Phone: (765) 494-4900 - Test complete. Time: 1.51 OK (1 test)

3. The Show time On March 9 (next Wednesday), Will be monitored and given an impression mark, 2% for presence, 8% for excellence in Phase B! Who will be the OMEGraphEditor Idol? 11 teams in two rounds mindz, photons, team2, xteam, lumiere solutions mugqq, overnight enterprise, team7, websilon, team9, canadiantired We do Q&A session after the presentations of each round 5 minutes per team for presentation, 5 minutes for question/answers Which team will be the star? A small prize will be endowed to the best teams.

Last lecture On Software Reuse The concepts of software reuse: to use the more than once Classical software reuse techniques Component-based software reuse How help with component-based software reuse Quality-based software reuse How helps with quality-base reuse Don t reinvent the wheel

What can be tested in units? A requirement: Given input that satisfies the precondition, whether the output satisfies the post-condition A unit can be a is the key! Replace user interaction with the scripts, if possible; replace some with stubs A unit tested can still have bugs, but most trivial bugs should have been found

What can not be tested? Generally, test can not replace the or Specifically for unit test, are not possible when the system is not ready yet

Test-driven development Extreme Programming Also called Paired programming How test helps? Refactoring How test helps?