Tomcat

advertisement
Using the sample environment for
IBM Rational Service Testing and
Virtualization products
Note: This information contains examples of data and reports used in daily business operations. To illustrate
them as completely as possible, the examples include the names of individuals, companies, brands, and
products. All of these names are fictitious and any similarity to the names and addresses used by an actual
business enterprise is entirely coincidental.
Page 1 of 14
© IBM Corporation 2001, 2016
Note
Before using this information and the product it supports, read the information in “Legal Notices” on page 42.
Note: This information contains examples of data and reports used in daily business operations. To illustrate
them as completely as possible, the examples include the names of individuals, companies, brands, and
products. All of these names are fictitious and any similarity to the names and addresses used by an actual
business enterprise is entirely coincidental.
1
SCENARIO OVERVIEW ............................................................................................................................... 4
1.1
USAGE ............................................................................................................................................. 4
1.2
PURPOSE ......................................................................................................................................... 4
Page 2 of 14
© IBM Corporation 2001, 2016
1.3
AUDIENCE ........................................................................................................................................ 4
1.4
INSTALLED SOFTWARE ...................................................................................................................... 4
1.5
SOFTWARE THAT NEEDS TO BE INSTALLED BY THE USER ...................................................................... 4
1.5.1
Libstatgrab .................................................................................................................................................. 5
1.5.2
SQLite .......................................................................................................................................................... 5
1.6
LICENSES ......................................................................................................................................... 5
1.7
VMW ARE REQUIREMENTS ................................................................................................................. 5
1.8
HARDWARE REQUIREMENTS .............................................................................................................. 5
1.9
STARTING THE SERVICES ................................................................................................................... 6
1.10
STOPPING THE SERVICES .................................................................................................................. 6
1.11
HOSTS CONFIGURATION .................................................................................................................... 6
2
SYSTEM OVERVIEW .................................................................................................................................. 7
3
VALIDATION OF THE VACATION BOOKING SYSTEM ..................................................................................... 9
4
3.1
INTRODUCTION ................................................................................................................................. 9
3.2
TOMCAT ........................................................................................................................................... 9
3.3
TOMCAT AND DB2 ........................................................................................................................... 10
3.4
TOMCAT AND THE HOTELS WEB SERVICE .......................................................................................... 10
3.5
TOMCAT AND THE BOOKING MANAGEMENT WEB SERVICES ................................................................ 10
3.6
TOMCAT, W EBSPHERE MQ, W EBSPHERE APPLICATION SERVER AND DB2 ........................................ 10
EXTRA COMPONENTS AND CONFIGURATION ............................................................................................ 11
4.1
ADDNUMBERS CLIENT ..................................................................................................................... 11
5
VERIFYING SYSTEM STATUS .................................................................................................................... 12
6
FINAL CONFIGURATION AND SYSTEM VALIDATION ..................................................................................... 13
7
6.1
UPDATING SETTINGS – RESULTS DATABASE ...................................................................................... 13
6.2
UPDATING SETTINGS – FILE ASSOCIATIONS ....................................................................................... 13
6.3
FINAL TESTS ................................................................................................................................... 13
LEGAL NOTICES..................................................................................................................................... 15
Page 3 of 14
© IBM Corporation 2001, 2016
1 Scenario overview
1.1 Usage


The virtual image described in this guide is NOT to be used for production use or for training of clients.
The SUSE operating system included in the image is being distributed per agreements with Novell for
evaluation of and/or education about IBM products. Use of the operating system outside this context is not
permitted.
1.2 Purpose
This document describes how to use the Vacation Booking sample application environment based on SUSE Linux.
Virtual image login id: root
Password: greenhat
1.3 Audience
Familiarity with SUSE Linux is required to install a few components that are not included in the image but are needed
by the sample application. Knowledge of Linux in general will help with the use of this image.
1.4 Installed Software
Operating system - SUSE Linux 11
IBM WebSphere MQ 7.1.0.3
IBM WebSphere Application Server 8.5.5.0
IBM DB2 10.5
Apache Tomcat 7.0.27
Rational Integration Tester 8.5.0.2
Rational Test Control Panel 8.5.0.2
1.5 Software that needs to be installed by the user
Because certain software cannot be distributed by IBM, the user has to do this manually.
Page 4 of 14
© IBM Corporation 2001, 2016
1.5.1
Libstatgrab
In order to use the System Statistics probe for measuring the performance of the system, Rational Integration Tester
requires a library called libstatgrab. This will be useful when doing performance testing demonstrations, and
required by the performance testing training material. Download version 0.17 of this library from http://www.iscream.org/libstatgrab/ . Note that there is a newer version available, but as this was released after the 8.5
release of Rational Integration Tester and features a number of API changes, that newer version is unlikely to work.
Once downloaded, you may then build and install the library, as described in the README file accompanying the
software. Note that this will require that you have installed a C compiler – you may need to add this to your system
through your preferred package management software, though it will probably be there as part of the operating
system install.
On a 64 bit system, you will need to make sure that the libraries are accessible, as the installation process will only set
them up for a 32 bit system. To do this, run the following commands after installing the library:
ln -s /usr/local/lib/libstatgrab.so.6.2.3 /usr/lib/libstatgrab.so.6
ln -s /usr/local/lib/libstatgrab.so.6.2.3 /usr/lib/libstatgrab.so.6.2.3
1.5.2
SQLite
To use the example database in the integration testing course, a JDBC driver for SQLite is required. This is available
from https://bitbucket.org/xerial/sqlite-jdbc . Download the .jar file from that site, and put it in
/opt/sqlite/ , making sure that all users have read permission on the folder and file. You will then need to add it
to Rational Integration Tester using the Library Manager.
1.6 Licenses
Except for the operating system and Tomcat, all software mentioned above requires a license. Eval licenses from IBM
will suffice although the consumer is expected to provide production licenses.
1.7 VMWare requirements
VMWare 8 or later
1.8 Hardware requirements
As there is a lot of software involved in this setup, it is recommended that any machine used for this environment
have at least 4GB RAM. More RAM is suggested; less may lead to some components malfunctioning due to the need
to swap between RAM and the hard drive, and the timeouts that will occur as a result.
Page 5 of 14
© IBM Corporation 2001, 2016
1.9 Starting the services
Start the services by using the icons on the desktop:
Start Tomcat by double clicking this icon:
Start WebSphere Application Server by double clicking this icon:
Start the Flight Confirmation Server:
1.10 Stopping the services
Stop Tomcat by double clicking this icon:
Stop WebSphere Application Server by double clicking this icon:
Stop the Flight Confirmation Server by typing CTRL+C in the server’s console:
1.11 Hosts configuration
As everything is running within a single machine, it may be preferable to set up multiple hostnames for that machine,
to allow the appearance of running the environment across multiple machines. This will also help avoid problems
with changing hostnames is operating within a larger cloud environment. As an example, a training environment may
be set up with modifications to the file /etc/hosts to allow you to use the domains www.vbooking.com,
was.vbooking.com, mq.vbooking.com, db2.vbooking.com, and rit.vbooking.com, all pointing at
127.0.0.1. Note that this step is entirely optional. All steps in this guide may be completed by using localhost
or the hostname of the machine.
Page 6 of 14
© IBM Corporation 2001, 2016
2 System overview
The Vacation Booking system has 3 main flows through it, which involve several different pieces. Before you set up
the system, let’s look at what’s included.
Flight search and booking:
WAS – MQ Services
Services for:
Booking Request (XML/MQ)




MakeBooking
ProcessGlobal
ProcessMultinational
ProcessWorldwide
WAS – Web Services
Tomcat
Services For:
Booking Management (SOAP/HTTP)
Vacation Booking
webapp




Logon/Logoff
FindBooking
UpdateBooking
CancelBooking
JDBC
WAS – REST Services
Reservation Database (DB2)
Services For:
Flight Search (REST/JSON)

Flight Search
The Flight search and booking system has 3 different sections to it:

A user may choose to search for a flight from their web browser. The Tomcat web server will then make a
REST-based query to an application running inside the WebSphere Application Server, which talks to the DB2
database in turn. A response is sent back to the Tomcat web server in JSON format, which is then formatted
as a set of results for the user’s web browser

A user can book a flight from their web browser, either following a search, or by using a quick link to a
particular flight. This sends an XML booking request using WebSphere MQ, which is picked up by the
MakeBooking service running on the WebSphere Application Server. This also communicates to other
services running inside the same application server, also over WebSphere MQ, to handle any credit card
information. These services will read and write to the DB2 database, and finally, the MakeBooking service
will send a response back to the web server, using XML over WebSphere MQ.

Finally, a user can lookup, modify, or cancel existing bookings using a set of web services. These are running
inside the WebSphere Application Server, talk to the DB2 database, and again are accessed by the Tomcat
web server.
Hotel search and booking:
Page 7 of 14
© IBM Corporation 2001, 2016
Tomcat
Vacation Booking
webapp
HotelFinder web service
SOAP/HTTP
getHotels
bookHotel
This is a very simple part of the system. A user can search and book a hotel room. The Vacation Booking web
application running inside Tomcat will talk to the HotelFinder web service to handle this functionality. Note that the
HotelFinder web service is also hosted by Tomcat.
Flight upgrade and check-in:
Copybook/MQ
Flight Confirmation Server
Tomcat
Check-in Web Service
SOAP/HTTP
Vacation Booking
Admin webapp
getPassengerReservations
requestUpgrade
JDBC
JDBC
Reservation Database (DB2)
Through the Vacation Booking Administration web application running inside Tomcat, other functionality is also
available. Firstly, a couple of web services are provided to allow the user to check whether or not a passenger may
be upgraded. On trying to check in a passenger, regardless of whether or not they have been upgraded, a message is
sent to the flight confirmation server using WebSphere MQ – this communication is in COBOL Copybook format. A
response in the same format is sent back to the web application, at which point it updates the database directly.
Page 8 of 14
© IBM Corporation 2001, 2016
3 Validation of the Vacation Booking system
3.1 Introduction
It’s a good idea to check that the software is set up correctly, and that all components are communicating without
any issues. Note that WebSphere Application Server may take some time to start up – if you have started it from the
console, you will need to wait for the message open for eBusiness to appear.
3.2 Tomcat
To verify that Tomcat is running the supplied web applications correctly, try to load the pages at
http://localhost:8089/vbooking-home/ and http://localhost:8089/vbooking-admin/ . These
should both appear in your browser window.
Vacation Booking Home:
Vacation Booking Admin:
Page 9 of 14
© IBM Corporation 2001, 2016
3.3 Tomcat and DB2
To check that Tomcat can communicate with the database, load http://localhost:8089/vbooking-admin/ in
your web browser. You can now log into the page – no username or password is required. Following this, you should
see that the flights WW047 and WW297 appear. This tells us that the database is up and running, and that we can
communicate with it through the JDBC driver installed into Tomcat.
3.4 Tomcat and the Hotels web service
The hotel booking service is available from http://localhost:8089/vbooking-home/ . On the left of the page,
search for hotels in Barcelona. There should be 3 hotels listed on the following page. Note that most cities will not
return hotels, and that the search is case sensitive – attempting to search for hotels in other cities will not work.
3.5 Tomcat and the Booking Management web services
The WebSphere Application Server hosts a number of web services used by Tomcat. To access these, return to
http://localhost:8089/vbooking-home/ and follow the Amend my flight booking link. When asked for a
username and password, don’t enter anything – just press the login button. If you are then presented with the
option to search for a reservation, then communications with the web service are working correctly. Follow the
logout link to return to the main booking page.
3.6 Tomcat, WebSphere MQ, WebSphere Application Server and DB2
The final test checks that all components are working together. If you have not already done so, return to
http://localhost:8089/vbooking-home/. Choose the Book Now link listed under Stansted to Barcelona.
A booking form will then appear – after filling out all fields in the form, click Proceed to submit the form. Following a
short delay, the reservation number A00010 should appear in the final screen. If this and the sections above have
been successful, then the system is configured correctly, and you are ready to install Rational Integration Tester on
top of that system.
e read access to the folder /var/ibm/InstallationManager/license/LUM, and all files inside it.
Page 10 of 14
© IBM Corporation 2001, 2016
4 Extra Components and configuration
4.1 AddNumbers client
For simple demonstrations, or for the training course, there is a simple web service, called AddNumbers, which is
bundled with Rational Integration Tester. A client is available – and needs to be available to the user. The client is
simply a .jar file, and a shell script to execute it, and can be placed in any convenient location.
Page 11 of 14
© IBM Corporation 2001, 2016
5 Verifying system status
You may want to make sure that all parts of the system are running. To check each part of the system, you can use
the following procedures:
Services:
For the four services described in the previous section, the root user can check whether each one is running from the
console with the command service <service_name> status .
DB2:
As the database instance used in Vacation Booking is very simple anyway, the easiest thing to do here is to execute
the db2start command as either the user account that owns the instance (by default, db2inst1), or the end user
account, provided you have followed the instructions earlier in this document. If the database is running, the
db2start command will tell you there is nothing to do; if not, it will start the database. If the command fails to run
at all, you may have missed some of the Vacation Booking post-installation steps specified earlier in this document.
Tomcat:
Visit the URLs bookmarked on port 8089, as described earlier in this chapter – the Vacation Booking home page and
admin page. If these are running, then Tomcat is responding.
WebSphere Application Server
Visit the main console page, as bookmarked earlier in this chapter. If you receive a response, then the application
server is running. To check the individual applications, log in, then use the menu on the left of the page to navigate
to Applications > Application Types > WebSphere enterprise applications. You should then be able to see
the status of each of the individual applications running on the server. Note that if the WebSphere MQ queue
manager or DB2 database were not running when the application server started, some applications may be in a
Stopped state, and will need to be started.
Flight Confirmation Server:
This runs in a console, so it should be visible from that console.
Page 12 of 14
© IBM Corporation 2001, 2016
6 Final configuration and system validation
Once the system is set up, you can change a few simple settings within Rational Integration Tester for ease of use,
and check that you can record, test, and stub against the Vacation Booking System.
6.1 Updating settings – results database
At the beginning of a training course, it is preferable that students are able to start using the software as quickly as
possible. To help students with this, you can create a new project that refers to your results database. Any projects
created subsequently will then use the same database settings.
To be certain that any database settings will be remembered later, add the connection details for your results
database on the Server Settings page while creating a new project.
6.2 Updating settings – file associations
As with results databases, there is little reason to ask students to locate an editor for CSV or Excel files. Rational
Integration Tester has settings that state how these types of files should be opened.
1. Once a new project has been created, go to the menu item Project > Preferences.
2. The Preferences window will appear. Select Applications from the left hand column of the dialog.
3. Press Add.
4. Another dialog will appear, allowing you to enter a file extension, and a command to use when opening files
with that extension. Enter .xls as the first file extension, and provide the command to launch an editor that
can work with xls files. Press OK once you are finished.
5. Repeat this procedure for .xlsx files and .csv files. Note that some spreadsheet editors may attempt to
change the format of a .csv file, so you may prefer to use a text editor to work with those files.
6.3 Final tests
Before concluding, you will need to check that everything is now integrated and working correctly. The checklist
below provides a set of checks that you can run on your system to make sure that it can handle training courses and
demonstration scenarios. Before attempting to run these checks, make sure that all parts of the system are running.
It is assumed that any system verification is being carried out by an experienced Rational Integration Tester user.
Explanations of each check are not provided within this document.
Run through all checks in Chapter 5 of this guide.
Start the addNumbers web service and the Login web service
Connect to RTCP with your web browser, and log in
View any agents and proxies in the system from RTCP. Note that any JDBC proxies may not appear
Page 13 of 14
© IBM Corporation 2001, 2016
until the program using the proxy has executed an SQL command.
Create a new project in Rational Integration Tester, successfully connecting to RTCP and the results
database
Connect to the physical transports for the WebSphere MQ server, WAS, and DB2
Connect to all 4 physical http connections, on ports 8086, 8088, 8089 and 9080.
Record traffic on WebSphere MQ, as well as on HTTP ports 8089 and 9080
Run a test using each of the transports used within the system
Run a test suite, and view the results in both the RIT Results Gallery and RTCP.
Run a stub over WebSphere MQ, and for the HTTP services on ports 8089 and 9080
Run stubs using sift and pass through on WebSphere MQ and HTTP services; be sure to test
scenarios where the stub handles the message, and where the stub passes the message on to the
live system.
Record JDBC interactions through the JDBC proxy
Create and run a database stub
Run a performance test on any transport, using the System Statistics probe, and view the results
Publish and deploy a stub using RTCP and the Agent
Page 14 of 14
© IBM Corporation 2001, 2016
7 Legal Notices
This information was developed for products and services offered in the U.S.A.
IBM may not offer the products, services, or features discussed in this document in other countries. Consult your
local IBM representative for information on the products and services currently available in your area. Any reference
to an IBM product, program, or service is not intended to state or imply that only that IBM product, program, or
service may be used. Any functionally equivalent product, program, or service that does not infringe any IBM
intellectual property right may be used instead. However, it is the user's responsibility to evaluate and verify the
operation of any non-IBM product, program, or service.
IBM may have patents or pending patent applications covering subject matter described in this document. The
furnishing of this document does not grant you any license to these patents. You can send license inquiries, in writing,
to:
IBM Director of Licensing
IBM Corporation
North Castle Drive
Armonk, NY 10504-1785
U.S.A.
For license inquiries regarding double-byte (DBCS) information, contact the IBM Intellectual Property Department in
your country or send inquiries, in writing, to:
Intellectual Property Licensing
Legal and Intellectual Property Law
IBM Japan, Ltd.
1623-14, Shimotsuruma, Yamato-shi
Kanagawa 242-8502 Japan
The following paragraph does not apply to the United Kingdom or any other country where such
provisions are inconsistent with local law:
 INTERNATIONAL BUSINESS MACHINES CORPORATION PROVIDES THIS PUBLICATION “AS IS” WITHOUT
WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Some
states do not allow disclaimer of express or implied warranties in certain transactions, therefore, this
statement may not apply to you
 This information could include technical inaccuracies or typographical errors. Changes are periodically made
to the information herein; these changes will be incorporated in new editions of the publication. IBM may
make improvements and/or changes in the product(s) and/or the program(s) described in this publication at
any time without notice.
 If you are viewing this information in softcopy, the photographs and color illustrations may not appear.
Page 15 of 14
© IBM Corporation 2001, 2016





Any references in this information to non-IBM websites are provided for convenience only and do not in any
manner serve as an endorsement of those websites. The materials at those websites are not part of the
materials for this IBM product and use of those websites is at your own risk.
Any performance data contained herein was determined in a controlled environment. Therefore, the results
obtained in other operating environments may vary significantly. Some measurements may have been made
on development-level systems and there is no guarantee that these measurements will be the same on
generally available systems. Furthermore, some measurements may have been estimated through
extrapolation. Actual results may vary. Users of this document should verify the applicable data for their
specific environment.
Information concerning non-IBM products was obtained from the suppliers of those products, their published
announcements or other publicly available sources. IBM has not tested those products and cannot confirm
the accuracy of performance, compatibility or any other claims related to non-IBM products. Questions on
the capabilities of non-IBM products should be addressed to the suppliers of those products.
All statements regarding IBM's future direction or intent are subject to change or withdrawal without notice,
and represent goals and objectives only.
This information contains examples of data and reports used in daily business operations. To illustrate them
as completely as possible, the examples include the names of individuals, companies, brands, and products.
All of these names are fictitious and any similarity to the names and addresses used by an actual business
enterprise is entirely coincidental.
COPYRIGHT LICENSE

This information contains sample application programs in source language, which illustrate programming
techniques on various operating platforms. You may copy, modify, and distribute these sample programs in
any form without payment to IBM, for the purposes of developing, using, marketing or distributing
application programs conforming to the application programming interface for the operating platform for
which the sample programs are written. These examples have not been thoroughly tested under all
conditions. IBM, therefore, cannot guarantee or imply reliability, serviceability, or function of these
programs. The sample programs are provided "AS IS", without warranty of any kind. IBM shall not be liable
for any damages arising out of your use of the sample programs.
Trademarks and service marks




IBM, the IBM logo, and ibm.com are trademarks or registered trademarks of International Business Machines
Corp., registered in many jurisdictions worldwide. Other product and service names might be trademarks of
IBM or other companies. A current list of IBM trademarks is available on the web at
www.ibm.com/legal/copytrade.shtml.
Linux is a registered trademark of Linus Torvalds in the United States, other countries, or both.
Java and all Java-based trademarks and logos are trademarks or registered trademarks of Oracle and/or its
affiliates
Other company, product, or service names may be trademarks or service marks of others.
Page 16 of 14
© IBM Corporation 2001, 2016
Download