How to Add Tomcat Server to Eclipse ?

After you have downloaded and extracted the Tomcat Server to say
D:\Tomcat7\apache-tomcat-7.0.52

Goto Eclipse
Run > Run As > Server

Select Apache > Tomcat v7.0 Server

Server Hostname as : localhost
Server Name : Tomcat v7.0 Server at localhost<any name>

Click Next

Provide Tomcat installation directory

Click Next

Move available resources(project) to the right pane, if not added.

Click Finish.
Notice a folder with name "Servers" is created in the "Package Explorer" view.

If you receive any port conflicts it means (default port :8080) is in use, change the settings in the server.xml file present under the "Servers" folder

Search for 8080 and replace it to example 9080.

<Connector port="9080" protocol="HTTP/1.1"
               connectionTimeout="20000"
               redirectPort="9443" />

<!-- Define an AJP 1.3 Connector on port 8009 -->
    <Connector port="9009" protocol="AJP/1.3" redirectPort="9443"/>

<Server port="9005" shutdown="SHUTDOWN">

Your url should now be accessible at http://localhost:9080    

Remove Directory Recursively from using Windows command

rd /?

Removes (deletes) a directory.

RMDIR [/S] [/Q] [drive:]path
RD [/S] [/Q] [drive:]path

    /S      Removes all directories and files in the specified directory
            in addition to the directory itself.  Used to remove a directory
            tree.

    /Q      Quiet mode, do not ask if ok to remove a directory tree with /S



---------------------------------------------------------------------------------

Example: D: Drive

mkdir dir
cd dir
mkdir dir1
mkdir dir2
cd ..
rd dir
The directory is not empty.

rd /s dir

Apache POI Excel Spreadsheet HSSF and XSSF

HSSF - is a pure Java Implementation of the Excel'97 2007 file format.
XSSF is the POI Project's pure Java implementation of the Excel 2007 OOXML - xlsx file format.

HSSF and XSSF provide ways to read spreadsheets
- create
- modify
- read
- write

Join model is HSSF and XSSF.

Reading an Excel
org.apache.poi.hssf.eventusermodel
org.apache.poi.xssf.eventusermodel


Use the usermodel api to modify the spreadsheet data.
You can also generate spreadsheets in the same way.

XSSF supports Excel 2007 OOXML (.xlsx) files are XML based, the memory footprint for processing them is higher than the older HSSF supported(.xls) binary files.

SXSSF

It is a low memory footprint by limiting access to the rows that are within a sliding window and written to disk. Window size can be set to grow dynamically; it can be trimmed periodically by an explicit call to flushRows(int keepRows).

It has a streaming nature of the implementation, there are the following limitations compared to XSSF
*Formula evaluation is not supported
* Sheet.clone() is not supported
*Only limited rows are accessible at a point in time.




Selenium Grid and Web Driver - Running multiple tests on multiple machines or browsers

Notes on Selenium Grid

Summary of my Understanding
Selenium-Grid support distributed test execution.
Selenium-Grid allows you run your tests on different machines against different browsers in parallel
It is useful in distributed test execution environments.

Selenium-Grid 2.0 is the latest release

To run your tests against
multiple browsers, (IE, Firefox, Chrome, Opera etc.,)
multiple versions of browser, and ( Firefox 23,24,25 etc)
browsers running on different operating systems. ( Windows 7, Windows 8 etc.,)

Additional Information
A grid consists of a single hub, and one or more nodes.

Starting a hub:

java -jar selenium-server-standalone-2.38.0.jar -role hub

The hub receives a test to be executed along with information on which browser and ‘platform’ (i.e. WINDOWS, LINUX, etc)
It ‘knows’ the configuration of each node that has been ‘registered’ to the hub.


To start a node using default parameters, run the following command from a command-line.

java -jar selenium-server-standalone-2.38.0.jar -role node  -hub http://localhost:4444/grid/register

 If running the hub and node on separate machines, simply replace ‘localhost’ with the hostname of the remote machine running the hub.

WARNING: Be sure to turn off the firewalls on the machine running your hub and nodes.

If this occurs you can either shutdown the other process that is using port 4444, or you can tell Selenium-Grid to use a different port for its hub. Use the -port option for changing the port used by the hub.

Configuring Grid
java -jar selenium-server-standalone-2.38.0.jar -role hub -port 4441

To see the ports used by all running programs on your machine use the command.
netstat -a


Configuring Node
The Selenium-Server provides two distinct functions, that of the Selenium-RC server
and that of Selenium-Grid

If you simply pass a -h option as you might first assume, you get the Selenium-RC Server options
but not those for Selenium-Grid.This would give you Selenium-RC’s server options.

Selenium-RC -help option
java -jar selenium-server-standalone-2.38.0.jar -h

Selenium-Grid -help option
java -jar selenium-server-standalone-2.38.0.jar -role node -h



Source: http://docs.seleniumhq.org/docs/07_selenium_grid.jsp

What is Cloujre programming language

Cloujre is pronounced as Closure.
It is a dialect of List programming language.

It is a functional programming language and runs on the JVM,CLR and JS eengines.
Clojure treats code as data and has a sophisticated macro system.

It focusses on programming with immutable(nonchangeable) values particularly multithreaded ones.

What is Storm ?

Storm is a distributed computation framework written predominantly in the Clojureprogramming language.

The project was open sourced after being acquired by Twitter.

It uses custom created spouts and bolts to define "information sources and manipulations" to allow
batch, distributed processing of streaming data.

Apache Software Foundation has accepted Storm into its incubator program
Initial Release : 17-Sep-2011

Creator : Nathan Marz
Team : BackType

Additional Useful Links
What is Clojure programming language ?
Read more about Nathan Marz?
What is Team BackType ?
Read more about incubator program

An Overview of JBOSS - Personal Notes

Reading : JBoss in Action - Manning
JBoss AS is a Java Enterprise Edition 5 (Java EE 5)–compliant application server

A Java application server standardizes the application development architecture.

defining several component models—standards that developers can use to
develop components
.

These components can be deployed into an application server
using a standard deployment model.

the server provides a set of services that are made available to the components.

The application component models include standards such as
Enterprise Java-Beans (EJBs),
Java Server Pages (JSP),
and servlets

Some examples of Java EE services
that are available to these components include remoting, security, transaction management,
persistence, messaging, resource pooling, concurrency control, naming and
directory services, and deployment.


An application server is a place to run your Java code.

Without an application server,
you’d write your application code and
start your application using a main method.

you’d need to start all the various services that you might need to access
(for example,
a database connection pool;
a transaction manager;
clustering services;
security services
).

You only have to provide
metadata—in the form of annotations or Extensible Markup Language (XML)—to
hook the services into your components; no code is typically necessary.


JBoss AS is the core product in Red Hat’s suite of Java middleware products that they
collectively call the JBoss Enterprise Middleware Suite (JEMS).JBoss Enterprise Middleware Suite (JEMS).

JBoss AS 5 now
ships with a library called the Eclipse JDT (from Eclipse IDE fame) that can compile
Java code at runtime;therefore, a JDK isn’t required to run JBoss AS 5.

if you don’t use an IDE, like Eclipse,
with its own compiler libraryyou may need a JDK installed
on your machine to develop Java applications


JBoss runs on top of a Java Virtual Machine (JVM), but some things are done better
with native operating system functionality
For example, web pages can generally be
served with better performance when using native libraries.

Running an application
as an operating-system service is also more easily accomplished with native support.

JBoss provides a supplementary library called JBoss Native that can
be downloaded and unzipped into your application server’s bin directory

JBoss Native from http://labs.jboss.com/jbossweb/downloads/.

To download the installer, go to http://labs.jboss.com/jemsinstaller/.

java –jar jems-installer-X.X.X.jar

JBoss AS 4 didn’t include the JBoss Web Server as a web container; it used Tomcat.
The difference is that the JBoss Web Server can be configured to use the JBoss Native
library for your OS to make the server run faster

A configuration is a set of services that runs in your server.






Red Hat doesn’t charge per license for JBoss AS,
setting up a JBoss AS cluster requires minimal configuration

JBoss AS has had support for Java SE 5.0 and EJB3 since 2005
They can view the bugtracking
database, read about designs for upcoming features, and look through the
developer forums to see what the lead developers of the different product modules
are discussing


Other open source
application servers include
WebSphere Community Edition (CE),
Geronimo, and
GlassFish

JBoss AS is built on a modular architecture that
allows you to run only the particular services that you need for your application environment.

you can remove services manually
(called slimming the server), but the installer can make it easier because you don’t
have to keep track of which services have dependencies on other services.





JBoss AS and all of its configuration files are contained entirely under a single directory structure.

As we’ll discuss in section 1.3.8, one of the best things to do is to version-control
the entire server structure(or at least the configuration directory).

the directory has one or more subdirectories.
Each subdirectory contains what is called a server configuration.
When you start JBoss AS, you start a particular server configuration

Each configuration contains a set of services and applications that are started when the server starts.

Other application servers have a fixed set of services that run when you start them.
you can configure your application server to be as big or as small
as you want it to be by adding or removing different services and applications from
your configuration.

At its core, JBoss AS is a microcontainer

A server configuration is a directory structure under the application server’s server directory that
contains code, libraries, and configuration files for a set of services and applications
that run when the server starts.


You want to pick a server configuration that’s closest to your needs and then add,
remove, and configure services as necessary


The binary distribution of JBoss AS comes with three configurations: default, minimal,
and all

default - Java EE5 server. does not include clustering services.
minimal - minimal set of services including microcontainer, some deployers and the JNDI service.
all - starts all services that ship with JBOSS AS including the clustering services.


Analytics