Tuesday, December 23, 2008

How to Setup WSAS on Apache Tomcat

WSO2 Web Services Application Server is an Open Source service based application server fully built on Apache Axis2 Framework. It supports to manage various web services and protocols.

WSO2 Web Services Application Server capable to deploy most of the application servers. Such as Apache Tomcat , IBM WebSphere , BEA WebLogic Server and JBoss.In this tutorial, I am going to explain how WSAS deploy on the Apache tomcat application server. Following are the steps need to follow.


Download Web Services Application Server and unzip package.


Download Apache Tomcat and unzip package

Steps 3

Tomcat need to WSAS resource files other than WSAS deployment package to run on the tomcat server in running time. So you should assign the entire resource files in one environment variable. To do that,

A. Copy “resources”,”conf” and “repository” folders from WSAS unzipped package.

B. Create new folder and name it as a “CarbonRepo”.

C. Paste copied folder in to “CarbonRepo”.

D. Set Environment variable called “CARBON_HOME” by locating “CarbonRepo” folder.

Ex: your CarbonRepo folder in “D:\Projects\Carbon\WSAS\ CarbonRepo

If you are using Linux,

export CARBON_HOME =/Projects/Carbon/WSAS/ CarbonRepo

If you are using Windows,

set CARBON_HOME = D:\Projects\Carbon\WSAS\ CarbonRepo

Step 4

Now WSAS need to deploy in apache tomcat. To deploy following instruction need to follow.

A. Copy “WEB-INF” in unzipped WSAS package/ webapps/ROOT

B. Create folder in tomcat “webapps” folder and paste copied WEB-INF.

Step 5

Now you have to enable https in your tomcat installation.(By default HTTPS protocol is disable in apache tomcat.)

A. Open server.xml in apache tomcat conf folder. This is the script tag need to add in apache tomcat server.xml

port="8443" minSpareThreads="5" maxSpareThreads="75"

enableLookups="true" disableUploadTimeout="true"

acceptCount="100" maxThreads="200"

scheme="https" secure="true" SSLEnabled="true"

keystoreFile="CARBON_HOME/resources/security/wso2carbon.jks" keystorePass="wso2carbon"

clientAuth="false" sslProtocol="TLS"/>

B. You need to locate wso2carbon.jks keystore file in keystoreFile parameter inside the Connector tag.

If your CARBON_HOME in “D:\Projects\Carbon\WSAS\ CarbonRepo”,this is the full path need to add in kerstoreFile parameter.

“D:/Projects/Carbon/WSAS/ CarbonRepo /resources/security/wso2carbon.jks”

C. Now HTTPS 8443 port number open for apache tomcat.

Steps 6

Now you should change WSAS “Server URL” in Server.xml. Because you need to add folder name to server url, what you create in tomcat webapps folder. Following are the instructions to change WSAS server.xml

A. Open server.xml file in your CARBON_HOME/conf folder.

B. Change the HTTPS port number from 9443 to 8443.because tomcat HTTPS enable in 8443 port number.

C. If your folder name is “WSAS” in tomcat webapps folder.

D. Your Final server url should be ,

Steps 7

Now you have to do small modification in Axis2.xml as well. In Tomcat HTTP transport enable in port number 8080, but in WSAS HTTP enable in 9763 port number. Because of this you have to re-map those HTTP and HTTPS port umbers in WSAS Axis2.xml.Change the HTTP port number from 9763 to 8080 and HTTPS from 9443 to 8443.that should change as,





To enable WSAS tools section you need to do another change in Axis2.xml.add “carbon” after back slash in Context root parameter.

Ex: - /carbon

Step 8

All the apache tomcat configurations finished now.Finally start apache tomcat.

A. Go to the Tomcat bin folder in command prompt/terminal.

B. Start tomcat as,

Windows = apache-tomcat-6.0.14\bin>catalina.bat run

Linux = apache-tomcat-6.0.14\bin>catalina.sh run

Step 9

After start apache tomcat this url you can use for access WSAS.


Monday, November 24, 2008

How to Check Java Script enable your browser

Some browsers disable of running java script by default.if you browse java script embedded web site,you may not seen java script functionalities.Using following instruction you can check you browser java script enable or not.

1. In address bar type  =    javascript:alert("Hello World")

2. If your browser already enable java script, you can see the following out put message box.


Tuesday, September 16, 2008

Create basic data service using WSO2 Data Service

This tutorial describes how you create simple data service using WSO2 Data Service. WSO2 Data Service is latest web service application introduced by the WSO2.Before you create your data service you have to setup WSO2 Data Service Server. Following are the prerequisites for set up the Server.


  1. Download WSO2 Data Service

  2. Download MySQL (This tutorial explain create a data service using MySQL Database)

  3. Download JDK 1.5 or Higher

Before setup WSO2 Data service you have to install JDK and MySQL. Once you set up JDK and MySQL you have to setup sample database. here's the sample database format.

Database Name : Test

Table Format : Table Name - student


You can use following SQL Command in MySQL Command prompt for creating a database.

mysql>create database Test;

mysql>CREATE table student(Name varchar(100),Marks int(50),Status varchar(100));

mysql>insert INTO student values ('Chamara',88,'Pass');

mysql>insert INTO student values ('John',76,'Pass');

mysql>insert INTO student values ('Suminda',69,'Pass');

mysql>insert INTO student values ('Peter',41,'Fail');

Next step is setup the WSO2 data service server. Extract the downloaded WSO2 Data service pack in any location.

Then you need to add MySQL database driver to WSO2 data service. thus otherwise you cannot access MySQL database from the WSO2 Data service. for that downloadmysql-connector-java-5.0.4-bin.jar and copy it to “\lib\extensions” inside data service folder.

If you are windows user you have to run wso2server.bat file or if you are Linux user you have to run wso2server.sh script using command prompt or shell to start WSO2 Data Service Server.

Once server start you can browser data service user interface using browser by using following URL.

For local Access :https://localhost:9443/ds/index.html

For Remote Access :https://[ServerIP]:9443/ds/index.html

[ServerIP] = IP address of the WSO2 data service server

Now you will see WSO2 Data service User interface.


To login to the Management Console Use following default user Credentials in sign in page.

User Name : admin

Password : admin

After login you can see WSO2 Data Service Home page as follows.


In this tutorial use only few major functionalities in WSO2 Data service application. Following are the two major functionalities use in this tutorial.

  • Data Services (See above Screen shot) - Displays List of data services currently deployed in the server.

  • Add (See above Screen shot) - Use to create new data service.

  • Try it tool - use check output of the data service

( For more information about WSO2 Data Services functionalities,refer User guide.)

Now you are ready to create new basic data service using MySQL Database. Follow there steps to create your data service. Chamara = 380

  1. Click "Add" and insert data service name and description and click "next"


2. Select "RDBMS" Data Source Type in Step-2 window and click Add button for configure the data base connection

(For Integrate Relational databases like MySQL,MSSQL Server,Oracle etc RDBMS data source type should select. in addition to that WSO2 Data service support MS Excel,CSV and JNDI Data Sources also.)


3. Insert data service connection id and select data base type as follows. you can insert any name for Connection id )


4. Once you fill above fields Driver class will automatically load.

5.JDBC url you have to change for your database information

Default JDBC url display as "jdbc:mysql://[machine-name/ip]:[port]/[database-name]".for a example your database machine ip is and MySQL port 3306 and database name id "Test", this is the way to fill up JDBC url.


6. Insert user name and password for database login


7. Click Test Connection button for establish data base connection.(if you are successfully configured in data service following message will applier) 545 chamara


8. Click Ok in configuration window and click next button in Step-2 window.

9.In Step 3 window click New query button for Add new query,

10. Insert following information in to add new query window.

Query ID = Name of the query (Test Query)

Data Source = Select data source connection created earlier. (Sample Connection)

SQL Statement = select * from Test

Grouped by element = Name of the group element (BaseElement)

Row name = Name of the sub element (Element)


11. Insert output mappings for get out put from the data service

for the click add new output mapping button and select element mapping type, insert output field name and SQL Column name. (output field name can be any name, but SQL Column name should equal to the database column name )


12. Add all the output mapping and click ok button.

13. click Next button for add new operation..

14. Click add new Operation button and type new operation name, select a query and click ok button.


15.Click Finish button for finish data service creation process.

Now you finished the data service creation process. you will see the created data service in data service list page.


For checking the data service you can use Try-it tool.fot that click "MyDataService"link in Service list.you will see page as follows.


Click Try this Service link and click Sample Operation button for get the output of the data service


Finally you will the the output as follows.


Wednesday, September 3, 2008

How to Access MySQL Database fom the Remote Location using Command Line

The is the way to access MySQL Database from the remote location using command line.

Before you access database from the remote location, you have to grant the permission to access database . (See How to Grant Permission )

then from remote location use following command

Syntax : mysql -h [IP Address of MySQL DB] -u [UserName] -p

IP Address of MySQL DB = IP Address of MySQL Server Machine

UserName = Username which granted in MySQL Server

Ex : mysql -h -u chamara -p

When you enter above command MySQL Server will ask Password.you have to submit password which you enter in granting permission phase.

Tuesday, September 2, 2008

How to Retrieve data using MySQL in Java Console

This is simple example of data retrieving from the MySQL Database using java code. For connecting mysql database from the java code, you have to add MySQL Connector jar file ( Download MySQL Connector ) in to your reference libraries.

Here's the sample Code....

public class ReadingMySQL


    public static void main(String[] args)


          Connection conn = null;
           Statement stmt = null;
            ResultSet rs = null;

            try {
              String dbURL = "jdbc:mysql://localhost:3306/wsasset";   // url of the mysql database
              String username = "root";    // username of  wsasset database
              String password = "";    // password of  wsasset database


               conn = DriverManager.getConnection(dbURL, username, password);

               stmt = conn.createStatement();

               if (stmt.execute("select * from assets"))

                     rs = stmt.getResultSet();


                    System.err.println("select failed");
               while (rs.next())

                   String entry = rs.getString(2);

           } catch (ClassNotFoundException ex)

                  System.err.println("Failed to load mysql driver");

       catch (SQLException ex) {
            System.out.println("SQLException: " + ex.getMessage());
            System.out.println("SQLState: " + ex.getSQLState());
            System.out.println("VendorError: " + ex.getErrorCode());

       finally {
            if (rs != null) {
                try {
                } catch (SQLException ex) { /* ignore */ }
                rs = null;
            if (stmt != null) {
                try {
                } catch (SQLException ex) { /* ignore */ }
                stmt = null;
            if (conn != null) {
                try {
                } catch (SQLException ex) { /* ignore */ }
                conn = null;

Wednesday, August 20, 2008

How to Grant Permission to Remote Access in MySQL

If you are using Client Server architecture with MySQL database,you cant directly access MySQL database which is in the server.

To Access MySQL Database thought the network,you have to grant the permission to each database.to do that you have to follow following steps.

Ex :- Create a database "WSO2"

1. Open MySQL Command Prompt

2. Type Following Command to grant usage permission to access MySQL

Syntax -

mysql> GRANT USAGE ON *.* TO username@[Client_IP] IDENTIFIED BY 'password';

Ex :-

mysql> GRANT USAGE ON *.* TO Chamara@ IDENTIFIED BY 'chamara123';

3. Then Type following command to Grant database Permission

Syntax -

GRANT ALL PRIVILEGES ON database_name.* TO username@[Client_IP];

Ex :-


Now you can access WSO2 Database from anywhere.

Tuesday, August 19, 2008

User Interface Testing at Glance


In Software Quality Assurance, UI Testing is most important Testing area.Because users are directly communicate with the User Interfaces.During the UI Testing Tester must concentrate to following key areas.

  • Colors of the controls and application
  • Look And Feel of the application
  • Ease of use
  • Controls up to Standard

Colors of the controls and application

        Tester should concentrate on color used to buttons,labels and other controls.if application use dark colors or very bright colors,it tired users eye.because I think middle class colors are very user friendly.

Look And Feel of the application

       Look and feel of the application is another important part.because user see the application at glance, it should be able to attract the user.other wise user will leave the application within a short time.so Tester should see the application user point of view and test look and feel.

Ease of use

       Every task of the application should very user friendly.if user want to do some task using application,application should provide that very easy manner.for that application can use wizards,Help tips,meaningful labels and icons etc.In testing "Ease of use" of an application tester need to check wether that application follows wizards,meaningful labels,buttons,icons etc by covering all the functionalities.

Controls up to Standard

        Using application controls based on the standards is another tip for improve user friendliness in application.in testing this section tester should concentrate whether that application follows  standard buttons,labels,text boxes,drop down boxes,control sizes etc.otherwise user may confuse with the controls application used.

Monday, August 18, 2008

What makes a good Test Engineer

A good test engineer has a 'test to break' attitude, an ability to take the point of view of the customer, a strong desire for quality, and an attention to detail. Tact and diplomacy are useful in maintaining a cooperative relationship with developers, and an ability to communicate with both technical (developers) and non-technical (customers, management) people is useful.
Previous software development experience can be helpful as it provides a deeper understanding of the software development process, gives the tester an appreciation for the developers' point of view, and reduce the learning curve in automated test tool programming. Judgment skills are needed to assess high-risk areas of an application on which to focus testing efforts when time is limited.

What makes a good Software QA engineer?
The same qualities a good tester has are useful for a QA engineer. Additionally, they must be able to understand the entire software development process and how it can fit into the business approach and goals of the organization. Communication skills and the ability to understand various sides of issues are important. In organizations in the early stages of implementing QA processes, patience and diplomacy are especially needed. An ability to find problems as well as to see 'what's missing' is important for inspections and reviews.

What makes a good QA or Test manager?

A good QA, test, or QA/Test(combined) manager should:
  • be familiar with the software development process
  • be able to maintain enthusiasm of their team and promote a positive atmosphere, despite what is a somewhat 'negative' process (e.g., looking for or preventing problems)
  • be able to promote teamwork to increase productivity
  • be able to promote cooperation between software, test, and QA engineers
  • have the diplomatic skills needed to promote improvements in QA processes
  • have the ability to withstand pressures and say 'no' to other managers when quality is insufficient or QA processes are not being adhered to
  • have people judgement skills for hiring and keeping skilled personnel
  • be able to communicate with technical and non-technical people, engineers, managers, and customers.
  • be able to run meetings and keep them focused.
What's the role of documentation in QA?

Critical. (Note that documentation can be electronic, not necessarily paper.) QA practices should be documented such that they are repeatable. Specifications, designs, business rules, inspection reports, configurations, code changes, test plans, test cases, bug reports, user manuals, etc. should all be documented. There should ideally be a system for easily finding and obtaining documents and determining what documentation will have a particular piece of information. Change management for documentation should be used if possible.

What's the big deal about 'requirements'?

One of the most reliable methods of insuring problems, or failure, in a complex software project is to have poorly documented requirements specifications. Requirements are the details describing an application's externally-perceived functionality and properties. Requirements should be clear, complete, reasonably detailed, cohesive, attainable, and testable. A non-testable requirement would be, for example, 'user-friendly' (too subjective). A testable requirement would be something like 'the user must enter their previously-assigned password to access the application'. Determining and organizing requirements details in a useful and efficient way can be a difficult effort; different methods are available depending on the particular project. Many books are available that describe various approaches to this task. Care should be taken to involve ALL of a project's significant 'customers' in the requirements process. 'Customers' could be in-house personnel or out, and could include end-users, customer acceptance testers, customer contract officers, customer management, future software maintenance engineers, salespeople, etc. Anyone who could later derail the project if their expectations aren't met should be included if possible. Organizations vary considerably in their handling of requirements specifications. Ideally, the requirements are spelled out in a document with statements such as 'The product shall.....'. 'Design' specifications should not be confused with 'requirements'; design specifications should be traceable back to the requirements.
In some organizations requirements may end up in high level project plans, functional specification documents, in design documents, or in other documents at various levels of detail. No matter what they are called, some type of documentation with detailed requirements will be needed by testers in order to properly plan and execute tests. Without such documentation.

Friday, August 15, 2008

What is Software Testing Life Cycle (STLC)

Software Testing is most important task in software development.Once you developing a software Application,you have to understand the software development life cycle.like wise Software Testing Life Cycle is also parallel goes with the Software Development life Cycle.

Now I am going to explain section by section of Software Testing Life Cycle.


1. Requirement Analysis

In Requirement analysis phase need to understand of all the software requirements.for this you can use Software Requirement Specification (SRS) Document.

2. Test Case Writing

In this phase you have to write test cases by covering all the features and functionality in application.

Test Case Document should contain following sections.

  • Test Case Name :- Name Of the Test Case (Ex : Click Ok Button)
  • Test Case :- How that test should do (Ex: Go to X window and Left Click Ok Button)
  • Expected Result : - Result Of the Test (Ex : Y window Display)
  • Status : - Actual Result of test case Pass/Fail
  • Comments : - Special Remarks of the test case.

3. Test Case Executing

Executing test cases in test case Document and filling.

4. Issue Reporting

During the application testing you have to track all the issues currently having.for this you can use issue tracking tool.

5.Issue Verification

After fix the issue you reported by the developer you have to retest that.above 3,4,5 STLC phases you have to follow as a cycle until application come up to some standard.

6. Release Product

In this phase you are ready to release the application.you have to make release notes for it.In release not contain all the areas you tested and what are the knows issues in this release application.

Thursday, June 19, 2008

Test Blog

This is an test blog.....